axi_tdl 0.0.10 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +44 -0
- data/.github/workflows/ruby.yml +35 -0
- data/.gitignore +3 -1
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/README.EN.md +7 -2
- data/README.md +6 -2
- data/Rakefile +2 -6
- data/axi_tdl.gemspec +3 -4
- data/lib/axi/AXI4/axi4_direct_B1.sv +23 -23
- data/lib/axi/AXI4/axi4_dpram_cache.sv +33 -33
- data/lib/axi/AXI4/axis_to_axi4_wr.rb +1 -0
- data/lib/axi/AXI4/axis_to_axi4_wr.sv +20 -20
- data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.sv +32 -32
- data/lib/axi/AXI4/packet_partition/data_inf_partition.rb +2 -0
- data/lib/axi/AXI4/packet_partition/data_inf_partition.sv +71 -71
- data/lib/axi/AXI4/wide_axis_to_axi4_wr.rb +2 -1
- data/lib/axi/AXI4/wide_axis_to_axi4_wr.sv +23 -23
- data/lib/axi/AXI_stream/axi_stream_split_channel.rb +7 -1
- data/lib/axi/AXI_stream/axis_head_cut_verb.sv +6 -2
- data/lib/axi/AXI_stream/axis_insert_copy.rb +18 -4
- data/lib/axi/AXI_stream/axis_sim_master_model.rb +28 -0
- data/lib/axi/AXI_stream/axis_sim_slaver_model.rb +26 -0
- data/lib/axi/AXI_stream/axis_sim_verify_by_coe.sv +101 -0
- data/lib/axi/AXI_stream/axis_split_channel_verb.rb +2 -0
- data/lib/axi/common/common_ram_sim_wrapper.sv +9 -9
- data/lib/axi/common/common_ram_wrapper.sv +12 -12
- data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +26 -26
- data/lib/axi/data_interface/data_inf_c/data_c_sim_master_model.sv +69 -0
- data/lib/axi/data_interface/data_inf_c/data_c_sim_slaver_model.sv +58 -0
- data/lib/axi/data_interface/data_inf_c/logic_sim_model.sv +64 -0
- data/lib/axi/techbench/tb_axi_stream_split_channel.rb +69 -0
- data/lib/axi/techbench/tb_axi_stream_split_channel.sv +149 -0
- data/lib/axi/techbench/tb_axis_split_channel_verb.rb +69 -0
- data/lib/axi/techbench/tb_axis_split_channel_verb.sv +125 -0
- data/lib/axi_tdl.rb +1 -0
- data/lib/axi_tdl/version.rb +1 -1
- data/lib/tdl/auto_script/autogensdl.rb +16 -5
- data/lib/tdl/axi4/axi4_interconnect_verb.rb +4 -2
- data/lib/tdl/basefunc.rb +1 -0
- data/lib/tdl/class_hdl/hdl_always_comb.rb +4 -3
- data/lib/tdl/class_hdl/hdl_always_ff.rb +49 -8
- data/lib/tdl/class_hdl/hdl_assign.rb +5 -3
- data/lib/tdl/class_hdl/hdl_block_ifelse.rb +11 -9
- data/lib/tdl/class_hdl/hdl_foreach.rb +2 -2
- data/lib/tdl/class_hdl/hdl_function.rb +4 -2
- data/lib/tdl/class_hdl/hdl_generate.rb +5 -4
- data/lib/tdl/class_hdl/hdl_initial.rb +11 -10
- data/lib/tdl/class_hdl/hdl_module_def.rb +18 -1
- data/lib/tdl/class_hdl/hdl_redefine_opertor.rb +35 -14
- data/lib/tdl/class_hdl/hdl_struct.rb +1 -1
- data/lib/tdl/class_hdl/hdl_verify.rb +1 -1
- data/lib/tdl/elements/originclass.rb +6 -1
- data/lib/tdl/elements/parameter.rb +1 -1
- data/lib/tdl/examples/10_random/exp_random.sv +3 -3
- data/lib/tdl/examples/11_test_unit/dve.tcl +155 -2
- data/lib/tdl/examples/11_test_unit/exp_test_unit.rb +9 -8
- data/lib/tdl/examples/11_test_unit/exp_test_unit.sv +1 -1
- data/lib/tdl/examples/11_test_unit/modules/sub_md0.rb +6 -3
- data/lib/tdl/examples/11_test_unit/modules/sub_md0.sv +5 -5
- data/lib/tdl/examples/11_test_unit/modules/sub_md1.rb +9 -4
- data/lib/tdl/examples/11_test_unit/modules/sub_md1.sv +5 -5
- data/lib/tdl/examples/11_test_unit/tb_exp_test_unit.sv +1 -3
- data/lib/tdl/examples/11_test_unit/tu0.sv +9 -9
- data/lib/tdl/examples/11_test_unit/tu1.sv +1 -1
- data/lib/tdl/examples/1_define_module/exmple_md.sv +12 -12
- data/lib/tdl/examples/2_hdl_class/tmp/always_comb_test.sv +60 -60
- data/lib/tdl/examples/2_hdl_class/tmp/always_ff_test.sv +2 -2
- data/lib/tdl/examples/2_hdl_class/tmp/case_test.sv +17 -17
- data/lib/tdl/examples/2_hdl_class/tmp/head_pkg_module.sv +9 -9
- data/lib/tdl/examples/2_hdl_class/tmp/simple_assign_test.sv +1 -1
- data/lib/tdl/examples/2_hdl_class/tmp/state_case_test.sv +10 -10
- data/lib/tdl/examples/2_hdl_class/tmp/test_foreach.sv +3 -3
- data/lib/tdl/examples/2_hdl_class/tmp/test_function.sv +7 -7
- data/lib/tdl/examples/2_hdl_class/tmp/test_initial_assert.sv +3 -3
- data/lib/tdl/examples/2_hdl_class/tmp/test_module.sv +2 -2
- data/lib/tdl/examples/2_hdl_class/tmp/test_module_var.sv +1 -1
- data/lib/tdl/examples/2_hdl_class/tmp/test_package.sv +4 -5
- data/lib/tdl/examples/2_hdl_class/tmp/test_package2.sv +4 -4
- data/lib/tdl/examples/2_hdl_class/tmp/test_struct_function.sv +2 -2
- data/lib/tdl/examples/2_hdl_class/tmp/test_vcs_string.sv +1 -1
- data/lib/tdl/examples/2_hdl_class/tmp/text_generate.sv +7 -7
- data/lib/tdl/examples/4_generate/test_generate.sv +11 -11
- data/lib/tdl/examples/5_logic_combin/test_logic_combin.sv +3 -3
- data/lib/tdl/examples/7_module_with_package/body_package.sv +3 -4
- data/lib/tdl/examples/7_module_with_package/example_pkg.sv +4 -4
- data/lib/tdl/examples/7_module_with_package/head_package.sv +3 -4
- data/lib/tdl/examples/8_top_module/tb_test_top.sv +1 -2
- data/lib/tdl/examples/9_itegration/clock_manage/itgt_module_clock_manage.rb +13 -0
- data/lib/tdl/examples/9_itegration/clock_manage/test_clock_bb.sv +34 -0
- data/lib/tdl/examples/9_itegration/tb_test_top.sv +2 -2
- data/lib/tdl/examples/9_itegration/tb_test_tttop.sv +1 -1
- data/lib/tdl/examples/9_itegration/tb_test_tttop_sim.sv +38 -0
- data/lib/tdl/examples/9_itegration/test_top.sv +4 -4
- data/lib/tdl/examples/9_itegration/test_tttop.sv +4 -4
- data/lib/tdl/examples/9_itegration/test_tttop_sim.sv +9 -0
- data/lib/tdl/examples/9_itegration/top.rb +1 -0
- data/lib/tdl/exlib/axis_eth_ex.rb +95 -0
- data/lib/tdl/exlib/axis_verify.rb +264 -0
- data/lib/tdl/exlib/clock_reset_verify.rb +29 -0
- data/lib/tdl/exlib/dve_tcl.rb +30 -11
- data/lib/tdl/exlib/itegration.rb +15 -3
- data/lib/tdl/exlib/itegration_verb.rb +166 -129
- data/lib/tdl/exlib/logic_verify.rb +88 -0
- data/lib/tdl/exlib/test_point.rb +96 -94
- data/lib/tdl/exlib/test_point.rb.bak +293 -0
- data/lib/tdl/rebuild_ele/ele_base.rb +1 -1
- data/lib/tdl/sdlmodule/sdlmodlule_path_db.rb +34 -0
- data/lib/tdl/sdlmodule/sdlmodule.rb +18 -14
- data/lib/tdl/sdlmodule/sdlmodule_draw.rb +81 -16
- data/lib/tdl/sdlmodule/test_unit_module.rb +278 -33
- data/lib/tdl/sdlmodule/test_unit_module.rb.bak +143 -0
- data/lib/tdl/sdlmodule/top_module.rb +62 -58
- data/lib/tdl/sdlmodule/top_module.rb.bak +547 -0
- data/lib/tdl/tdl.rb +18 -3
- metadata +35 -134
- data/Gemfile.lock +0 -28
- data/lib/axi/AXI_stream/axi_stream_split_channel.sv +0 -149
- data/lib/axi/AXI_stream/axis_head_cut_verc.sv +0 -242
- data/lib/axi/AXI_stream/axis_insert_copy.sv +0 -66
- data/lib/axi/AXI_stream/axis_pipe_sync_seam.sv +0 -48
- data/lib/axi/AXI_stream/axis_rom_contect_sim.sv +0 -113
- data/lib/axi/AXI_stream/axis_split_channel_verb.sv +0 -62
data/lib/tdl/exlib/dve_tcl.rb
CHANGED
@@ -67,10 +67,10 @@ gui_show_grid -id ${Wave.3} -enable false
|
|
67
67
|
}
|
68
68
|
end
|
69
69
|
|
70
|
-
def self.dev_signals_to_tcl(flag: gname ,signals: [])
|
70
|
+
def self.dev_signals_to_tcl(flag: gname ,signals: [], group_name: nil )
|
71
71
|
sst = %Q{
|
72
72
|
## -------------- #{flag} -------------------------
|
73
|
-
set _wave_session_group_#{flag} #{flag}
|
73
|
+
set _wave_session_group_#{flag} #{group_name || flag}
|
74
74
|
# set _wave_session_group_#{flag} [gui_sg_generate_new_name -seed #{flag}]
|
75
75
|
if {[gui_sg_is_group -name "$_wave_session_group_#{flag}"]} {
|
76
76
|
set _wave_session_group_#{flag} [gui_sg_generate_new_name]
|
@@ -109,7 +109,7 @@ gui_sg_addsignal -group "$_wave_session_group_#{flag}_#{iname}" { #{signals.map{
|
|
109
109
|
"gui_list_set_insertion_bar -id ${Wave.3} -group ${Group2_#{flag}} -position in"
|
110
110
|
end
|
111
111
|
|
112
|
-
def self.gen_dev_wave_tcl(khash) # {group_name : [*signal]}
|
112
|
+
def self.gen_dev_wave_tcl(khash) # {group_name<sdlmodule instance name> : [*signal]}
|
113
113
|
add_ss = []
|
114
114
|
add_list = []
|
115
115
|
add_bar = []
|
@@ -128,21 +128,41 @@ gui_sg_addsignal -group "$_wave_session_group_#{flag}_#{iname}" { #{signals.map{
|
|
128
128
|
end
|
129
129
|
end
|
130
130
|
signals = base_elms.map do |e|
|
131
|
-
|
132
|
-
|
131
|
+
# if e.respond_to? :tp_instance
|
132
|
+
# if e.tp_instance.filter_block
|
133
|
+
# e.root_ref(&e.tp_instance.filter_block).sub("$root.","Sim:")
|
134
|
+
# else
|
135
|
+
# e.root_ref.sub("$root.","Sim:")
|
136
|
+
# end
|
137
|
+
# else
|
138
|
+
# e.root_ref.sub("$root.","Sim:")
|
139
|
+
# end
|
140
|
+
xb = e.instance_variable_get("@dve_wave_filter_block")
|
141
|
+
if xb
|
142
|
+
e.root_ref(&xb).sub("$root.","Sim:")
|
133
143
|
else
|
134
|
-
e.root_ref
|
144
|
+
e.root_ref.sub("$root.","Sim:")
|
135
145
|
end
|
136
146
|
end
|
137
147
|
|
138
148
|
add_ss << dev_signals_to_tcl(flag: k, signals: signals )
|
139
149
|
|
140
150
|
intf_elms.each do |e|
|
141
|
-
|
142
|
-
unless e.tp_instance.filter_block
|
143
|
-
|
151
|
+
# if e.respond_to? :tp_instance
|
152
|
+
# unless e.tp_instance.filter_block
|
153
|
+
# signalx = e.root_ref.sub("$root.","Sim:")
|
154
|
+
# else
|
155
|
+
# signalx = e.root_ref(&e.tp_instance.filter_block).sub("$root.","Sim:")
|
156
|
+
# end
|
157
|
+
# else
|
158
|
+
# signalx = e.root_ref.sub("$root.","Sim:")
|
159
|
+
# end
|
160
|
+
xb = e.instance_variable_get("@dve_wave_filter_block")
|
161
|
+
|
162
|
+
if xb
|
163
|
+
signalx = e.root_ref(&xb).sub("$root.","Sim:")
|
144
164
|
else
|
145
|
-
signalx = e.root_ref
|
165
|
+
signalx = e.root_ref.sub("$root.","Sim:")
|
146
166
|
end
|
147
167
|
|
148
168
|
add_ss << dev_interface_to_tcl(flag: k, iname: e.inst_name ,signals: [ signalx ])
|
@@ -158,5 +178,4 @@ gui_sg_addsignal -group "$_wave_session_group_#{flag}_#{iname}" { #{signals.map{
|
|
158
178
|
dve_tcl_temp(add_ss.join("\n"), add_list.join("\n"), add_bar.join("\n") )
|
159
179
|
|
160
180
|
end
|
161
|
-
|
162
181
|
end
|
data/lib/tdl/exlib/itegration.rb
CHANGED
@@ -12,8 +12,10 @@ class StringBandItegration < String
|
|
12
12
|
obj
|
13
13
|
end
|
14
14
|
|
15
|
-
stringbanditegration.
|
16
|
-
|
15
|
+
if stringbanditegration.origin_str.to_s != stringbanditegration.key.to_s
|
16
|
+
stringbanditegration.itgt.define_singleton_method(stringbanditegration.key) do
|
17
|
+
obj
|
18
|
+
end
|
17
19
|
end
|
18
20
|
obj
|
19
21
|
end
|
@@ -271,7 +273,17 @@ class String ## add to itegration names_pool
|
|
271
273
|
def snoop(itgt=nil,sdlmodule=nil)
|
272
274
|
itgt ||= $_implicit_curr_itgt_.last
|
273
275
|
if sdlmodule
|
274
|
-
sdlmodule.
|
276
|
+
# unless sdlmodule.has_signal?(itgt.names_pool[self])
|
277
|
+
unless sdlmodule.respond_to?(itgt.names_pool[self])
|
278
|
+
if sdlmodule.is_a?(TopModule) && sdlmodule.techbench.respond_to?(itgt.names_pool[self])
|
279
|
+
sdlmodule.techbench.signal(itgt.names_pool[self])
|
280
|
+
else
|
281
|
+
sdlmodule.signal(itgt.names_pool[self])
|
282
|
+
# raise TdlError.new("Dont have `#{itgt.names_pool[self]}` in module <#{sdlmodule.module_name}>" )
|
283
|
+
end
|
284
|
+
else
|
285
|
+
sdlmodule.signal(itgt.names_pool[self])
|
286
|
+
end
|
275
287
|
else
|
276
288
|
itgt.top_module.signal(itgt.names_pool[self])
|
277
289
|
end
|
@@ -354,25 +354,25 @@ class ItegrationVerb
|
|
354
354
|
_names_pool_inst()
|
355
355
|
# @itgt_links = ItgtLinks.new(self)
|
356
356
|
## 为child module 生成方法
|
357
|
-
init_children_modules()
|
357
|
+
# init_children_modules()
|
358
358
|
# init_children_modules_post()
|
359
359
|
end
|
360
360
|
|
361
|
-
def init_children_modules
|
362
|
-
|
363
|
-
|
364
|
-
|
361
|
+
# def init_children_modules
|
362
|
+
# blocks_hash = self.class.instance_variable_get("@_sdl_eval_blocks_hash_") || {}
|
363
|
+
# blocks_hash_post = self.class.instance_variable_get("@_sdl_eval_blocks_post_hash_") || {}
|
364
|
+
# dir_hash = self.class.instance_variable_get("@_sdl_eval_dir_hash_")
|
365
365
|
|
366
|
-
|
366
|
+
# blocks_hash = blocks_hash.merge blocks_hash_post
|
367
367
|
|
368
|
-
|
368
|
+
# blocks_hash.keys.each do |key|
|
369
369
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
end
|
370
|
+
# sdlm = SdlModule.new(name:self.class.to_s + "_#{@nickname}#{key}",out_sv_path:dir_hash[key])
|
371
|
+
# define_singleton_method(key) do
|
372
|
+
# sdlm
|
373
|
+
# end
|
374
|
+
# end
|
375
|
+
# end
|
376
376
|
|
377
377
|
# def init_children_modules_post
|
378
378
|
# blocks_hash = self.class.instance_variable_get("@_sdl_eval_blocks_post_hash_")
|
@@ -387,20 +387,20 @@ class ItegrationVerb
|
|
387
387
|
# end
|
388
388
|
# end
|
389
389
|
|
390
|
-
def gen_children_modules
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
end
|
390
|
+
# def gen_children_modules
|
391
|
+
# blocks_hash = self.class.instance_variable_get("@_sdl_eval_blocks_hash_") || {}
|
392
|
+
# blocks_hash_post = self.class.instance_variable_get("@_sdl_eval_blocks_post_hash_") || {}
|
393
|
+
# blocks_hash = blocks_hash.merge blocks_hash_post
|
394
|
+
# blocks_hash.keys.each do |key|
|
395
|
+
# self.send(key).gen_sv_module()
|
396
|
+
# end
|
397
|
+
# end
|
398
398
|
|
399
399
|
# define_singleton_method(:inst) do
|
400
400
|
def inst
|
401
401
|
# 先生成子模块
|
402
402
|
## 执行 生成 sdl module
|
403
|
-
inst_child_module()
|
403
|
+
# inst_child_module()
|
404
404
|
|
405
405
|
blocks = self.class.instance_variable_get("@_inst_blocks_")
|
406
406
|
ItegrationVerb.curr_itgt_push(self)
|
@@ -422,7 +422,7 @@ class ItegrationVerb
|
|
422
422
|
end
|
423
423
|
|
424
424
|
## 执行 生成 sdl module
|
425
|
-
inst_child_module_post()
|
425
|
+
# inst_child_module_post()
|
426
426
|
|
427
427
|
## 执行top module techbench eval
|
428
428
|
tb_inst()
|
@@ -431,7 +431,8 @@ class ItegrationVerb
|
|
431
431
|
## 执行 约束
|
432
432
|
inst_constraints()
|
433
433
|
## 执行单元测试
|
434
|
-
|
434
|
+
## 改到 运行 top_module _exec_add_test_unit 那边执行
|
435
|
+
# test_unit_inst()
|
435
436
|
end
|
436
437
|
|
437
438
|
def tb_inst
|
@@ -464,8 +465,11 @@ class ItegrationVerb
|
|
464
465
|
return if blocks.empty?
|
465
466
|
ItegrationVerb.curr_itgt_push self
|
466
467
|
|
467
|
-
|
468
|
-
|
468
|
+
unless TopModule.sim
|
469
|
+
ItegrationVerb.curr_itgt_pop
|
470
|
+
return
|
471
|
+
end
|
472
|
+
|
469
473
|
blocks.each do |b|
|
470
474
|
# @top_module.techbench.instance_exec(self,&b.clone)
|
471
475
|
sdlm = TestUnitModule.new(name: b[0],out_sv_path: b[1])
|
@@ -486,62 +490,94 @@ class ItegrationVerb
|
|
486
490
|
|
487
491
|
end
|
488
492
|
|
489
|
-
def
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
blocks = blocks_hash[key]
|
499
|
-
if blocks.length == 1
|
500
|
-
block = blocks[0]
|
501
|
-
sdlm.instance_exec(self,&block)
|
502
|
-
elsif blocks.length > 1
|
503
|
-
# block = Proc.new do
|
504
|
-
blocks.each do |b|
|
505
|
-
# b.call
|
506
|
-
sdlm.instance_exec(self,&b)
|
507
|
-
end
|
508
|
-
# end
|
509
|
-
else
|
510
|
-
;
|
511
|
-
end
|
512
|
-
end
|
513
|
-
end
|
514
|
-
ItegrationVerb.curr_itgt_pop
|
515
|
-
end
|
493
|
+
def self.test_unit_inst(&filter_block)
|
494
|
+
# blocks = self.instance_variable_get("@_inst_test_unit_blocks_")
|
495
|
+
# blocks = instance_variable_get("@_inst_test_unit_blocks_") || []
|
496
|
+
blocks = @@_inst_test_unit_blocks_
|
497
|
+
return unless blocks
|
498
|
+
return if blocks.empty?
|
499
|
+
return unless TopModule.sim
|
516
500
|
|
517
|
-
|
518
|
-
blocks_hash = self.class.instance_variable_get("@_sdl_eval_blocks_post_hash_")
|
519
|
-
return unless blocks_hash
|
520
|
-
ItegrationVerb.curr_itgt_push self
|
521
|
-
$_implicit_curr_itgt_.with_none_itgt do
|
522
|
-
blocks_hash.keys.each do |key|
|
523
|
-
sdlm = self.send(key)
|
524
|
-
# $_implicit_curr_itgt_ = self
|
501
|
+
ItegrationVerb.curr_itgt_push nil
|
525
502
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
503
|
+
blocks.each do |b|
|
504
|
+
# @top_module.techbench.instance_exec(self,&b.clone)
|
505
|
+
if !(block_given?) || filter_block.call(b[0])
|
506
|
+
sdlm = TestUnitModule.new(name: b[0],out_sv_path: b[1])
|
507
|
+
$_implicit_curr_itgt_.with_none_itgt do
|
508
|
+
sdlm.input - "from_up_pass"
|
509
|
+
sdlm.output.logic - "to_down_pass"
|
510
|
+
end
|
511
|
+
sdlm.instance_exec(nil,&b[2])
|
512
|
+
|
513
|
+
if b[1] && File.exist?(b[1])
|
514
|
+
sdlm.gen_sv_module
|
515
|
+
else
|
516
|
+
sdlm.origin_sv = true
|
539
517
|
end
|
540
518
|
end
|
541
519
|
end
|
520
|
+
|
542
521
|
ItegrationVerb.curr_itgt_pop
|
522
|
+
|
543
523
|
end
|
544
524
|
|
525
|
+
# def inst_child_module
|
526
|
+
# blocks_hash = self.class.instance_variable_get("@_sdl_eval_blocks_hash_")
|
527
|
+
# return unless blocks_hash
|
528
|
+
# ItegrationVerb.curr_itgt_push self
|
529
|
+
# $_implicit_curr_itgt_.with_none_itgt do
|
530
|
+
# blocks_hash.keys.each do |key|
|
531
|
+
# sdlm = self.send(key)
|
532
|
+
|
533
|
+
|
534
|
+
# blocks = blocks_hash[key]
|
535
|
+
# if blocks.length == 1
|
536
|
+
# block = blocks[0]
|
537
|
+
# sdlm.instance_exec(self,&block)
|
538
|
+
# elsif blocks.length > 1
|
539
|
+
# # block = Proc.new do
|
540
|
+
# blocks.each do |b|
|
541
|
+
# # b.call
|
542
|
+
# sdlm.instance_exec(self,&b)
|
543
|
+
# end
|
544
|
+
# # end
|
545
|
+
# else
|
546
|
+
# ;
|
547
|
+
# end
|
548
|
+
# end
|
549
|
+
# end
|
550
|
+
# ItegrationVerb.curr_itgt_pop
|
551
|
+
# end
|
552
|
+
|
553
|
+
# def inst_child_module_post
|
554
|
+
# blocks_hash = self.class.instance_variable_get("@_sdl_eval_blocks_post_hash_")
|
555
|
+
# return unless blocks_hash
|
556
|
+
# ItegrationVerb.curr_itgt_push self
|
557
|
+
# $_implicit_curr_itgt_.with_none_itgt do
|
558
|
+
# blocks_hash.keys.each do |key|
|
559
|
+
# sdlm = self.send(key)
|
560
|
+
# # $_implicit_curr_itgt_ = self
|
561
|
+
|
562
|
+
# blocks = blocks_hash[key]
|
563
|
+
# if blocks.length == 1
|
564
|
+
# block = blocks[0]
|
565
|
+
# sdlm.instance_exec(self,&block)
|
566
|
+
# elsif blocks.length > 1
|
567
|
+
# # block = Proc.new do
|
568
|
+
# blocks.each do |b|
|
569
|
+
# # b.call
|
570
|
+
# sdlm.instance_exec(self,&b)
|
571
|
+
# end
|
572
|
+
# # end
|
573
|
+
# else
|
574
|
+
# next
|
575
|
+
# end
|
576
|
+
# end
|
577
|
+
# end
|
578
|
+
# ItegrationVerb.curr_itgt_pop
|
579
|
+
# end
|
580
|
+
|
545
581
|
def self.inherited(subclass)
|
546
582
|
unless @@child.include? subclass
|
547
583
|
@@child << subclass
|
@@ -589,7 +625,7 @@ class ItegrationVerb
|
|
589
625
|
public
|
590
626
|
def check_same_method(name)
|
591
627
|
if respond_to? name.to_s
|
592
|
-
raise TdlError.new("Itegration can't Redefine method #{name}")
|
628
|
+
raise TdlError.new("Itegration `#{to_s}` can't Redefine method #{name}")
|
593
629
|
end
|
594
630
|
end
|
595
631
|
|
@@ -736,63 +772,64 @@ class ItegrationVerb
|
|
736
772
|
## 添加测试用例
|
737
773
|
|
738
774
|
def self.def_test_unit(name,path,&block)
|
739
|
-
_inst_test_unit_blocks_ = instance_variable_get("@_inst_test_unit_blocks_")
|
740
|
-
_inst_test_unit_blocks_ ||= []
|
741
|
-
_inst_test_unit_blocks_ << [name.to_s, path, block]
|
742
|
-
instance_variable_set("@_inst_test_unit_blocks_",_inst_test_unit_blocks_)
|
775
|
+
# @@_inst_test_unit_blocks_ = instance_variable_get("@_inst_test_unit_blocks_")
|
776
|
+
@@_inst_test_unit_blocks_ ||= []
|
777
|
+
@@_inst_test_unit_blocks_ << [name.to_s, path, block]
|
778
|
+
# instance_variable_set("@_inst_test_unit_blocks_",_inst_test_unit_blocks_)
|
779
|
+
@@_inst_test_unit_blocks_
|
743
780
|
end
|
744
781
|
|
745
782
|
## 生成 itgt内的模块,
|
746
|
-
def self.has_module(dir,*names)
|
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
|
-
end
|
783
|
+
# def self.has_module(dir,*names)
|
784
|
+
# unless File.exist? dir
|
785
|
+
# Dir.mkdir dir
|
786
|
+
# end
|
787
|
+
# ## itgt 生成 sdl 模块
|
788
|
+
# names.each do |name|
|
789
|
+
# # unless container_hash[name.to_s]
|
790
|
+
# # container_hash[name.to_s] = []
|
791
|
+
# # end
|
792
|
+
# self.define_singleton_method("#{name}_sdl_eval") do |&block|
|
793
|
+
# _sdl_eval_blocks_hash_ = instance_variable_get("@_sdl_eval_blocks_hash_")
|
794
|
+
# _sdl_eval_dir_hash_ = instance_variable_get("@_sdl_eval_dir_hash_")
|
795
|
+
# _sdl_eval_blocks_hash_ ||= {}
|
796
|
+
# _sdl_eval_dir_hash_ ||= {}
|
797
|
+
|
798
|
+
# if _sdl_eval_blocks_hash_[name]
|
799
|
+
# _sdl_eval_blocks_hash_[name] << block
|
800
|
+
# # _sdl_eval_blocks_hash_[name] << $_implicit_curr_itgt_.wrap_nont_itgt(&block)
|
801
|
+
# # _sdl_eval_blocks_hash_[name] << lambda {|itgt| block.call }
|
802
|
+
# else
|
803
|
+
# _sdl_eval_blocks_hash_[name] = [block]
|
804
|
+
# # _sdl_eval_blocks_hash_[name] = [$_implicit_curr_itgt_.wrap_nont_itgt(&block)]
|
805
|
+
# # _sdl_eval_blocks_hash_[name] == [ lambda {|itgt| block.call }]
|
806
|
+
# end
|
807
|
+
|
808
|
+
# _sdl_eval_dir_hash_[name] = dir if dir
|
809
|
+
# instance_variable_set("@_sdl_eval_dir_hash_",_sdl_eval_dir_hash_)
|
810
|
+
# instance_variable_set("@_sdl_eval_blocks_hash_",_sdl_eval_blocks_hash_)
|
811
|
+
# end
|
812
|
+
# ## 在 top_module 后再执行
|
813
|
+
# self.define_singleton_method("#{name}_sdl_post_eval") do |&block|
|
814
|
+
# $_implicit_curr_itgt_.with_none_itgt do
|
815
|
+
# _blocks_hash_ = instance_variable_get("@_sdl_eval_blocks_post_hash_")
|
816
|
+
# _sdl_eval_dir_hash_ = instance_variable_get("@_sdl_eval_dir_hash_")
|
817
|
+
# _blocks_hash_ ||= {}
|
818
|
+
# _sdl_eval_dir_hash_ ||= {}
|
819
|
+
|
820
|
+
# if _blocks_hash_[name]
|
821
|
+
# _blocks_hash_[name] << block #$_implicit_curr_itgt_.wrap_nont_itgt(&block)
|
822
|
+
# else
|
823
|
+
# _blocks_hash_[name] = [block] #[$_implicit_curr_itgt_.wrap_nont_itgt(&block)]
|
824
|
+
# end
|
825
|
+
|
826
|
+
# _sdl_eval_dir_hash_[name] = dir if dir
|
827
|
+
# instance_variable_set("@_sdl_eval_dir_hash_",_sdl_eval_dir_hash_)
|
828
|
+
# instance_variable_set("@_sdl_eval_blocks_post_hash_",_blocks_hash_)
|
829
|
+
# end
|
830
|
+
# end
|
831
|
+
# end
|
832
|
+
# end
|
796
833
|
|
797
834
|
def self.record_instance_var_block(name,default=[],&block)
|
798
835
|
_inst_ccc_ = instance_variable_get("@_#{name}_")
|