axi_tdl 0.0.9 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gem-push.yml +44 -0
  3. data/.github/workflows/ruby.yml +35 -0
  4. data/.gitignore +3 -1
  5. data/.travis.yml +9 -0
  6. data/Gemfile +4 -0
  7. data/README.EN.md +322 -0
  8. data/README.md +24 -20
  9. data/Rakefile +2 -6
  10. data/axi_tdl.gemspec +5 -6
  11. data/lib/axi/AXI4/axi4_direct_B1.sv +23 -23
  12. data/lib/axi/AXI4/axi4_dpram_cache.sv +33 -33
  13. data/lib/axi/AXI4/axis_to_axi4_wr.rb +1 -0
  14. data/lib/axi/AXI4/axis_to_axi4_wr.sv +20 -20
  15. data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.sv +32 -32
  16. data/lib/axi/AXI4/packet_partition/data_inf_partition.rb +2 -0
  17. data/lib/axi/AXI4/packet_partition/data_inf_partition.sv +71 -71
  18. data/lib/axi/AXI4/wide_axis_to_axi4_wr.rb +2 -1
  19. data/lib/axi/AXI4/wide_axis_to_axi4_wr.sv +23 -23
  20. data/lib/axi/AXI_stream/axi_stream_split_channel.rb +7 -1
  21. data/lib/axi/AXI_stream/axis_head_cut_verb.sv +6 -2
  22. data/lib/axi/AXI_stream/axis_insert_copy.rb +18 -4
  23. data/lib/axi/AXI_stream/axis_sim_master_model.rb +28 -0
  24. data/lib/axi/AXI_stream/axis_sim_slaver_model.rb +26 -0
  25. data/lib/axi/AXI_stream/axis_sim_verify_by_coe.sv +101 -0
  26. data/lib/axi/AXI_stream/axis_split_channel_verb.rb +2 -0
  27. data/lib/axi/common/common_ram_sim_wrapper.sv +9 -9
  28. data/lib/axi/common/common_ram_wrapper.sv +12 -12
  29. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +26 -26
  30. data/lib/axi/data_interface/data_inf_c/data_c_sim_master_model.sv +69 -0
  31. data/lib/axi/data_interface/data_inf_c/data_c_sim_slaver_model.sv +58 -0
  32. data/lib/axi/data_interface/data_inf_c/logic_sim_model.sv +64 -0
  33. data/lib/axi/techbench/tb_axi_stream_split_channel.rb +69 -0
  34. data/lib/axi/techbench/tb_axi_stream_split_channel.sv +149 -0
  35. data/lib/axi/techbench/tb_axis_split_channel_verb.rb +69 -0
  36. data/lib/axi/techbench/tb_axis_split_channel_verb.sv +125 -0
  37. data/lib/axi_tdl.rb +1 -0
  38. data/lib/axi_tdl/version.rb +1 -1
  39. data/lib/tdl/auto_script/autogensdl.rb +16 -5
  40. data/lib/tdl/axi4/axi4_interconnect_verb.rb +4 -2
  41. data/lib/tdl/basefunc.rb +1 -0
  42. data/lib/tdl/class_hdl/hdl_always_comb.rb +4 -3
  43. data/lib/tdl/class_hdl/hdl_always_ff.rb +49 -8
  44. data/lib/tdl/class_hdl/hdl_assign.rb +5 -3
  45. data/lib/tdl/class_hdl/hdl_block_ifelse.rb +11 -9
  46. data/lib/tdl/class_hdl/hdl_foreach.rb +2 -2
  47. data/lib/tdl/class_hdl/hdl_function.rb +4 -2
  48. data/lib/tdl/class_hdl/hdl_generate.rb +5 -4
  49. data/lib/tdl/class_hdl/hdl_initial.rb +11 -10
  50. data/lib/tdl/class_hdl/hdl_module_def.rb +18 -1
  51. data/lib/tdl/class_hdl/hdl_redefine_opertor.rb +35 -14
  52. data/lib/tdl/class_hdl/hdl_struct.rb +1 -1
  53. data/lib/tdl/class_hdl/hdl_verify.rb +1 -1
  54. data/lib/tdl/elements/originclass.rb +6 -1
  55. data/lib/tdl/elements/parameter.rb +1 -1
  56. data/lib/tdl/examples/10_random/exp_random.sv +3 -3
  57. data/lib/tdl/examples/11_test_unit/dve.tcl +155 -2
  58. data/lib/tdl/examples/11_test_unit/exp_test_unit.rb +9 -8
  59. data/lib/tdl/examples/11_test_unit/exp_test_unit.sv +1 -1
  60. data/lib/tdl/examples/11_test_unit/modules/sub_md0.rb +6 -3
  61. data/lib/tdl/examples/11_test_unit/modules/sub_md0.sv +5 -5
  62. data/lib/tdl/examples/11_test_unit/modules/sub_md1.rb +9 -4
  63. data/lib/tdl/examples/11_test_unit/modules/sub_md1.sv +5 -5
  64. data/lib/tdl/examples/11_test_unit/tb_exp_test_unit.sv +1 -3
  65. data/lib/tdl/examples/11_test_unit/tu0.sv +9 -9
  66. data/lib/tdl/examples/11_test_unit/tu1.sv +1 -1
  67. data/lib/tdl/examples/1_define_module/exmple_md.sv +12 -12
  68. data/lib/tdl/examples/2_hdl_class/tmp/always_comb_test.sv +60 -60
  69. data/lib/tdl/examples/2_hdl_class/tmp/always_ff_test.sv +2 -2
  70. data/lib/tdl/examples/2_hdl_class/tmp/case_test.sv +17 -17
  71. data/lib/tdl/examples/2_hdl_class/tmp/head_pkg_module.sv +9 -9
  72. data/lib/tdl/examples/2_hdl_class/tmp/simple_assign_test.sv +1 -1
  73. data/lib/tdl/examples/2_hdl_class/tmp/state_case_test.sv +10 -10
  74. data/lib/tdl/examples/2_hdl_class/tmp/test_foreach.sv +3 -3
  75. data/lib/tdl/examples/2_hdl_class/tmp/test_function.sv +7 -7
  76. data/lib/tdl/examples/2_hdl_class/tmp/test_initial_assert.sv +3 -3
  77. data/lib/tdl/examples/2_hdl_class/tmp/test_module.sv +2 -2
  78. data/lib/tdl/examples/2_hdl_class/tmp/test_module_var.sv +2 -2
  79. data/lib/tdl/examples/2_hdl_class/tmp/test_package.sv +4 -5
  80. data/lib/tdl/examples/2_hdl_class/tmp/test_package2.sv +4 -4
  81. data/lib/tdl/examples/2_hdl_class/tmp/test_struct_function.sv +2 -2
  82. data/lib/tdl/examples/2_hdl_class/tmp/test_vcs_string.sv +1 -1
  83. data/lib/tdl/examples/2_hdl_class/tmp/text_generate.sv +7 -7
  84. data/lib/tdl/examples/4_generate/test_generate.sv +11 -11
  85. data/lib/tdl/examples/5_logic_combin/test_logic_combin.sv +3 -3
  86. data/lib/tdl/examples/7_module_with_package/body_package.sv +3 -4
  87. data/lib/tdl/examples/7_module_with_package/example_pkg.sv +4 -4
  88. data/lib/tdl/examples/7_module_with_package/head_package.sv +3 -4
  89. data/lib/tdl/examples/8_top_module/tb_test_top.sv +1 -2
  90. data/lib/tdl/examples/9_itegration/tb_test_tttop.sv +2 -2
  91. data/lib/tdl/examples/9_itegration/test_tttop.sv +3 -3
  92. data/lib/tdl/exlib/axis_eth_ex.rb +95 -0
  93. data/lib/tdl/exlib/axis_verify.rb +264 -0
  94. data/lib/tdl/exlib/clock_reset_verify.rb +29 -0
  95. data/lib/tdl/exlib/dve_tcl.rb +30 -11
  96. data/lib/tdl/exlib/itegration.rb +15 -3
  97. data/lib/tdl/exlib/logic_verify.rb +88 -0
  98. data/lib/tdl/exlib/test_point.rb +96 -94
  99. data/lib/tdl/exlib/test_point.rb.bak +293 -0
  100. data/lib/tdl/rebuild_ele/ele_base.rb +1 -1
  101. data/lib/tdl/sdlmodule/sdlmodlule_path_db.rb +34 -0
  102. data/lib/tdl/sdlmodule/sdlmodule.rb +18 -14
  103. data/lib/tdl/sdlmodule/sdlmodule_draw.rb +81 -16
  104. data/lib/tdl/sdlmodule/test_unit_module.rb +272 -33
  105. data/lib/tdl/sdlmodule/test_unit_module.rb.bak +143 -0
  106. data/lib/tdl/sdlmodule/top_module.rb +53 -48
  107. data/lib/tdl/sdlmodule/top_module.rb.bak +547 -0
  108. data/lib/tdl/tdl.rb +19 -4
  109. metadata +36 -137
  110. data/Gemfile.lock +0 -28
  111. data/lib/axi/AXI_stream/axi_stream_split_channel.sv +0 -149
  112. data/lib/axi/AXI_stream/axis_head_cut_verc.sv +0 -242
  113. data/lib/axi/AXI_stream/axis_insert_copy.sv +0 -66
  114. data/lib/axi/AXI_stream/axis_pipe_sync_seam.sv +0 -48
  115. data/lib/axi/AXI_stream/axis_rom_contect_sim.sv +0 -113
  116. data/lib/axi/AXI_stream/axis_split_channel_verb.sv +0 -62
@@ -0,0 +1,125 @@
1
+ /**********************************************
2
+ _______________________________________
3
+ ___________ Cook Darwin __________
4
+ _______________________________________
5
+ descript:
6
+ author : Cook.Darwin
7
+ Version: VERA.0.0
8
+ created: xxxx.xx.xx
9
+ madified:
10
+ ***********************************************/
11
+ `timescale 1ns/1ps
12
+
13
+ module tb_axis_split_channel_verb ();
14
+ //==========================================================================
15
+ //-------- define ----------------------------------------------------------
16
+ logic clock;
17
+ logic rst_n;
18
+ logic [16-1:0] split_len ;
19
+ logic [32-1:0] first_inf_rdy_percetage_index ;
20
+ logic [32-1:0] first_inf_rdy_percetage[2-1:0] ;
21
+ axi_stream_inf #(.DSIZE(8),.USIZE(1)) origin_inf (.aclk(clock),.aresetn(rst_n),.aclken(1'b1)) ;
22
+ axi_stream_inf #(.DSIZE(8),.USIZE(1)) first_inf (.aclk(clock),.aresetn(rst_n),.aclken(1'b1)) ;
23
+ axi_stream_inf #(.DSIZE(8),.USIZE(1)) end_inf (.aclk(clock),.aresetn(rst_n),.aclken(1'b1)) ;
24
+ //==========================================================================
25
+ //-------- instance --------------------------------------------------------
26
+ axis_split_channel_verb axis_split_channel_verb_inst(
27
+ /* input */.split_len (split_len ),
28
+ /* axi_stream_inf.slaver */.origin_inf (origin_inf ),
29
+ /* axi_stream_inf.master */.first_inf (first_inf ),
30
+ /* axi_stream_inf.master */.end_inf (end_inf )
31
+ );
32
+ logic_sim_model #(
33
+ .LOOP ("TRUE" ),
34
+ .DSIZE (16 ),
35
+ .RAM_DEPTH (4 )
36
+ )split_len_sim_model_inst(
37
+ /* input */.next_at_negedge_of (origin_inf.axis_tvalid && origin_inf.axis_tready && origin_inf.axis_tlast ),
38
+ /* input */.next_at_posedge_of (1'b0 ),
39
+ /* input */.load_trigger (1'b0 ),
40
+ /* input */.total_length (4 ),
41
+ /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/split_len_R372.coe" ),
42
+ /* output */.data (split_len )
43
+ );
44
+ axis_sim_master_model #(
45
+ .LOOP ("TRUE" ),
46
+ .RAM_DEPTH (246 )
47
+ )sim_model_inst_origin_inf(
48
+ /* input */.load_trigger (1'b0 ),
49
+ /* input */.total_length (246 ),
50
+ /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/origin_inf_R994.coe" ),
51
+ /* axi_stream_inf.master */.out_inf (origin_inf )
52
+ );
53
+ axis_sim_verify_by_coe #(
54
+ .RAM_DEPTH (21 ),
55
+ .VERIFY_KEEP ("OFF" ),
56
+ .VERIFY_USER ("OFF" )
57
+ )axis_sim_verify_by_coe_inst_first_inf(
58
+ /* input */.load_trigger (1'b0 ),
59
+ /* input */.total_length (21 ),
60
+ /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/first_inf_R285.coe" ),
61
+ /* axi_stream_inf.mirror */.mirror_inf (first_inf )
62
+ );
63
+ axis_sim_verify_by_coe #(
64
+ .RAM_DEPTH (118 ),
65
+ .VERIFY_KEEP ("OFF" ),
66
+ .VERIFY_USER ("OFF" )
67
+ )axis_sim_verify_by_coe_inst_end_inf(
68
+ /* input */.load_trigger (1'b0 ),
69
+ /* input */.total_length (118 ),
70
+ /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/end_inf_R1971.coe" ),
71
+ /* axi_stream_inf.mirror */.mirror_inf (end_inf )
72
+ );
73
+ //==========================================================================
74
+ //-------- expression ------------------------------------------------------
75
+ initial begin
76
+ clock = 1'b0;
77
+ #(100ns);
78
+ forever begin #(5.0ns);clock = ~clock;end;
79
+ end
80
+
81
+ initial begin
82
+ rst_n = 1'b0;
83
+ #(200ns);
84
+ rst_n = ~rst_n;
85
+ end
86
+
87
+ initial begin
88
+ first_inf_rdy_percetage_index = 0;
89
+ first_inf_rdy_percetage[0] = 100;
90
+ first_inf_rdy_percetage[1] = 50;
91
+ end
92
+
93
+ always@(posedge clock) begin
94
+ if(first_inf.axis_tvalid && first_inf.axis_tready && first_inf.axis_tlast)begin
95
+ if( first_inf_rdy_percetage_index>=( 2-1))begin
96
+ first_inf_rdy_percetage_index <= 0;
97
+ end
98
+ else begin
99
+ first_inf_rdy_percetage_index <= ( first_inf_rdy_percetage_index+1'b1);
100
+ end
101
+ end
102
+ else begin
103
+ first_inf_rdy_percetage_index <= first_inf_rdy_percetage_index;
104
+ end
105
+ end
106
+
107
+ always@(posedge clock) begin
108
+ if(~rst_n)begin
109
+ first_inf.axis_tready <= 1'b0;
110
+ end
111
+ else begin
112
+ first_inf.axis_tready <= ($urandom_range(0,99) <= first_inf_rdy_percetage[first_inf_rdy_percetage_index]);
113
+ end
114
+ end
115
+
116
+ always@(posedge clock) begin
117
+ if(~rst_n)begin
118
+ end_inf.axis_tready <= 1'b0;
119
+ end
120
+ else begin
121
+ end_inf.axis_tready <= ($urandom_range(0,99) <= 50);
122
+ end
123
+ end
124
+
125
+ endmodule
data/lib/axi_tdl.rb CHANGED
@@ -20,6 +20,7 @@ add_to_tdl_paths File.expand_path(File.join(__dir__, "axi/common_fifo"))
20
20
  add_to_tdl_paths File.expand_path(File.join(__dir__, "axi/common"))
21
21
  add_to_tdl_paths File.expand_path(File.join(__dir__, "axi/data_interface"))
22
22
  add_to_tdl_paths File.expand_path(File.join(__dir__, "axi/data_interface/data_inf_c"))
23
+ add_to_tdl_paths File.expand_path(File.join(__dir__, "axi/techbench"))
23
24
 
24
25
  ## base require
25
26
  require_hdl 'axis_master_empty.sv'
@@ -1,3 +1,3 @@
1
1
  module AxiTdl
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -232,10 +232,21 @@ class AutoGenSdl
232
232
  end
233
233
 
234
234
  def gen_file
235
- @autof = File.open(@autof_name,"w") do |f|
236
- f.puts gen_head
237
- f.puts gen_content
238
- # f.puts "sm.origin_sv = true"
235
+ unless File.exist?(@autof_name)
236
+ @autof = File.open(@autof_name,"w") do |f|
237
+ f.print gen_head
238
+ f.print gen_content
239
+ # f.puts "sm.origin_sv = true"
240
+ end
241
+ else
242
+ _old_str = File.open(@autof_name).read
243
+ _new_str = gen_head+gen_content
244
+ if _old_str != _new_str
245
+ @autof = File.open(@autof_name,"w") do |f|
246
+ f.print _new_str
247
+ # f.puts "sm.origin_sv = true"
248
+ end
249
+ end
239
250
  end
240
251
  end
241
252
 
@@ -255,7 +266,7 @@ self.path = File.expand_path(__FILE__)
255
266
  end
256
267
 
257
268
  def gen_content
258
- (@param_port_inst+@signals_ports_inst+@inf_ports_inst + ["end"]).join("\n")
269
+ (@param_port_inst+@signals_ports_inst+@inf_ports_inst + ["end\n\n"]).join("\n")
259
270
  end
260
271
 
261
272
 
@@ -218,16 +218,18 @@ class Axi4
218
218
  else
219
219
  mode_str = "ONLY_READ_to_BOTH"
220
220
  end
221
+ require_hdl 'axi4_direct_B1.sv'
221
222
  # Axi4.axi4_direct_a1(mode:mode_str,slaver:lo,master:"#{sub_name}[#{index}]",belong_to_module:belong_to_module)
222
223
  belong_to_module.Instance('axi4_direct_B1',"axi4_direct_a1_long_to_wide_#{sub_name}_#{globle_random_name_flag()}") do |h|
223
224
  # h.param.MODE mode_str #//ONLY_READ to BOTH,ONLY_WRITE to BOTH,BOTH to BOTH,BOTH to ONLY_READ,BOTH to ONLY_WRITE
224
- h.slaver lo
225
- h.master "#{sub_name}[#{index}]".to_nq
225
+ h.slaver_inf lo
226
+ h.master_inf "#{sub_name}[#{index}]".to_nq
226
227
  end
227
228
 
228
229
  else
229
230
  los = short_only.pop
230
231
  @_long_slim_to_wide.delete los
232
+ require_hdl 'axi4_combin_wr_rd_batch.sv'
231
233
  if wr_lg
232
234
  # Axi4.axi4_combin_wr_rd_batch(wr_slaver:lo,rd_slaver:los,master:"#{sub_name}[#{index}]",belong_to_module:belong_to_module)
233
235
  belong_to_module.Instance(:axi4_combin_wr_rd_batch,"axi4_combin_wr_rd_batch_inst_#{sub_name}") do |h|
data/lib/tdl/basefunc.rb CHANGED
@@ -264,6 +264,7 @@ class Integer
264
264
  def clog2
265
265
  b = Math.log2(self)
266
266
  c = b.ceil
267
+ return c
267
268
  end
268
269
 
269
270
  end
@@ -3,9 +3,10 @@ module ClassHDL
3
3
 
4
4
  class HDLAlwaysCombBlock
5
5
  attr_accessor :opertor_chains
6
-
7
- def initialize
6
+ attr_reader :belong_to_module
7
+ def initialize(belong_to_module)
8
8
  @opertor_chains = []
9
+ @belong_to_module = belong_to_module
9
10
  end
10
11
 
11
12
  def instance
@@ -28,7 +29,7 @@ module ClassHDL
28
29
  end
29
30
 
30
31
  def self.AlwaysComb(sdl_m,&block)
31
- ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysCombBlock.new) do |ab|
32
+ ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysCombBlock.new(sdl_m)) do |ab|
32
33
  AssignDefOpertor.with_rollback_opertors(:new,&block)
33
34
  # return ClassHDL::AssignDefOpertor.curr_assign_block
34
35
  AssignDefOpertor.with_rollback_opertors(:old) do
@@ -30,14 +30,14 @@ module ClassHDL
30
30
  class ClassNegedge < ClassEdge
31
31
  end
32
32
 
33
-
34
- class HDLAlwaysFFBlock
33
+ class HDLAlwaysBlock
35
34
  attr_accessor :opertor_chains,:posedges,:negedges
36
-
37
- def initialize
35
+ attr_reader :belong_to_module
36
+ def initialize(belong_to_module)
38
37
  @opertor_chains = []
39
38
  @posedges = []
40
39
  @negedges = []
40
+ @belong_to_module = belong_to_module
41
41
  end
42
42
 
43
43
  def edge_instance(flag='posedge',edges=[])
@@ -50,6 +50,32 @@ module ClassHDL
50
50
  return es.map{|e| "#{flag} #{e.to_s}"}
51
51
  end
52
52
 
53
+ def instance
54
+ str = []
55
+
56
+ pose_str = edge_instance('posedge',@posedges)
57
+ nege_str = edge_instance('negedge',@negedges)
58
+ pose_str.concat nege_str
59
+
60
+ str.push "always@(#{pose_str.join(",")}) begin "
61
+ opertor_chains.each do |op|
62
+ unless op.is_a? OpertorChain
63
+ str.push op.instance(:always_ff).gsub(/^./){ |m| " #{m}"}
64
+ else
65
+ unless op.slaver
66
+ rel_str = ClassHDL.compact_op_ch(op.instance(:always_ff))
67
+ str.push " #{rel_str};"
68
+ end
69
+ end
70
+
71
+ end
72
+ str.push "end\n"
73
+ str.join("\n")
74
+ end
75
+ end
76
+
77
+ class HDLAlwaysFFBlock < HDLAlwaysBlock
78
+
53
79
  def instance
54
80
  str = []
55
81
 
@@ -74,8 +100,21 @@ module ClassHDL
74
100
  end
75
101
  end
76
102
 
103
+ def self.Always(sdl_m: nil,posedge: [],negedge: [],&block)
104
+ ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysBlock.new(sdl_m)) do |ab|
105
+ ab.posedges = posedge
106
+ ab.negedges = negedge
107
+
108
+ AssignDefOpertor.with_rollback_opertors(:new,&block)
109
+ # return ClassHDL::AssignDefOpertor.curr_assign_block
110
+ AssignDefOpertor.with_rollback_opertors(:old) do
111
+ sdl_m.Logic_draw.push ab.instance
112
+ end
113
+ end
114
+ end
115
+
77
116
  def self.AlwaysFF(sdl_m: nil,posedge: [],negedge: [],&block)
78
- ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysFFBlock.new) do |ab|
117
+ ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysFFBlock.new(sdl_m)) do |ab|
79
118
  ab.posedges = posedge
80
119
  ab.negedges = negedge
81
120
 
@@ -116,7 +155,7 @@ module ClassHDL
116
155
  end
117
156
 
118
157
  def self.AlwaysSIM(sdl_m: nil,posedge: [],negedge: [],&block)
119
- ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysSIMBlock.new) do |ab|
158
+ ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAlwaysSIMBlock.new(sdl_m)) do |ab|
120
159
  ab.posedges = posedge
121
160
  ab.negedges = negedge
122
161
 
@@ -144,16 +183,18 @@ class SdlModule
144
183
  end
145
184
 
146
185
  def Always(posedge: nil,negedge: nil,&block)
147
- ClassHDL::AlwaysFF(sdl_m: self,posedge: posedge,negedge: negedge,&block)
186
+ ClassHDL::Always(sdl_m: self,posedge: posedge,negedge: negedge,&block)
148
187
  end
149
188
 
189
+ alias_method :always, :Always
190
+
150
191
  def Always_ff(posedge: nil,negedge: nil,&block)
151
192
  ClassHDL::AlwaysFF(sdl_m: self,posedge: posedge,negedge: negedge,&block)
152
193
  end
153
194
 
154
195
  def always_ff(*args,&block)
155
196
  if args[0].is_a? Hash
156
- return Always(args[0],&block)
197
+ return Always(**args[0],&block)
157
198
  end
158
199
  posedge_list = []
159
200
  negedge_list = []
@@ -3,9 +3,11 @@ module ClassHDL
3
3
 
4
4
  class HDLAssignBlock
5
5
  attr_accessor :opertor_chains
6
-
7
- def initialize
6
+ attr_reader :belong_to_module
7
+
8
+ def initialize(belong_to_module)
8
9
  @opertor_chains = []
10
+ @belong_to_module = belong_to_module
9
11
  end
10
12
 
11
13
  def instance
@@ -29,7 +31,7 @@ module ClassHDL
29
31
 
30
32
  def self.Assign(sdl_m,&block)
31
33
  # ClassHDL::AssignDefOpertor.curr_assign_block = ClassHDL::HDLAssignBlock.new
32
- ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAssignBlock.new) do |ab|
34
+ ClassHDL::AssignDefOpertor.with_new_assign_block(ClassHDL::HDLAssignBlock.new(sdl_m)) do |ab|
33
35
  AssignDefOpertor.with_rollback_opertors(:new,&block)
34
36
  # return ClassHDL::AssignDefOpertor.curr_assign_block
35
37
  AssignDefOpertor.with_rollback_opertors(:old) do
@@ -2,9 +2,11 @@ module ClassHDL
2
2
 
3
3
  class BlockIF
4
4
  attr_accessor :cond,:opertor_chains,:slaver
5
- def initialize
5
+ attr_reader :belong_to_module
6
+ def initialize(belong_to_module)
6
7
  @opertor_chains = []
7
8
  @cond = nil
9
+ @belong_to_module = belong_to_module
8
10
  end
9
11
 
10
12
  def instance(as_type= :cond)
@@ -180,7 +182,7 @@ module ClassHDL
180
182
  end
181
183
 
182
184
  module ClassHDL
183
- class EnumStruct
185
+ class EnumStruct < AxiTdl::SdlModuleActiveBaseElm
184
186
  # attr_accessor :sdl_m
185
187
  attr_accessor :belong_to_module
186
188
  def initialize(sdl_m,*args)
@@ -238,7 +240,7 @@ end
238
240
  class SdlModule
239
241
 
240
242
  def IF(cond,&block)
241
- new_op = ClassHDL::BlockIF.new
243
+ new_op = ClassHDL::BlockIF.new(self)
242
244
  # if ClassHDL::AssignDefOpertor.curr_assign_block.is_a? ClassHDL::BlockIF
243
245
  # new_op.slaver = true
244
246
  # end
@@ -255,7 +257,7 @@ class SdlModule
255
257
  end
256
258
 
257
259
  def ELSIF(cond,&block)
258
- new_op = ClassHDL::BlockELSIF.new
260
+ new_op = ClassHDL::BlockELSIF.new(self)
259
261
  # if ClassHDL::AssignDefOpertor.curr_assign_block.is_a? ClassHDL::BlockIF
260
262
  # new_op.slaver = true
261
263
  # end
@@ -272,7 +274,7 @@ class SdlModule
272
274
  end
273
275
 
274
276
  def ELSE(&block)
275
- new_op = ClassHDL::BlockELSE.new
277
+ new_op = ClassHDL::BlockELSE.new(self)
276
278
  # if ClassHDL::AssignDefOpertor.curr_assign_block.is_a? ClassHDL::BlockIF
277
279
  # new_op.slaver = true
278
280
  # end
@@ -284,7 +286,7 @@ class SdlModule
284
286
  end
285
287
 
286
288
  def CASE(cond,&block)
287
- new_op = ClassHDL::BlockCASE.new
289
+ new_op = ClassHDL::BlockCASE.new(self)
288
290
  # if ClassHDL::AssignDefOpertor.curr_assign_block.is_a? ClassHDL::BlockIF
289
291
  # new_op.slaver = true
290
292
  # end
@@ -301,7 +303,7 @@ class SdlModule
301
303
  end
302
304
 
303
305
  def CASEX(cond,&block)
304
- new_op = ClassHDL::BlockCASEX.new
306
+ new_op = ClassHDL::BlockCASEX.new(self)
305
307
  # if ClassHDL::AssignDefOpertor.curr_assign_block.is_a? ClassHDL::BlockIF
306
308
  # new_op.slaver = true
307
309
  # end
@@ -318,7 +320,7 @@ class SdlModule
318
320
  end
319
321
 
320
322
  def WHEN(*cond,&block)
321
- new_op = ClassHDL::BlockCASEWHEN.new
323
+ new_op = ClassHDL::BlockCASEWHEN.new(self)
322
324
 
323
325
  ClassHDL::AssignDefOpertor.with_new_assign_block(new_op) do |ab|
324
326
  if cond.is_a? ClassHDL::OpertorChain
@@ -333,7 +335,7 @@ class SdlModule
333
335
  end
334
336
 
335
337
  def DEFAULT(&block)
336
- new_op = ClassHDL::BlockCASEDEFAULT.new
338
+ new_op = ClassHDL::BlockCASEDEFAULT.new(self)
337
339
 
338
340
  ClassHDL::AssignDefOpertor.with_new_assign_block(new_op) do |ab|
339
341
  block.call
@@ -55,7 +55,7 @@ class SdlModule
55
55
  ClassHDL::AssignDefOpertor.with_normal_opertor do
56
56
  @@__foreach_index_cnt__ += 1
57
57
  end
58
- new_op = ClassHDL::BlockFOREACH.new
58
+ new_op = ClassHDL::BlockFOREACH.new(self)
59
59
 
60
60
  ClassHDL::AssignDefOpertor.with_new_opertor do
61
61
  ClassHDL::AssignDefOpertor.with_new_assign_block(new_op) do |ab|
@@ -81,7 +81,7 @@ class SdlModule
81
81
  ClassHDL::AssignDefOpertor.with_normal_opertor do
82
82
  @@__for_index_cnt__ += 1
83
83
  end
84
- new_op = ClassHDL::BlockFOR.new
84
+ new_op = ClassHDL::BlockFOR.new(self)
85
85
 
86
86
  ClassHDL::AssignDefOpertor.with_new_opertor do
87
87
  ClassHDL::AssignDefOpertor.with_new_assign_block(new_op) do |ab|