Class: ItegrationVerb
- Inherits:
-
Object
- Object
- ItegrationVerb
- Extended by:
- ItegrationAttr
- Defined in:
- lib/tdl/exlib/itegration_verb.rb,
lib/tdl/exlib/itegration_verb.rb
Overview
动态删除 silence_ block
Direct Known Subclasses
Constant Summary collapse
- @@child =
[]
- @@test_unit_inst_verb_procs =
[]
Instance Attribute Summary collapse
-
#force_link_maps ⇒ Object
hash 用于强制匹配 link_itgt.
-
#init_inst ⇒ Object
Returns the value of attribute init_inst.
-
#inst_index ⇒ Object
Returns the value of attribute inst_index.
-
#names_pool ⇒ Object
Returns the value of attribute names_pool.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#pins_map ⇒ Object
Returns the value of attribute pins_map.
-
#top_module ⇒ Object
Returns the value of attribute top_module.
Class Method Summary collapse
-
.constraints_block(&block) ⇒ Object
约束 block.
- .curr_itgt_pop ⇒ Object
- .curr_itgt_push(itgt) ⇒ Object
-
.def_test_unit(name, path, &block) ⇒ Object
@@inst_test_unit_blocks = {}.
- .flag_match(attr) ⇒ Object
- .get_instance_var(name) ⇒ Object
-
.inherited(subclass) ⇒ Object
blocks = blocks_hash if blocks.length == 1 block = blocks sdlm.instance_exec(self,&block) elsif blocks.length > 1 # block = Proc.new do blocks.each do |b| # b.call sdlm.instance_exec(self,&b) end # end else next end end end ItegrationVerb.curr_itgt_pop end.
-
.record_instance_var_block(name, default = [], &block) ⇒ Object
sdl_eval_dir_hash[name] = dir if dir instance_variable_set(“@sdl_eval_dir_hash”,sdl_eval_dir_hash) instance_variable_set(“@sdl_eval_blocks_post_hash”,blocks_hash) end end end end.
- .set_instance_var(name, value) ⇒ Object
-
.techbench_block(name, default_tb_argvs_hash = {}) ⇒ Object
测试向量实现 作用于是 top_module.
- .test_unit_inst(&filter_block) ⇒ Object
- .test_unit_inst_verb(&filter_block) ⇒ Object
- .top_module_eval(&block) ⇒ Object
- .top_module_techbench_eval(&block) ⇒ Object
-
.with_new_itgt(itgt, &block) ⇒ Object
关于 当前 itgt stack 操作.
Instance Method Summary collapse
- #cal_inst_index(base = 0) ⇒ Object
- #check_same_method(name) ⇒ Object
- #child_inst_itgt ⇒ Object
- #delete_silence(name) ⇒ Object
-
#flag_match(attr) ⇒ Object
判断当前itgt class export flag 是否匹配参数.
- #get_itgt_var(name, default = [], &block) ⇒ Object
- #implicit_link_eval ⇒ Object
-
#initialize(name_str = nil, pins_map = {}, top_module = nil) ⇒ ItegrationVerb
constructor
A new instance of ItegrationVerb.
-
#inst ⇒ Object
define_singleton_method(:inst) do.
- #inst_constraints ⇒ Object
- #link_eval ⇒ Object
- #set_itgt_var(name, value) ⇒ Object
- #tb_inst ⇒ Object
- #techbench_vector ⇒ Object
-
#test_unit_inst ⇒ Object
测试用例 实例化.
-
#test_unit_inst_verb ⇒ Object
测试用例 实例化.
Methods included from ItegrationAttr
compact_link_itgt, has_attr, has_flag, itegration_explort, itegration_hash, itegration_link, link_explort, link_itgt, param
Constructor Details
#initialize(name_str = nil, pins_map = {}, top_module = nil) ⇒ ItegrationVerb
Returns a new instance of ItegrationVerb.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 347 def initialize(name_str=nil,pins_map={},top_module=nil) @top_module = top_module if name_str.to_s.strip.empty? @nickname = "" else @nickname = "#{name_str.to_s.strip}_" end @pins_map = pins_map _names_pool_inst() # @itgt_links = ItgtLinks.new(self) ## 为child module 生成方法 # init_children_modules() # init_children_modules_post() @force_link_maps = {} ## hash 用于强制匹配 link_itgt end |
Instance Attribute Details
#force_link_maps ⇒ Object
hash 用于强制匹配 link_itgt
276 277 278 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 276 def force_link_maps @force_link_maps end |
#init_inst ⇒ Object
Returns the value of attribute init_inst.
274 275 276 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 274 def init_inst @init_inst end |
#inst_index ⇒ Object
Returns the value of attribute inst_index.
275 276 277 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 275 def inst_index @inst_index end |
#names_pool ⇒ Object
Returns the value of attribute names_pool.
273 274 275 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 273 def names_pool @names_pool end |
#nickname ⇒ Object
Returns the value of attribute nickname.
273 274 275 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 273 def nickname @nickname end |
#pins_map ⇒ Object
Returns the value of attribute pins_map.
273 274 275 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 273 def pins_map @pins_map end |
#top_module ⇒ Object
Returns the value of attribute top_module.
272 273 274 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 272 def top_module @top_module end |
Class Method Details
.constraints_block(&block) ⇒ Object
约束 block
1051 1052 1053 1054 1055 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 1051 def self.constraints_block(&block) carray = self.record_instance_var_block("constraints_array",[]) carray << block if block_given? self.set_instance_var("constraints_array",carray) end |
.curr_itgt_pop ⇒ Object
311 312 313 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 311 def self.curr_itgt_pop $_implicit_curr_itgt_.pop end |
.curr_itgt_push(itgt) ⇒ Object
307 308 309 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 307 def self.curr_itgt_push(itgt) $_implicit_curr_itgt_ << itgt end |
.def_test_unit(name, path, &block) ⇒ Object
@@inst_test_unit_blocks = {}
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 875 def self.def_test_unit(name,path,&block) # @@_inst_test_unit_blocks_ ||= {} # # @@_inst_test_unit_blocks_ << [name.to_s, path, block] # itgt_testunit = ItegrationTestUnit.new(name:name,path:path, block: block, itgt: nil) # @@_inst_test_unit_blocks_["#{self}_#{name.to_s}"] = itgt_testunit # self.define_singleton_method(name.to_s) do # itgt_testunit # end ## 创建 实例变量 define_method name.to_s do ## 此时的 self 是实例 if self.instance_variable_get("@_#{name.to_s}_") return self.instance_variable_get("@_#{name.to_s}_") else itgt_testunit = ItegrationTestUnit.new(name:name,path:path, block: block, itgt: self) self.instance_variable_set("@_#{name.to_s}_", itgt_testunit) return itgt_testunit end # itgt_testunit.itgt = self # itgt_testunit = ItegrationTestUnit.new(name:name,path:path, block: block, itgt: self) # itgt_testunit end # @@_inst_test_unit_blocks_ _inst_tb_blocks_ = instance_variable_get("@_inst_test_unitx_blocks_") _inst_tb_blocks_ ||= {} _inst_tb_blocks_[name] = {:path => path, :block => block} instance_variable_set("@_inst_test_unitx_blocks_",_inst_tb_blocks_) end |
.flag_match(attr) ⇒ Object
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 321 def self.flag_match(attr) explort_flags = get_itgt_var('itegration_flag_collect') unless attr return true end if attr.empty? return true end unless explort_flags explort_flags = [] end explort_flags = explort_flags.map{ |e| e.to_s }.sort attr = attr.map { |e| e.to_s }.sort if(explort_flags & attr) == attr return true else return false end end |
.get_instance_var(name) ⇒ Object
981 982 983 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 981 def self.get_instance_var(name) _inst_ccc_ = instance_variable_get("@_#{name}_") end |
.inherited(subclass) ⇒ Object
blocks = blocks_hash
if blocks.length == 1
block = blocks[0]
sdlm.instance_exec(self,&block)
elsif blocks.length > 1
# block = Proc.new do
blocks.each do |b|
# b.call
sdlm.instance_exec(self,&b)
end
# end
else
next
end
end
end
ItegrationVerb.curr_itgt_pop
end
640 641 642 643 644 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 640 def self.inherited(subclass) unless @@child.include? subclass @@child << subclass end end |
.record_instance_var_block(name, default = [], &block) ⇒ Object
sdl_eval_dir_hash[name] = dir if dir
instance_variable_set("@_sdl_eval_dir_hash_",_sdl_eval_dir_hash_)
instance_variable_set("@_sdl_eval_blocks_post_hash_",_blocks_hash_)
end
end
end
end
961 962 963 964 965 966 967 968 969 970 971 972 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 961 def self.record_instance_var_block(name,default=[],&block) _inst_ccc_ = instance_variable_get("@_#{name}_") _inst_ccc_ ||= default if _inst_ccc_.is_a? Array _inst_ccc_ << block if block_given? elsif _inst_ccc_.is_a? Hash _inst_ccc_[name.to_s] = block if block_given? else _inst_ccc_ = block end instance_variable_set("@_#{name}_",_inst_ccc_) end |
.set_instance_var(name, value) ⇒ Object
974 975 976 977 978 979 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 974 def self.set_instance_var(name,value) _inst_ccc_ = instance_variable_get("@_#{name}_") # _inst_ccc_ ||= default _inst_ccc_ = value instance_variable_set("@_#{name}_",_inst_ccc_) end |
.techbench_block(name, default_tb_argvs_hash = {}) ⇒ Object
测试向量实现 作用于是 top_module
986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 986 def self.techbench_block(name,default_tb_argvs_hash={}) hash = self.record_instance_var_block("techbench_name_hash",{}) ## args hash argvs_hash = self.get_instance_var("techbench_argvs_hash") || {} # self.set_instance_var("techbench_argvs_hash",{}) unless argvs_hash argvs_hash[name.to_s] = default_tb_argvs_hash set_instance_var("techbench_argvs_hash",argvs_hash) ##需要激活的block self.define_singleton_method("#{name}_tb_eval") do |&block| ## 把 block 塞到数组中 hash[name.to_s] = self.record_instance_var_block("techbench_#{name}_blocks",[],&block) self.set_instance_var("techbench_name_hash",hash) hash[name.to_s] end ## 生成实例方法 self.class_exec do define_method(:active_techbench_vector) do |name,tb_argvs_hash={}| hash = get_itgt_var("active_techbench_vector",{}) _default_tb_argvs_hash = self.class.get_instance_var("techbench_argvs_hash")[name.to_s] || {} hash[name.to_s] = _default_tb_argvs_hash.merge(tb_argvs_hash) set_itgt_var('active_techbench_vector',hash) end end end |
.test_unit_inst(&filter_block) ⇒ Object
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 551 def self.test_unit_inst(&filter_block) blocks = @@_inst_test_unit_blocks_ || {} return unless blocks return if blocks.empty? return unless TopModule.sim ItegrationVerb.curr_itgt_push nil blocks.each do |key,valueItgtTU| # @top_module.techbench.instance_exec(self,&b.clone) if !(block_given?) || filter_block.call(valueItgtTU) sdlm = TestUnitModule.new(name: "tu_#{key}",out_sv_path: valueItgtTU.path) $_implicit_curr_itgt_.with_none_itgt do sdlm.input - "from_up_pass" sdlm.output.logic - "to_down_pass" end # sdlm.instance_exec(nil,&valueItgtTU.block) sdlm.instance_exec(valueItgtTU,&valueItgtTU.block) if valueItgtTU.path && File.exist?(valueItgtTU.path) sdlm.gen_sv_module Tdl.Puts "[warnning] #{key} path error !!!" else sdlm.origin_sv = true end end end ItegrationVerb.curr_itgt_pop end |
.test_unit_inst_verb(&filter_block) ⇒ Object
505 506 507 508 509 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 505 def self.test_unit_inst_verb(&filter_block) @@test_unit_inst_verb_procs.each do |e| e.call( filter_block ) end end |
.top_module_eval(&block) ⇒ Object
845 846 847 848 849 850 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 845 def self.top_module_eval(&block) _inst_blocks_ = instance_variable_get("@_inst_blocks_") _inst_blocks_ ||= [] _inst_blocks_ << block instance_variable_set("@_inst_blocks_",_inst_blocks_) end |
.top_module_techbench_eval(&block) ⇒ Object
852 853 854 855 856 857 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 852 def self.top_module_techbench_eval(&block) _inst_tb_blocks_ = instance_variable_get("@_inst_tb_blocks_") _inst_tb_blocks_ ||= [] _inst_tb_blocks_ << block instance_variable_set("@_inst_tb_blocks_",_inst_tb_blocks_) end |
.with_new_itgt(itgt, &block) ⇒ Object
关于 当前 itgt stack 操作
300 301 302 303 304 305 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 300 def self.with_new_itgt(itgt,&block) $_implicit_curr_itgt_ << itgt rel = block.call $_implicit_curr_itgt_.pop return rel end |
Instance Method Details
#cal_inst_index(base = 0) ⇒ Object
284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 284 def cal_inst_index(base=0) if @inst_index if base > @inst_index @inst_index = base end else @inst_index = base end child_inst_itgt.each do |e| e.cal_inst_index(@inst_index + 1) end end |
#check_same_method(name) ⇒ Object
685 686 687 688 689 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 685 def check_same_method(name) if respond_to? name.to_s raise TdlError.new("Itegration `#{to_s}` can't Redefine method #{name}") end end |
#child_inst_itgt ⇒ Object
279 280 281 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 279 def child_inst_itgt @child_inst_itgt ||=[] end |
#delete_silence(name) ⇒ Object
1074 1075 1076 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 1074 def delete_silence(name) get_itgt_var('explort_silence_hash').delete(name.to_s) end |
#flag_match(attr) ⇒ Object
判断当前itgt class export flag 是否匹配参数
317 318 319 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 317 def flag_match(attr) self.class.flag_match(attr) end |
#get_itgt_var(name, default = [], &block) ⇒ Object
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 662 def get_itgt_var(name,default=[],&block) unless instance_variable_get("@_#{name}_") if block_given? rel = block.call(default) else rel = default end instance_variable_set("@_#{name}_",rel) container = instance_variable_get("@_#{name}_") else container = instance_variable_get("@_#{name}_") end return container end |
#implicit_link_eval ⇒ Object
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 800 def implicit_link_eval @top_module.implicit_itgt_collect ||= [] #生成link 数组便是 当前 itgt引用 container = self.class.get_itgt_var('itegration_link_collect') container.each do |e| container_attrs = self.class.get_itgt_var('itegration_link_hash')[e] mark = false ## 先从 已经加入的隐性itgt搜索 @top_module.implicit_itgt_collect.each do |i| explort_attrs = i.class.get_itgt_var('itegration_explort_collect') if (explort_attrs & container_attrs).sort == container_attrs.sort mark = true define_singleton_method(e) do ItegrationVerbAgent.new(i) end i.implicit_link_eval break end end next if mark ## 找到了 就处理下一个Link ## ## 如果没有找到 再从 ItegrationVerb children里面找到比加入 ## 去除隐性引入 unless TopModule.itgt_implicit_reject @@child.each do |c| explort_attrs = c.get_itgt_var('itegration_explort_collect') if (explort_attrs & container_attrs).sort == container_attrs.sort isp = @top_module.add_itegration(c.to_s,nickname:'implicit',implicit:true) @top_module.implicit_itgt_collect << isp ## 如果是隐性添加,先不要加入pin_map define_singleton_method(e) do ItegrationVerbAgent.new(isp) end mark = true break end end end end end |
#inst ⇒ Object
define_singleton_method(:inst) do
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 402 def inst # 先生成子模块 ## 执行 生成 sdl module # inst_child_module() blocks = self.class.instance_variable_get("@_inst_blocks_") ItegrationVerb.curr_itgt_push(self) if blocks.length == 1 block = blocks[0] @top_module.instance_exec(self,&block.clone) ItegrationVerb.curr_itgt_pop elsif blocks.length > 1 # block = Proc.new do blocks.each do |b| @top_module.instance_exec(self,&b.clone) end # end ItegrationVerb.curr_itgt_pop else ItegrationVerb.curr_itgt_pop return end ## 执行 生成 sdl module # inst_child_module_post() ## 执行top module techbench eval tb_inst() ## 执行测试向量 techbench_vector() ## 执行 约束 inst_constraints() ## 执行单元测试 ## 改到 运行 top_module _exec_add_test_unit 那边执行 # test_unit_inst() test_unit_inst_verb() end |
#inst_constraints ⇒ Object
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 1057 def inst_constraints() carray = self.class.get_instance_var("constraints_array") return unless carray # $_implicit_curr_itgt_ = self ItegrationVerb.curr_itgt_push self carray.each do |b| @top_module.constraint.instance_exec(self,&b.clone) end ItegrationVerb.curr_itgt_pop end |
#link_eval ⇒ Object
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 692 def link_eval @top_module.implicit_itgt_collect ||= [] #生成link 数组便是 当前 itgt引用 container = self.class.get_itgt_var('itegration_link_collect') container.each do |e| container_attrs = self.class.get_itgt_var('itegration_link_hash')[e] flag_attrs = self.class.get_itgt_var('itegration_flag_hash',{})[e] mark = false ## 先查看 force link maps if @force_link_maps[e] i = @force_link_maps[e] explort_attrs = i.class.get_itgt_var('itegration_explort_collect') if ((explort_attrs & container_attrs).sort == container_attrs.sort && i.flag_match(flag_attrs)) unless self.respond_to? e define_singleton_method(e) do ## 如果从其他模块调用则出发 dynac_active ItegrationVerbAgent.new(i) end i.link_eval i.child_inst_itgt << self end else puts "Dont container `#{container_attrs.sort - (explort_attrs & container_attrs).sort }` !!!" raise "itegration `#{self.class}` `force_link_maps[#{e}]` done match `#{i.class}`" end end ## 先从 top_module 显式加入的itgt搜索 @top_module.itgt_collect.each do |i| explort_attrs = i.class.get_itgt_var('itegration_explort_collect') # explort_flags = i.class.get_itgt_var('itegration_flag_collect') if ((explort_attrs & container_attrs).sort == container_attrs.sort && i.flag_match(flag_attrs)) mark = true unless self.respond_to? e define_singleton_method(e) do ## 如果从其他模块调用则出发 dynac_active ItegrationVerbAgent.new(i) end i.link_eval i.child_inst_itgt << self end # cal_inst_index(i) break end end if mark ## 找到了 就处理下一个Link next else ## 处理 compact link compact_container = self.class.get_itgt_var('itegration_compact_link_collect',[]) if compact_container.include? e unless self.respond_to? e define_singleton_method(e) do nil end end next end end ## 先从 已经加入的隐性itgt搜索 ## 去除隐性引入 unless TopModule.itgt_implicit_reject @top_module.implicit_itgt_collect.each do |i| explort_attrs = i.class.get_itgt_var('itegration_explort_collect') if ((explort_attrs & container_attrs).sort == container_attrs.sort && i.flag_match(flag_attrs)) # puts "Itgt Good" mark = true unless self.respond_to? e define_singleton_method(e) do ## 如果从其他模块调用则出发 dynac_active ItegrationVerbAgent.new(i) end i.link_eval i.child_inst_itgt << self end break end end next if mark ## 找到了 就处理下一个Link ## 如果没有找到 再从 ItegrationVerb children里面找到比加入 @@child.each do |c| explort_attrs = c.get_itgt_var('itegration_explort_collect') # puts explort_attrs if ((explort_attrs & container_attrs).sort == container_attrs.sort && c.flag_match(flag_attrs)) # puts "Child Good" isp = @top_module.add_itegration(c.to_s,nickname:'implicit',implicit:true) @top_module.implicit_itgt_collect << isp ## 如果是隐性添加,先不要加入pin_map define_singleton_method(e) do ItegrationVerbAgent.new(isp) end isp.link_eval isp.child_inst_itgt << self mark = true break end end end unless mark raise TdlError.new("<#{self}>没有找到符合Link 的上级 Itgt:\n ATTR: #{container_attrs.inspect}\n FLAG: #{flag_attrs.inspect}\n") end end end |
#set_itgt_var(name, value) ⇒ Object
678 679 680 681 682 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 678 def set_itgt_var(name,value) # rel = get_itgt_var(name) instance_variable_set("@_#{name}_",value) container = instance_variable_get("@_#{name}_") end |
#tb_inst ⇒ Object
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 441 def tb_inst # define_singleton_method(:tb_inst) do blocks = self.class.instance_variable_get("@_inst_tb_blocks_") return unless blocks ItegrationVerb.curr_itgt_push self if blocks.length == 1 block = blocks[0] @top_module.techbench.instance_exec(self,&block.clone) elsif blocks.length > 1 # block = Proc.new do blocks.each do |b| # b.call @top_module.techbench.instance_exec(self,&b.clone) end # end else ; end ItegrationVerb.curr_itgt_pop end |
#techbench_vector ⇒ Object
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 1014 def techbench_vector ## 先获取需要激活的tb hash = get_itgt_var("active_techbench_vector",{}) ## 从 class 获取 techbench_name_hash class_block_hash = self.class.get_instance_var('techbench_name_hash') ## 根据 需要激活的 tb name 激活 block ItegrationVerb.curr_itgt_push self hash.each do |key,value| blocks = class_block_hash[key.to_s] unless blocks raise TdlError.new("Itgt Class <#{self.class.to_s}> 没有定义 techbench <#{key}>") end tb_argvs_hash = value # $_implicit_curr_itgt_ = self if blocks.length == 1 block = blocks[0] ## 在top module 的上下文下激活blocks @top_module.instance_exec(self,tb_argvs_hash,&block.clone) elsif blocks.length > 1 # block = Proc.new do blocks.each do |b| # b.call ## 在top module 的上下文下激活blocks @top_module.instance_exec(self,tb_argvs_hash,&b.clone) end # end else next end end ItegrationVerb.curr_itgt_pop end |
#test_unit_inst ⇒ Object
测试用例 实例化
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 512 def test_unit_inst blocks = self.class.class_variable_get("@@_inst_test_unit_blocks_") # puts blocks # raise " -----" return unless blocks return if blocks.empty? ItegrationVerb.curr_itgt_push self unless TopModule.sim ItegrationVerb.curr_itgt_pop return end blocks.each do |key,valueItgtTU| # @top_module.techbench.instance_exec(self,&b.clone) if SdlModule.exist_module? "tu_#{key}" next end sdlm = TestUnitModule.new(name: "tu_#{key}",out_sv_path: valueItgtTU.path) $_implicit_curr_itgt_.with_none_itgt do sdlm.input - "from_up_pass" sdlm.output.logic - "to_down_pass" end sdlm.instance_exec(self,&valueItgtTU.block) if valueItgtTU.path && File.exist?(valueItgtTU.path) sdlm.gen_sv_module Tdl.Puts "[warnning] #{key} path error !!!" else sdlm.origin_sv = true end end ItegrationVerb.curr_itgt_pop end |
#test_unit_inst_verb ⇒ Object
测试用例 实例化
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/tdl/exlib/itegration_verb.rb', line 465 def test_unit_inst_verb @@test_unit_inst_verb_procs << Proc.new do |filter_block| blocks = self.class.instance_variable_get("@_inst_test_unitx_blocks_") # return unless blocks # return if blocks.empty? if blocks && blocks.any? ItegrationVerb.curr_itgt_push self blocks.each do |key,valueItgtTU| if SdlModule.exist_module? "tu_#{self.class}_#{nickname}#{key}" next end if filter_block.call(key) # @top_module.techbench.instance_exec(self,&b.clone) sdlm = TestUnitModule.new(name: "tu_#{self.class}_#{nickname}#{key}",out_sv_path: valueItgtTU[:path]) $_implicit_curr_itgt_.with_none_itgt do sdlm.input - "from_up_pass" sdlm.output.logic - "to_down_pass" end sdlm.instance_exec(self,&valueItgtTU[:block]) if valueItgtTU[:path] && File.exist?(valueItgtTU[:path]) sdlm.gen_sv_module Tdl.Puts "[warnning] #{key} path error !!!" else sdlm.origin_sv = true end end end ItegrationVerb.curr_itgt_pop end end end |