axi_tdl 0.1.3 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/lib/axi/AXI4/axi4_direct_verc.sv +6 -0
  3. data/lib/axi/AXI4/axi4_dpram_cache.rb +3 -2
  4. data/lib/axi/AXI4/axi4_dpram_cache.sv +10 -10
  5. data/lib/axi/AXI4/axi4_ram_cache.rb +23 -0
  6. data/lib/axi/AXI4/axi4_ram_cache.sv +39 -0
  7. data/lib/axi/AXI4/axi4_rd_auxiliary_gen_A2.sv +112 -0
  8. data/lib/axi/AXI4/axi4_rd_burst_track.sv +2 -1
  9. data/lib/axi/AXI4/axi4_wr_burst_track.sv +2 -1
  10. data/lib/axi/AXI4/axis_to_axi4_wr.sv +11 -11
  11. data/lib/axi/AXI4/long_axis_to_axi4_wr.rb +113 -0
  12. data/lib/axi/AXI4/long_axis_to_axi4_wr.sv +125 -0
  13. data/lib/axi/AXI4/odata_pool_axi4_A3.sv +12 -4
  14. data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.sv +5 -5
  15. data/lib/axi/AXI4/packet_partition/data_inf_partition.rb +8 -4
  16. data/lib/axi/AXI4/packet_partition/data_inf_partition.sv +5 -5
  17. data/lib/axi/AXI4/vcs_axi4_comptable.sv +35 -9
  18. data/lib/axi/AXI4/wide_axis_to_axi4_wr.rb +1 -1
  19. data/lib/axi/AXI4/wide_axis_to_axi4_wr.sv +8 -8
  20. data/lib/axi/AXI4/width_convert/odd_width_convert.sv +1 -1
  21. data/lib/axi/AXI_stream/axi_stream_split_channel.rb +5 -2
  22. data/lib/axi/AXI_stream/axi_stream_split_channel.sv +32 -29
  23. data/lib/axi/AXI_stream/axis_head_cut_verc.sv +10 -10
  24. data/lib/axi/AXI_stream/axis_insert_copy.sv +2 -2
  25. data/lib/axi/AXI_stream/axis_pipe_sync_seam.sv +3 -3
  26. data/lib/axi/AXI_stream/axis_rom_contect_sim.sv +5 -5
  27. data/lib/axi/AXI_stream/axis_sim_master_model.sv +2 -2
  28. data/lib/axi/AXI_stream/axis_split_channel_verb.sv +2 -2
  29. data/lib/axi/AXI_stream/data_width/axis_width_convert_verb.sv +50 -0
  30. data/lib/axi/AXI_stream/packet_fifo/axi_stream_packet_long_fifo.sv +2 -0
  31. data/lib/axi/AXI_stream/parse_big_field_table_verb.sv +5 -3
  32. data/lib/axi/common/test_write_mem.sv +1 -1
  33. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +12 -12
  34. data/lib/axi/platform_ip/long_fifo_verb.sv +1 -1
  35. data/lib/axi/platform_ip/wide_fifo.sv +1 -1
  36. data/lib/axi/platform_ip/xilinx_fifo_verb.sv +1 -1
  37. data/lib/axi/platform_ip/xilinx_fifo_verc.sv +2 -1
  38. data/lib/axi/techbench/tb_axi_stream_split_channel.rb +1 -0
  39. data/lib/axi/techbench/tb_axi_stream_split_channel.sv +6 -6
  40. data/lib/axi_tdl/version.rb +1 -1
  41. data/lib/axi_tdl.rb +31 -1
  42. data/lib/public_atom_module/sim/clock_rst_verc.sv +69 -0
  43. data/lib/public_atom_module/sim_system_pkg.sv +4 -0
  44. data/lib/public_atom_module/synth_system_pkg.sv +4 -0
  45. data/lib/tdl/Logic/logic_edge.rb +14 -6
  46. data/lib/tdl/Logic/logic_latency.rb +7 -7
  47. data/lib/tdl/auto_script/autogensdl.rb +2 -3
  48. data/lib/tdl/auto_script/import_hdl.rb +41 -5
  49. data/lib/tdl/auto_script/import_sdl.rb +43 -1
  50. data/lib/tdl/axi4/axi4_interconnect_verb.rb +9 -14
  51. data/lib/tdl/class_hdl/hdl_always_ff.rb +1 -1
  52. data/lib/tdl/class_hdl/hdl_data.rb +1 -1
  53. data/lib/tdl/class_hdl/hdl_generate.rb +2 -2
  54. data/lib/tdl/examples/11_test_unit/dve.tcl +153 -6
  55. data/lib/tdl/examples/11_test_unit/exp_test_unit.rb +5 -4
  56. data/lib/tdl/examples/11_test_unit/exp_test_unit.sv +7 -33
  57. data/lib/tdl/examples/11_test_unit/exp_test_unit_sim.sv +33 -7
  58. data/lib/tdl/examples/11_test_unit/modules/sub_md0.sv +2 -2
  59. data/lib/tdl/examples/11_test_unit/modules/sub_md1.sv +2 -2
  60. data/lib/tdl/examples/11_test_unit/tb_exp_test_unit.sv +1 -1
  61. data/lib/tdl/examples/11_test_unit/tb_exp_test_unit_sim.sv +1 -2
  62. data/lib/tdl/examples/11_test_unit/tu0.sv +4 -6
  63. data/lib/tdl/examples/2_hdl_class/tmp/always_comb_test.sv +3 -3
  64. data/lib/tdl/examples/2_hdl_class/tmp/always_ff_test.sv +3 -3
  65. data/lib/tdl/examples/2_hdl_class/tmp/case_test.sv +3 -3
  66. data/lib/tdl/examples/2_hdl_class/tmp/module_instance_test.sv +1 -1
  67. data/lib/tdl/examples/2_hdl_class/tmp/simple_assign_test.sv +3 -3
  68. data/lib/tdl/examples/2_hdl_class/tmp/state_case_test.sv +3 -3
  69. data/lib/tdl/examples/2_hdl_class/tmp/test_inst_sugar.sv +1 -1
  70. data/lib/tdl/examples/2_hdl_class/tmp/test_module.sv +2 -2
  71. data/lib/tdl/examples/2_hdl_class/tmp/test_module_port.sv +2 -2
  72. data/lib/tdl/examples/2_hdl_class/tmp/test_module_var.sv +6 -6
  73. data/lib/tdl/examples/2_hdl_class/tmp/test_vcs_string.sv +1 -1
  74. data/lib/tdl/examples/3_hdl_sdl_instance/main_md.sv +2 -2
  75. data/lib/tdl/examples/6_module_with_interface/example_interface.sv +8 -8
  76. data/lib/tdl/examples/6_module_with_interface/inf_collect.sv +9 -9
  77. data/lib/tdl/examples/8_top_module/dve.tcl +6 -0
  78. data/lib/tdl/examples/8_top_module/tb_test_top.sv +1 -2
  79. data/lib/tdl/examples/8_top_module/tb_test_top_sim.sv +1 -1
  80. data/lib/tdl/examples/8_top_module/test_top.sv +1 -1
  81. data/lib/tdl/examples/9_itegration/clock_manage/test_clock_bb.sv +2 -1
  82. data/lib/tdl/examples/9_itegration/dve.tcl +6 -0
  83. data/lib/tdl/examples/9_itegration/tb_test_tttop.sv +1 -3
  84. data/lib/tdl/examples/9_itegration/tb_test_tttop_sim.sv +1 -2
  85. data/lib/tdl/examples/9_itegration/test_tttop.sv +2 -2
  86. data/lib/tdl/exlib/axis_eth_ex.rb +1 -1
  87. data/lib/tdl/exlib/axis_verify.rb +2 -2
  88. data/lib/tdl/exlib/constraints_verb.rb +1 -0
  89. data/lib/tdl/exlib/itegration_verb.rb +45 -39
  90. data/lib/tdl/exlib/logic_verify.rb +1 -1
  91. data/lib/tdl/rebuild_ele/axi4.rb +6 -2
  92. data/lib/tdl/rebuild_ele/axi_stream.rb +3 -3
  93. data/lib/tdl/rebuild_ele/data_inf_c.rb +2 -2
  94. data/lib/tdl/rebuild_ele/ele_base.rb +7 -2
  95. data/lib/tdl/sdlmodule/sdlmodule.rb +73 -1
  96. data/lib/tdl/sdlmodule/sdlmodule_draw.rb +1 -1
  97. data/lib/tdl/sdlmodule/sdlmodule_vcs_comptable.rb +3 -3
  98. data/lib/tdl/sdlmodule/test_unit_module.rb +4 -1
  99. data/lib/tdl/sdlmodule/top_module.rb +4 -0
  100. data/lib/tdl/tdl.rb +1 -11
  101. metadata +12 -3
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 13:14:45 +0800
8
+ created: 2021-05-04 20:03:32 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -24,14 +24,14 @@ module inf_collect (
24
24
  //==========================================================================
25
25
  //-------- define ----------------------------------------------------------
26
26
 
27
- data_inf_c #(.DSIZE(8)) a_inf (.clock(dim.clock),.rst_n(dim.clock)) ;
28
- data_inf_c #(.DSIZE(8)) c_inf [7:0] (.clock(dim.clock),.rst_n(dim.clock)) ;
29
- axi_stream_inf #(.DSIZE(8),.USIZE(1)) f_inf (.aclk(asis.aclk),.aresetn(asis.aresetn),.aclken(1'b1)) ;
30
- axi_stream_inf #(.DSIZE(8),.USIZE(1)) p_inf (.aclk(asis.aclk),.aresetn(asis.aresetn),.aclken(1'b1)) ;
31
- axi_stream_inf #(.DSIZE(8),.USIZE(1)) g_inf [1:0] (.aclk(asis.aclk),.aresetn(asis.aresetn),.aclken(1'b1)) ;
32
- axi_lite_inf #(.DSIZE(32),.ASIZE(32)) h_inf (.axi_aclk(alm.axi_aclk),.axi_aresetn(alm.axi_aresetn)) ;
33
- axi_inf #(.DSIZE(32),.IDSIZE(3),.ASIZE(32),.LSIZE(10),.MODE("BOTH"),.ADDR_STEP(4096)) i_inf (.axi_aclk(a4m.axi_aclk),.axi_aresetn(a4m.axi_aresetn)) ;
34
- axi_inf #(.DSIZE(31),.IDSIZE(3),.ASIZE(37),.LSIZE(12),.MODE("BOTH"),.ADDR_STEP(1024)) j_inf [8:0][4:0][2:0] (.axi_aclk(a4m.axi_aclk),.axi_aresetn(a4m.axi_aresetn)) ;
27
+ data_inf_c #(.DSIZE(8),.FreqM(101)) a_inf (.clock(dim.clock),.rst_n(dim.clock)) ;
28
+ data_inf_c #(.DSIZE(8),.FreqM(101)) c_inf [7:0] (.clock(dim.clock),.rst_n(dim.clock)) ;
29
+ axi_stream_inf #(.DSIZE(8),.FreqM(1.0),.USIZE(1)) f_inf (.aclk(asis.aclk),.aresetn(asis.aresetn),.aclken(1'b1)) ;
30
+ axi_stream_inf #(.DSIZE(8),.FreqM(1.0),.USIZE(1)) p_inf (.aclk(asis.aclk),.aresetn(asis.aresetn),.aclken(1'b1)) ;
31
+ axi_stream_inf #(.DSIZE(8),.FreqM(1.0),.USIZE(1)) g_inf [1:0] (.aclk(asis.aclk),.aresetn(asis.aresetn),.aclken(1'b1)) ;
32
+ axi_lite_inf #(.DSIZE(32),.ASIZE(32),.FreqM(103)) h_inf (.axi_aclk(alm.axi_aclk),.axi_aresetn(alm.axi_aresetn)) ;
33
+ axi_inf #(.DSIZE(32),.IDSIZE(3),.ASIZE(32),.LSIZE(10),.MODE("BOTH"),.ADDR_STEP(4096),.FreqM(103)) i_inf (.axi_aclk(a4m.axi_aclk),.axi_aresetn(a4m.axi_aresetn)) ;
34
+ axi_inf #(.DSIZE(31),.IDSIZE(3),.ASIZE(37),.LSIZE(12),.MODE("BOTH"),.ADDR_STEP(1024),.FreqM(103)) j_inf [8:0][4:0][2:0] (.axi_aclk(a4m.axi_aclk),.axi_aresetn(a4m.axi_aresetn)) ;
35
35
  //==========================================================================
36
36
  //-------- instance --------------------------------------------------------
37
37
 
@@ -13,6 +13,8 @@ gui_set_time_units 1ps
13
13
  ## ==== [add_signal] ===== ##
14
14
 
15
15
 
16
+
17
+
16
18
  ## 创建波形窗口
17
19
  if {![info exists useOldWindow]} {
18
20
  set useOldWindow true
@@ -42,6 +44,8 @@ gui_wv_zoom_timerange -id ${Wave.3} 0 1000000000
42
44
  ## === [add_signal_wave] === ##
43
45
 
44
46
 
47
+
48
+
45
49
  gui_seek_criteria -id ${Wave.3} {Any Edge}
46
50
 
47
51
 
@@ -59,6 +63,8 @@ gui_list_set_filter -id ${Wave.3} -text {*}
59
63
  ## === [add_bar] === ##
60
64
 
61
65
 
66
+
67
+
62
68
  gui_marker_move -id ${Wave.3} {C1} 560248001
63
69
  gui_view_scroll -id ${Wave.3} -vertical -set 35
64
70
  gui_show_grid -id ${Wave.3} -enable false
@@ -5,11 +5,10 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 13:14:45 +0800
8
+ created: 2021-04-03 14:05:10 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
12
- `timescale 1ns/1ps
13
12
 
14
13
  module tb_test_top();
15
14
  //==========================================================================
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 13:14:08 +0800
8
+ created: 2021-04-03 13:35:39 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 13:14:45 +0800
8
+ created: 2021-05-30 12:21:54 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-03-20 23:48:13 +0800
8
+ created: 2021-05-04 20:03:49 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -28,6 +28,7 @@ initial begin
28
28
  to_down_pass = 1'b0;
29
29
  wait(from_up_pass);
30
30
  $root.tb_test_tttop_sim.test_unit_region = "test_clock_bb";
31
+ $display("--------------- Current test_unit <%0s> --------------------", "test_clock_bb");
31
32
  to_down_pass = 1'b1;
32
33
  end
33
34
 
@@ -13,6 +13,8 @@ gui_set_time_units 1ps
13
13
  ## ==== [add_signal] ===== ##
14
14
 
15
15
 
16
+
17
+
16
18
  ## 创建波形窗口
17
19
  if {![info exists useOldWindow]} {
18
20
  set useOldWindow true
@@ -42,6 +44,8 @@ gui_wv_zoom_timerange -id ${Wave.3} 0 1000000000
42
44
  ## === [add_signal_wave] === ##
43
45
 
44
46
 
47
+
48
+
45
49
  gui_seek_criteria -id ${Wave.3} {Any Edge}
46
50
 
47
51
 
@@ -59,6 +63,8 @@ gui_list_set_filter -id ${Wave.3} -text {*}
59
63
  ## === [add_bar] === ##
60
64
 
61
65
 
66
+
67
+
62
68
  gui_marker_move -id ${Wave.3} {C1} 560248001
63
69
  gui_view_scroll -id ${Wave.3} -vertical -set 35
64
70
  gui_show_grid -id ${Wave.3} -enable false
@@ -5,12 +5,10 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 13:14:45 +0800
8
+ created: 2021-04-03 13:47:04 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
12
- `timescale 1ns/1ps
13
- `timescale 1ns/1ps
14
12
 
15
13
  module tb_test_tttop();
16
14
  //==========================================================================
@@ -5,11 +5,10 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 12:39:31 +0800
8
+ created: 2021-04-03 14:05:10 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
12
- `timescale 1ns/1ps
13
12
 
14
13
  module tb_test_tttop_sim();
15
14
  //==========================================================================
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: 2021-04-03 13:14:45 +0800
8
+ created: 2021-09-24 23:32:18 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -18,7 +18,7 @@ module test_tttop (
18
18
  //-------- define ----------------------------------------------------------
19
19
  logic clock_100M;
20
20
  logic rstn_100M;
21
- axi_stream_inf #(.DSIZE(16),.USIZE(1)) x_origin_inf (.aclk(clock_100M),.aresetn(rstn_100M),.aclken(1'b1)) ;
21
+ axi_stream_inf #(.DSIZE(16),.FreqM(100),.USIZE(1)) x_origin_inf (.aclk(clock_100M),.aresetn(rstn_100M),.aclken(1'b1)) ;
22
22
  //==========================================================================
23
23
  //-------- instance --------------------------------------------------------
24
24
  simple_clock simple_clock_inst(
@@ -27,7 +27,7 @@ class AxiStream
27
27
  return AxiTdl::EthernetStreamDefAtom.new(belong_to_module: @belong_to_module, stream: self, start: start, length: length)
28
28
  end
29
29
 
30
- def x_all_bits_slice(name: "slice_#{globle_random_name_flag()}", start: 8*4,length:32)
30
+ def x_all_bits_slice(name: "slice_#{@belong_to_module._auto_name_incr_index_()}", start: 8*4,length:32)
31
31
  raise TdlError.new("#{name} is not ethernet stream, before used it must be call to_eth") unless @__ethernet_type__
32
32
  # @belong_to_module.logic[length] - name
33
33
  @belong_to_module.instance_exec(self,name,start,length,@__ethernet_type__) do |_targget_axis, _name, _start, _length, _ethernet_type|
@@ -130,7 +130,7 @@ class AxiStream
130
130
 
131
131
  def to_simple_sim_master_coe(enable: 1.b1, length: [10,200], gap_len: [0,10], data: [ (0...100) ] , vld_perc: [50, 100], loop_coe: true)
132
132
  # raise TdlError.new "file cant be empty" unless file
133
- file = File.join(AxiTdl::TDL_PATH,"./auto_script/tmp/","coe_#{self.name}_#{globle_random_name_flag}.coe")
133
+ file = File.join(AxiTdl::TDL_PATH,"./auto_script/tmp/","coe_#{self.name}_#{@belong_to_module._auto_name_incr_index_}.coe")
134
134
  _sps = nil
135
135
  ClassHDL::AssignDefOpertor.with_rollback_opertors(:old) do
136
136
  require_sdl 'axis_sim_master_model.rb'
@@ -218,7 +218,7 @@ class AxiStream
218
218
  def simple_verify_by_coe(file)
219
219
  unless File.file?(file)
220
220
  if file.is_a?(String)
221
- wfile = File.join(AxiTdl::TDL_PATH,"./auto_script/tmp/","#{self.name}_#{globle_random_name_flag}.coe")
221
+ wfile = File.join(AxiTdl::TDL_PATH,"./auto_script/tmp/","#{self.name}_#{@belong_to_module._auto_name_incr_index_}.coe")
222
222
  File.open(wfile,'w') do |f|
223
223
  f.puts file
224
224
  end
@@ -41,6 +41,7 @@ class ConstraintsVerb
41
41
  pulltype = ([pulltype] * pin_name.size ) unless pulltype.is_a? Array
42
42
  drive = ([drive] * pin_name.size ) unless drive.is_a? Array
43
43
 
44
+ pin_name = ((pin_name.is_a?(Array) && pin_name) || [pin_name] )
44
45
  pin_name.each_index do |index|
45
46
  @package_pin_and_IOSTANDARD << [port_name[index],pin_name[index].to_s.upcase,iostandard[index].to_s.upcase,pulltype[index].to_s,drive[index].to_s]
46
47
 
@@ -671,39 +671,42 @@ class ItegrationVerb
671
671
  end
672
672
  end
673
673
  ## 先从 已经加入的隐性itgt搜索
674
- @top_module.implicit_itgt_collect.each do |i|
675
- explort_attrs = i.class.get_itgt_var('itegration_explort_collect')
676
- if ((explort_attrs & container_attrs).sort == container_attrs.sort && i.flag_match(flag_attrs))
677
- # puts "Itgt Good"
678
- mark = true
679
- unless self.respond_to? e
680
- define_singleton_method(e) do
681
- ## 如果从其他模块调用则出发 dynac_active
682
- ItegrationVerbAgent.new(i)
674
+ ## 去除隐性引入
675
+ unless TopModule.itgt_implicit_reject
676
+ @top_module.implicit_itgt_collect.each do |i|
677
+ explort_attrs = i.class.get_itgt_var('itegration_explort_collect')
678
+ if ((explort_attrs & container_attrs).sort == container_attrs.sort && i.flag_match(flag_attrs))
679
+ # puts "Itgt Good"
680
+ mark = true
681
+ unless self.respond_to? e
682
+ define_singleton_method(e) do
683
+ ## 如果从其他模块调用则出发 dynac_active
684
+ ItegrationVerbAgent.new(i)
685
+ end
686
+ i.link_eval
687
+ i.child_inst_itgt << self
683
688
  end
684
- i.link_eval
685
- i.child_inst_itgt << self
689
+ break
686
690
  end
687
- break
688
691
  end
689
- end
690
- next if mark ## 找到了 就处理下一个Link
691
- ## 如果没有找到 再从 ItegrationVerb children里面找到比加入
692
- @@child.each do |c|
693
- explort_attrs = c.get_itgt_var('itegration_explort_collect')
694
- # puts explort_attrs
695
- if ((explort_attrs & container_attrs).sort == container_attrs.sort && c.flag_match(flag_attrs))
696
- # puts "Child Good"
697
- isp = @top_module.add_itegration(c.to_s,nickname:'implicit',implicit:true)
698
- @top_module.implicit_itgt_collect << isp
699
- ## 如果是隐性添加,先不要加入pin_map
700
- define_singleton_method(e) do
701
- ItegrationVerbAgent.new(isp)
692
+ next if mark ## 找到了 就处理下一个Link
693
+ ## 如果没有找到 再从 ItegrationVerb children里面找到比加入
694
+ @@child.each do |c|
695
+ explort_attrs = c.get_itgt_var('itegration_explort_collect')
696
+ # puts explort_attrs
697
+ if ((explort_attrs & container_attrs).sort == container_attrs.sort && c.flag_match(flag_attrs))
698
+ # puts "Child Good"
699
+ isp = @top_module.add_itegration(c.to_s,nickname:'implicit',implicit:true)
700
+ @top_module.implicit_itgt_collect << isp
701
+ ## 如果是隐性添加,先不要加入pin_map
702
+ define_singleton_method(e) do
703
+ ItegrationVerbAgent.new(isp)
704
+ end
705
+ isp.link_eval
706
+ isp.child_inst_itgt << self
707
+ mark = true
708
+ break
702
709
  end
703
- isp.link_eval
704
- isp.child_inst_itgt << self
705
- mark = true
706
- break
707
710
  end
708
711
  end
709
712
 
@@ -736,18 +739,21 @@ class ItegrationVerb
736
739
  next if mark ## 找到了 就处理下一个Link
737
740
  ##
738
741
  ## 如果没有找到 再从 ItegrationVerb children里面找到比加入
739
- @@child.each do |c|
740
- explort_attrs = c.get_itgt_var('itegration_explort_collect')
741
- if (explort_attrs & container_attrs).sort == container_attrs.sort
742
- isp = @top_module.add_itegration(c.to_s,nickname:'implicit',implicit:true)
743
- @top_module.implicit_itgt_collect << isp
744
- ## 如果是隐性添加,先不要加入pin_map
742
+ ## 去除隐性引入
743
+ unless TopModule.itgt_implicit_reject
744
+ @@child.each do |c|
745
+ explort_attrs = c.get_itgt_var('itegration_explort_collect')
746
+ if (explort_attrs & container_attrs).sort == container_attrs.sort
747
+ isp = @top_module.add_itegration(c.to_s,nickname:'implicit',implicit:true)
748
+ @top_module.implicit_itgt_collect << isp
749
+ ## 如果是隐性添加,先不要加入pin_map
745
750
 
746
- define_singleton_method(e) do
747
- ItegrationVerbAgent.new(isp)
751
+ define_singleton_method(e) do
752
+ ItegrationVerbAgent.new(isp)
753
+ end
754
+ mark = true
755
+ break
748
756
  end
749
- mark = true
750
- break
751
757
  end
752
758
  end
753
759
 
@@ -59,7 +59,7 @@ class Logic
59
59
  raise TdlError.new(" posedge negedge both nil") unless (posedge || negedge )
60
60
  # raise TdlError.new "file cant be empty" unless file
61
61
 
62
- file = File.join(AxiTdl::TDL_PATH,"./auto_script/tmp/","#{self.name}_#{globle_random_name_flag}.coe")
62
+ file = File.join(AxiTdl::TDL_PATH,"./auto_script/tmp/","#{self.name}_#{@belong_to_module._auto_name_incr_index_}.coe")
63
63
  _len = 1000
64
64
  ClassHDL::AssignDefOpertor.with_rollback_opertors(:old) do
65
65
  require_hdl 'logic_sim_model.sv'
@@ -125,9 +125,13 @@ class Axi4 < TdlSpace::TdlBaseInterface
125
125
  return new_obj
126
126
  end
127
127
 
128
- def branch(name:@name,clock:@clock,reset:@reset,mode:@mode,dsize:@dsize,idsize:@idsize,asize:@asize,lsize:@lsize,addr_step:@addr_step,dimension:[],freqM:nil)
128
+ def branch(name: nil,clock:@clock,reset:@reset,mode:@mode,dsize:@dsize,idsize:@idsize,asize:@asize,lsize:@lsize,addr_step:@addr_step,dimension:[],freqM:nil)
129
129
  # puts "freqM :: ",freqM
130
- a = inherited(name:name,clock:clock,reset:reset,mode:mode,dsize:dsize,idsize:idsize,asize:asize,lsize:lsize,addr_step:addr_step,dimension:dimension,freqM:freqM)
130
+ xx_name = name
131
+ ClassHDL::AssignDefOpertor.with_rollback_opertors(:old) do
132
+ xx_name = name || "#{belong_to_module.module_name}_axi4_branch#{belong_to_module._auto_name_incr_index_()}"
133
+ end
134
+ a = inherited(name:xx_name,clock:clock,reset:reset,mode:mode,dsize:dsize,idsize:idsize,asize:asize,lsize:lsize,addr_step:addr_step,dimension:dimension,freqM:freqM)
131
135
  self << a
132
136
  return a
133
137
  end
@@ -62,7 +62,7 @@ class AxiStream < TdlSpace::TdlBaseInterface
62
62
  def inherited(name: nil ,clock: nil,reset: nil,dsize: nil,freqM: nil,dimension:[])
63
63
  a = nil
64
64
  unless name
65
- name = "#{inst_name}_inherited#{globle_random_name_flag()}"
65
+ name = "#{inst_name}_inherited#{belong_to_module._auto_name_incr_index_()}"
66
66
  end
67
67
  ClassHDL::AssignDefOpertor.with_rollback_opertors(:old) do
68
68
  append_name = name_copy(name)
@@ -88,7 +88,7 @@ class AxiStream < TdlSpace::TdlBaseInterface
88
88
 
89
89
  ## =======================
90
90
  def self.leave_empty(curr_type: :master,dsize:8,clock:"",reset:"",belong_to_module:nil)
91
- nc = belong_to_module.axi_stream_inf(dsize:dsize,clock:clock,reset:reset) - "empty_axis_#{globle_random_name_flag()}"
91
+ nc = belong_to_module.axi_stream_inf(dsize:dsize,clock:clock,reset:reset) - "empty_axis_#{belong_to_module._auto_name_incr_index_()}"
92
92
  # puts belong_to_module.module_name
93
93
  if curr_type.to_sym == :slaver
94
94
  # self.axis_master_empty(master:nc)
@@ -109,7 +109,7 @@ class AxiStream < TdlSpace::TdlBaseInterface
109
109
 
110
110
  def branch(name: nil,clock:@clock,reset:@reset,dsize:@dsize,freqM:nil)
111
111
  unless name
112
- name = "#{inst_name}_branch#{globle_random_name_flag()}"
112
+ name = "#{inst_name}_branch#{belong_to_module._auto_name_incr_index_()}"
113
113
  end
114
114
  a = inherited(name: name,clock: clock,reset: reset,dsize: dsize,freqM: freqM)
115
115
  self << a
@@ -41,7 +41,7 @@ class DataInf_C < TdlSpace::TdlBaseInterface
41
41
  def inherited(name: nil,clock: nil,reset: nil,dsize: nil,freqM: nil,dimension:[])
42
42
  a = nil
43
43
  unless name
44
- name = "#{inst_name}_inherited#{globle_random_name_flag()}"
44
+ name = "#{inst_name}_inherited#{belong_to_module._auto_name_incr_index_()}"
45
45
  end
46
46
  ClassHDL::AssignDefOpertor.with_rollback_opertors(:old) do
47
47
  append_name = name_copy(name)
@@ -71,7 +71,7 @@ class DataInf_C < TdlSpace::TdlBaseInterface
71
71
 
72
72
  def branch(name: nil,clock:@clock,reset:@reset,dsize:@dsize,freqM:nil)
73
73
  unless name
74
- name = "#{inst_name}_branch#{globle_random_name_flag()}"
74
+ name = "#{inst_name}_branch#{belong_to_module._auto_name_incr_index_()}"
75
75
  end
76
76
  a = inherited(name: name,clock: clock,reset: reset,dsize: dsize,freqM: freqM)
77
77
  self << a
@@ -432,11 +432,16 @@ module TdlSpace
432
432
  vv = rel || v[1]
433
433
  # vv = self.send(k) || v[1]
434
434
  ## 不例化 FreqM,FreqM只是为了SDL兼容
435
- if vv && k.to_s != 'freqM'
435
+ # if vv && k.to_s != 'freqM'
436
+ if vv
436
437
  if vv.instance_of?(String)
437
438
  str << ".#{v[0]}(\"#{vv}\")"
438
439
  else
439
- str << ".#{v[0]}(#{vv})"
440
+ if k.to_s == 'freqM'
441
+ str << ".#{v[0]}(#{(respond_to?(:clock) && self.clock.is_a?(Clock) && self.clock.freqM ) || vv})"
442
+ else
443
+ str << ".#{v[0]}(#{vv})"
444
+ end
440
445
  end
441
446
  end
442
447
  end
@@ -411,7 +411,11 @@ class SdlModule
411
411
  ref_modules.each do |e|
412
412
  _indexs << index
413
413
  _names << e.module_name
414
- _paths << File.expand_path(e.real_sv_path)
414
+ begin
415
+ _paths << File.expand_path(e.real_sv_path)
416
+ rescue
417
+ _paths << " ___ dont have a path !!!!! ____"
418
+ end
415
419
  index += 1
416
420
  if e.module_name.size > max_size
417
421
  max_size = e.module_name.size
@@ -483,3 +487,71 @@ class SdlModule
483
487
  end
484
488
 
485
489
  end
490
+
491
+ ## 迭代 本模块及本模块的子模块
492
+ class SdlModule
493
+
494
+ def all_ref_sdlmodules(&block)
495
+ sdlms = instance_and_children_module.values.uniq
496
+ sdlms = sdlms.map do |e|
497
+ if e.instance_and_children_module.any?
498
+ e.all_ref_sdlmodules(&block)
499
+ else
500
+ e
501
+ end
502
+ end
503
+ sdlms = sdlms.unshift(self)
504
+ sdlms = sdlms.flatten
505
+ sdlms.map(&block)
506
+ end
507
+
508
+ end
509
+
510
+ ### 有时候 sdlmodule 引用的是 HDL文件,为了能够 正常引用到 需要特殊处理
511
+ class SdlModule
512
+ def contain_hdl(*hdl_names)
513
+ __contain_hdl__(false,*hdl_names)
514
+ end
515
+
516
+ def __contain_hdl__(recreate,*hdl_names)
517
+ hdl_names = hdl_names.map do |e|
518
+
519
+ if e.include?("/") || e.include?("\\")
520
+ e
521
+ else
522
+
523
+ ee = find_first_hdl_path(e)
524
+ if recreate && !ee
525
+ raise TdlError.new("Cant find #{e} in tdl_paths")
526
+ end
527
+ ee || e
528
+ end
529
+ end
530
+ unless recreate
531
+ @__contain_hdl__ ||= []
532
+ @__contain_hdl__ += hdl_names
533
+ else
534
+ @__contain_hdl__ = hdl_names
535
+ end
536
+ @__contain_hdl__.uniq!
537
+ @__contain_hdl__
538
+ end
539
+
540
+ def require_hdl(*hdl_path)
541
+ hdl_path.each do |hp|
542
+ __require_hdl__(hp,self)
543
+ end
544
+ end
545
+ end
546
+
547
+ ## 定义自动变量递增
548
+ class SdlModule
549
+
550
+ def _auto_name_incr_index_(flag='R')
551
+ @__auto_name_incr_index__ ||= 0
552
+ index = @__auto_name_incr_index__
553
+ @__auto_name_incr_index__ += 1
554
+ return "#{flag}#{"%04d" % index}"
555
+ end
556
+
557
+ end
@@ -57,7 +57,7 @@ class SdlModule
57
57
 
58
58
  head_str,body_str = build_module_verb(ex_param:ex_param,ex_port:ex_port,ex_up_code:ex_up_code,ex_down_code:ex_down_code)
59
59
  new_str = head_str+body_str
60
- if body_str.gsub(/\/\*.*?\*\//m,"").gsub(/\/\/.*/,"").strip != old_str
60
+ if body_str.gsub(/\/\/.*/,"").strip != old_str
61
61
  File.open(File.join(@out_sv_path,"#{module_name}.sv"),"w") do |f|
62
62
  f.print new_str
63
63
  end
@@ -81,7 +81,7 @@ module VCSCompatable
81
81
  # end
82
82
 
83
83
  def self.common_instance(sdlmodule,inst_name,inst_modport,cn_modport)
84
- vcs_cpt_inf = cn_modport.inherited(name: "#{cn_modport.name}_vcs_cp_#{globle_random_name_flag()}")
84
+ vcs_cpt_inf = cn_modport.inherited(name: "#{cn_modport.name}_vcs_cp_#{sdlmodule._auto_name_incr_index_()}")
85
85
  if vcs_cpt_inf.is_a? Axi4
86
86
  # vcs_cpt_inf.origin_freqM = cn_modport.FreqM
87
87
  vcs_cpt_inf.addr_step = cn_modport.ADDR_STEP
@@ -90,7 +90,7 @@ module VCSCompatable
90
90
 
91
91
  if inst_modport.modport_type.to_s =~ /master/ || inst_modport.modport_type.to_s == "out_mirror"
92
92
  # puts "+++++++ Match Master ModPort ++++++ #{sdlmodule.module_name}"
93
- sdlmodule.Instance(inst_name,"#{inst_name}_#{inst_modport.name}_#{globle_random_name_flag()}_#{cn_modport.name}_inst") do |h|
93
+ sdlmodule.Instance(inst_name,"#{inst_name}_#{inst_modport.name}_#{sdlmodule._auto_name_incr_index_()}_#{cn_modport.name}_inst") do |h|
94
94
  h[:ORIGIN] = "#{inst_modport.modport_type}"
95
95
  h[:TO] = "#{cn_modport.modport_type}"
96
96
  h[:origin] = vcs_cpt_inf
@@ -98,7 +98,7 @@ module VCSCompatable
98
98
  end
99
99
  elsif inst_modport.modport_type.to_s =~ /slaver/ || inst_modport.modport_type.to_s =~ /mirror/
100
100
  # puts "+++++++ Match Slaver ModPort ++++++"
101
- sdlmodule.Instance(inst_name,"#{inst_name}_#{inst_modport.name}_#{globle_random_name_flag()}_#{cn_modport.name}_inst") do |h|
101
+ sdlmodule.Instance(inst_name,"#{inst_name}_#{inst_modport.name}_#{sdlmodule._auto_name_incr_index_()}_#{cn_modport.name}_inst") do |h|
102
102
  h[:TO] = "#{inst_modport.modport_type}"
103
103
  h[:ORIGIN] = "#{cn_modport.modport_type}"
104
104
  h[:to] = vcs_cpt_inf
@@ -20,7 +20,9 @@ class SdlModule
20
20
  @__track_signals_hash__[flag] ||= Hash.new
21
21
 
22
22
  if @__track_signals_hash__[flag].has_key?(base_ele)
23
- raise TdlError.new(" `#{module_name}.#{base_ele.to_s}` Cant be tracked again!!!")
23
+ # raise TdlError.new(" `#{module_name}.#{base_ele.to_s}` Cant be tracked again!!!")
24
+ puts "WAINNING: `#{module_name}.#{base_ele.to_s}` Cant be tracked again!!!"
25
+ return
24
26
  end
25
27
 
26
28
  @__track_signals_hash__[flag][base_ele] = block
@@ -215,6 +217,7 @@ class TestUnitModule < SdlModule ##TestUnitModule 是在编译完 TopModule TB
215
217
  to_down_pass <= 1.b0
216
218
  initial_exec("wait(from_up_pass)")
217
219
  initial_exec("$root.#{TopModule.current.techbench.module_name}.test_unit_region = \"#{module_name}\"")
220
+ initial_exec("$display(\"--------------- Current test_unit <%0s> --------------------\", \"#{module_name}\")")
218
221
  block.call ## collect __root_ref_eles__ at here
219
222
  to_down_pass <= 1.b1
220
223
  end
@@ -340,6 +340,7 @@ endmodule\n"
340
340
  end
341
341
 
342
342
  define_global("sim",nil)
343
+ define_global("itgt_implicit_reject",nil)
343
344
 
344
345
  end
345
346
  ## 添加 itegration verb
@@ -437,6 +438,9 @@ class TopModule
437
438
  SdlModule.gen_dev_wave_tcl File.join(sdlm.vcs_path,"dve.tcl")
438
439
  end
439
440
  sdlm.create_xdc
441
+
442
+ ## 全局contain_hdl 引入到 TopModule
443
+ sdlm.contain_hdl(*$__contain_hdl__)
440
444
  else
441
445
  sdlm.origin_sv = true
442
446
  end
data/lib/tdl/tdl.rb CHANGED
@@ -138,7 +138,7 @@ require_relative "./exlib/logic_verify.rb"
138
138
  $argvs_hash = {}
139
139
  $argvs_hash = Parser.parse($TdlARGV || ARGV)
140
140
  TopModule.sim = $argvs_hash[:sim]
141
-
141
+ TopModule.itgt_implicit_reject = $argvs_hash[:itgt_implicit_reject]
142
142
  class Tdl
143
143
 
144
144
  def self.comment(c="-",info="_____")
@@ -271,16 +271,6 @@ class Tdl
271
271
  puts(pagination("SUMMARY"))
272
272
  puts "#{TopModule.sim ? 'SIM' : 'SYNTH'} RUN SPEND #{Time.now - $__start_time__} sec @ TIME : #{Time.now}"
273
273
 
274
- ## -----------
275
- # TopModule.current.ref_modules.uniq.each do |e|
276
- # unless e.is_a? ClassHDL::ClearSdlModule
277
- # puts "#{e.real_sv_path}: #{e.module_name}"
278
- # end
279
- # end
280
- ## ===========
281
- # File.open("/home/myw357/work/FPGA/mammo_tcp_20210315/tmp.tcl", "w") do |f|
282
- # f.puts SdlModule.call_module('test_mac_1g_verb').gen_dev_wave_tcl
283
- # end
284
274
  end
285
275
 
286
276
  end