axi_tdl 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +1 -0
  4. data/lib/axi/AXI4/axi4_dpram_cache.rb +1 -0
  5. data/lib/axi/AXI4/axi4_dpram_cache.sv +4 -4
  6. data/lib/axi/AXI4/axis_to_axi4_wr.rb +5 -0
  7. data/lib/axi/AXI4/axis_to_axi4_wr.sv +7 -7
  8. data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.sv +1 -1
  9. data/lib/axi/AXI4/packet_partition/data_inf_partition.sv +2 -2
  10. data/lib/axi/AXI_stream/axi_stream_latency.sv +56 -0
  11. data/lib/axi/AXI_stream/axi_stream_split_channel.sv +20 -20
  12. data/lib/axi/AXI_stream/axis_head_cut_verc.rb +98 -42
  13. data/lib/axi/AXI_stream/axis_head_cut_verc.sv +36 -39
  14. data/lib/axi/AXI_stream/axis_insert_copy.sv +1 -1
  15. data/lib/axi/AXI_stream/axis_length_split_with_user.sv +87 -0
  16. data/lib/axi/AXI_stream/axis_pipe_sync_seam.rb +41 -0
  17. data/lib/axi/AXI_stream/axis_pipe_sync_seam.sv +48 -0
  18. data/lib/axi/AXI_stream/packet_fifo/axi_stream_packet_long_fifo.sv +37 -16
  19. data/lib/axi/AXI_stream/parse_big_field_table_A2.sv +3 -2
  20. data/lib/axi/data_interface/data_inf_c/data_c_pipe_force_vld_bind_data.sv +1 -1
  21. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync.sv +70 -0
  22. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.rb +49 -0
  23. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +84 -0
  24. data/lib/axi_tdl.rb +12 -0
  25. data/lib/axi_tdl/version.rb +1 -1
  26. data/lib/tdl/SDL/axistream/axi_stream_packet_long_fifo_sdl.rb +1 -0
  27. data/lib/tdl/SDL/path_lib.rb +1 -1
  28. data/lib/tdl/SDL/vcs_axi4_comptable.rb +9 -0
  29. data/lib/tdl/SDL/vcs_axis_comptable.rb +17 -0
  30. data/lib/tdl/SDL/vcs_data_c_comptable.rb +9 -0
  31. data/lib/tdl/class_hdl/hdl_redefine_opertor.rb +15 -3
  32. data/lib/tdl/examples/11_test_unit/tb_exp_test_unit.sv +1 -0
  33. data/lib/tdl/examples/2_hdl_class/module_def.rb +2 -1
  34. data/lib/tdl/examples/2_hdl_class/test_inst_sugar.rb +3 -1
  35. data/lib/tdl/examples/2_hdl_class/tmp/always_ff_test.sv +1 -1
  36. data/lib/tdl/examples/2_hdl_class/tmp/test_function.sv +2 -2
  37. data/lib/tdl/examples/8_top_module/tb_test_top.sv +1 -0
  38. data/lib/tdl/examples/9_itegration/tb_test_tttop.sv +0 -2
  39. data/lib/tdl/sdlmodule/sdlmodule.rb +64 -0
  40. data/lib/tdl/sdlmodule/sdlmodule_draw.rb +2 -1
  41. data/lib/tdl/sdlmodule/top_module.rb +1 -0
  42. data/lib/tdl/tdl.rb +13 -1
  43. metadata +113 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00bfed5eb26a33d38a48a0e32bd56d6dc164e626c24522b8c1a5a93c7c16740a
4
- data.tar.gz: 14da5ba3c724ec1e1e125db77fc7bf658819673246fe2095d0aa593bb795a9b6
3
+ metadata.gz: 1fb3c990c7f63ad8275055e50f7fa4bc856bfb6301246796eba5ee6dcf3236b4
4
+ data.tar.gz: fd6e9c7f4ae21f787c00302f8d180df111416d1ea46bae5bf7c54ddc9e8ed8e0
5
5
  SHA512:
6
- metadata.gz: 5a60c937d6c3fc10ff43f7611708f4dd5a249b2d20a794ac8d339970d7bf23a3c3474e738d4977679e6e8720ccf879583f7897d1757b0e4ef02e0fa30c98c87f
7
- data.tar.gz: 2a8647634e5eb6dd4ed2cc34d1918a855c91fe03049ba610329391f8918ac5299060fa15560dd6f550537834959b84bf2c35e743c1938bd4bc0eb6bfa2e3c50c
6
+ metadata.gz: 1018742a13f565eca63e54753ddd816d656bb2ef299e575adbc1a33ef0fc161088a423e209d194505cc875061ce01741c7947ae4e0c31285a7887d865494b381
7
+ data.tar.gz: 6de023c61b43cdbb04a2c86233a91285a156d4daf94647f8057a40c45114b287502b9a6167e3eea916eec4677821e3e0e61927385f02757f156dff9a4a364077
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- axi_tdl (0.0.8)
4
+ axi_tdl (0.0.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Axi
2
2
    It is a wonderful library of axi4, but it is not full axi4, It is designed by systemverilog. I compact axi4 and add something to it.
3
+
3
4
    axi hdl path
4
5
  ```ruby
5
6
  require 'axi_tdl'
@@ -3,6 +3,7 @@ require_hdl File.join(__dir__,'full_axi4_to_axis_partition_wr_rd.sv')
3
3
  require_sdl 'common_ram_wrapper.rb'
4
4
 
5
5
  require_hdl File.join(__dir__,"./full_axi4_to_axis.sv")
6
+ require_hdl 'data_inf_c_planer_A1.sv'
6
7
 
7
8
  TdlBuild.axi4_dpram_cache(__dir__) do
8
9
  parameter.INIT_FILE ''
@@ -80,14 +80,14 @@ initial begin
80
80
  end
81
81
 
82
82
  assign a_axis_inf.axis_tready = a_axis_inf.axis_tdata[ a_inf.ASIZE+a_inf.DSIZE+1-1] || (a_datac_rd_inf.ready && !a_axis_inf.axis_tdata[ a_inf.ASIZE+a_inf.DSIZE+1-1]);
83
- assign a_datac_rd_inf.data = {a_axis_inf.axis_tlast,a_axis_inf.axis_tdata[ a_inf.ASIZE+a_inf.DSIZE+1-1- 1: a_inf.ASIZE+a_inf.DSIZE+1-a_inf.ASIZE- 1]};
83
+ assign a_datac_rd_inf.data = {a_axis_inf.axis_tlast,a_axis_inf.axis_tdata[ ( a_inf.ASIZE+a_inf.DSIZE+1-1)-1: ( a_inf.ASIZE+a_inf.DSIZE+1-a_inf.ASIZE)-1]};
84
84
  assign a_datac_rd_inf.valid = a_axis_inf.axis_tvalid && !a_axis_inf.axis_tdata[ a_inf.ASIZE+a_inf.DSIZE+1-1];
85
85
 
86
86
  assign a_axis_rd_inf.axis_tvalid = a_datac_rd_rel_inf.valid;
87
87
  assign a_axis_rd_inf.axis_tdata = a_datac_rd_rel_inf.data[ a_inf.DSIZE-1:0];
88
88
  assign a_axis_rd_inf.axis_tlast = a_datac_rd_rel_inf.data[ a_inf.ASIZE+a_inf.DSIZE+1-1];
89
89
  assign a_datac_rd_rel_inf.ready = a_axis_rd_inf.axis_tready;
90
- assign xram_inf.addra = a_axis_inf.axis_tdata[ a_inf.ASIZE+a_inf.DSIZE+1-1- 1: a_inf.ASIZE+a_inf.DSIZE+1-a_inf.ASIZE- 1];
90
+ assign xram_inf.addra = a_axis_inf.axis_tdata[ ( a_inf.ASIZE+a_inf.DSIZE+1-1)-1: ( a_inf.ASIZE+a_inf.DSIZE+1-a_inf.ASIZE)-1];
91
91
  assign xram_inf.dia = a_axis_inf.axis_tdata[ a_inf.DSIZE-1:0];
92
92
  assign xram_inf.wea = {xram_inf.MSIZE{a_axis_inf.axis_tdata[ a_inf.ASIZE+a_inf.DSIZE+1-1]}};
93
93
  assign xram_inf.ena = 1'b1;
@@ -95,14 +95,14 @@ assign xram_inf.clka = a_inf.axi_aclk;
95
95
  assign xram_inf.rsta = ~a_inf.axi_aresetn;
96
96
 
97
97
  assign b_axis_inf.axis_tready = b_axis_inf.axis_tdata[ b_inf.ASIZE+b_inf.DSIZE+1-1] || (b_datac_rd_inf.ready && !b_axis_inf.axis_tdata[ b_inf.ASIZE+b_inf.DSIZE+1-1]);
98
- assign b_datac_rd_inf.data = {b_axis_inf.axis_tlast,b_axis_inf.axis_tdata[ b_inf.ASIZE+b_inf.DSIZE+1-1- 1: b_inf.ASIZE+b_inf.DSIZE+1-b_inf.ASIZE- 1]};
98
+ assign b_datac_rd_inf.data = {b_axis_inf.axis_tlast,b_axis_inf.axis_tdata[ ( b_inf.ASIZE+b_inf.DSIZE+1-1)-1: ( b_inf.ASIZE+b_inf.DSIZE+1-b_inf.ASIZE)-1]};
99
99
  assign b_datac_rd_inf.valid = b_axis_inf.axis_tvalid && !b_axis_inf.axis_tdata[ b_inf.ASIZE+b_inf.DSIZE+1-1];
100
100
 
101
101
  assign b_axis_rd_inf.axis_tvalid = b_datac_rd_rel_inf.valid;
102
102
  assign b_axis_rd_inf.axis_tdata = b_datac_rd_rel_inf.data[ b_inf.DSIZE-1:0];
103
103
  assign b_axis_rd_inf.axis_tlast = b_datac_rd_rel_inf.data[ b_inf.ASIZE+b_inf.DSIZE+1-1];
104
104
  assign b_datac_rd_rel_inf.ready = b_axis_rd_inf.axis_tready;
105
- assign xram_inf.addrb = b_axis_inf.axis_tdata[ b_inf.ASIZE+b_inf.DSIZE+1-1- 1: b_inf.ASIZE+b_inf.DSIZE+1-b_inf.ASIZE- 1];
105
+ assign xram_inf.addrb = b_axis_inf.axis_tdata[ ( b_inf.ASIZE+b_inf.DSIZE+1-1)-1: ( b_inf.ASIZE+b_inf.DSIZE+1-b_inf.ASIZE)-1];
106
106
  assign xram_inf.dib = b_axis_inf.axis_tdata[ b_inf.DSIZE-1:0];
107
107
  assign xram_inf.web = {xram_inf.MSIZE{b_axis_inf.axis_tdata[ b_inf.ASIZE+b_inf.DSIZE+1-1]}};
108
108
  assign xram_inf.enb = 1'b1;
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## raise TdlError.new("The module have be abandon\n Path:[#{__dir__}]\n Name:[#{__FILE__}]")
4
4
 
5
+ require_hdl 'axis_length_split_with_addr.sv'
6
+ require_hdl 'axi_stream_long_fifo.sv'
7
+ require_hdl 'axi4_wr_auxiliary_gen_without_resp.sv'
8
+ require_hdl 'axis_valve_with_pipe.sv'
9
+
5
10
  new_m = SdlModule.new(name:File.basename(__FILE__,".rb"),out_sv_path:__dir__)
6
11
 
7
12
  # Parameter :ADDR_STEP,1.0
@@ -56,7 +56,7 @@ logic stream_en;
56
56
  axi_stream_inf #(.DSIZE(axis_in.DSIZE),.USIZE(1)) split_out (.aclk(axis_in.aclk),.aresetn(axis_in.aresetn),.aclken(1'b1)) ;
57
57
  axi_stream_inf #(.DSIZE(axis_in.DSIZE),.USIZE(1)) long_fifo_axis_out (.aclk(axi_wr.axi_aclk),.aresetn(axi_wr.axi_aresetn),.aclken(1'b1)) ;
58
58
  axi_stream_inf #(.DSIZE(axi_wr.IDSIZE + axi_wr.ASIZE + axi_wr.LSIZE),.USIZE(1)) id_add_len_in (.aclk(axi_wr.axi_aclk),.aresetn(axi_wr.axi_aresetn),.aclken(1'b1)) ;
59
- axi_inf #(.DSIZE(axi_wr.DSIZE),.IDSIZE(axi_wr.IDSIZE),.ASIZE(axi_wr.ASIZE),.LSIZE(axi_wr.LSIZE),.MODE(axi_wr.MODE),.ADDR_STEP(axi_wr.ADDR_STEP)) axi_wr_vcs_cp_R442 (.axi_aclk(axi_wr.axi_aclk),.axi_aresetn(axi_wr.axi_aresetn)) ;
59
+ axi_inf #(.DSIZE(axi_wr.DSIZE),.IDSIZE(axi_wr.IDSIZE),.ASIZE(axi_wr.ASIZE),.LSIZE(axi_wr.LSIZE),.MODE(axi_wr.MODE),.ADDR_STEP(axi_wr.ADDR_STEP)) axi_wr_vcs_cp_R1264 (.axi_aclk(axi_wr.axi_aclk),.axi_aresetn(axi_wr.axi_aresetn)) ;
60
60
  axi_stream_inf #(.DSIZE(axis_in.DSIZE),.USIZE(1)) pipe_axis (.aclk(axi_wr.axi_aclk),.aresetn(axi_wr.axi_aresetn),.aclken(1'b1)) ;
61
61
  //==========================================================================
62
62
  //-------- instance --------------------------------------------------------
@@ -92,16 +92,16 @@ independent_clock_fifo #(
92
92
  /* output */.full (fifo_full )
93
93
  );
94
94
  axi4_wr_auxiliary_gen_without_resp axi4_wr_auxiliary_gen_without_resp_inst(
95
- /* output */.stream_en (stream_en ),
96
- /* axi_stream_inf.slaver */.id_add_len_in (id_add_len_in ),
97
- /* axi_inf.master_wr_aux_no_resp */.axi_wr_aux (axi_wr_vcs_cp_R442 )
95
+ /* output */.stream_en (stream_en ),
96
+ /* axi_stream_inf.slaver */.id_add_len_in (id_add_len_in ),
97
+ /* axi_inf.master_wr_aux_no_resp */.axi_wr_aux (axi_wr_vcs_cp_R1264 )
98
98
  );
99
99
  vcs_axi4_comptable #(
100
100
  .ORIGIN ("master_wr_aux_no_resp" ),
101
101
  .TO ("master_wr" )
102
- )vcs_axi4_comptable_axi_wr_aux_R1813_axi_wr_inst(
103
- /* input */.origin (axi_wr_vcs_cp_R442 ),
104
- /* output */.to (axi_wr )
102
+ )vcs_axi4_comptable_axi_wr_aux_R858_axi_wr_inst(
103
+ /* input */.origin (axi_wr_vcs_cp_R1264 ),
104
+ /* output */.to (axi_wr )
105
105
  );
106
106
  axis_valve_with_pipe #(
107
107
  .MODE ("BOTH" )
@@ -86,7 +86,7 @@ always_ff@(posedge clock,negedge rst_n) begin
86
86
  wait_last_inf.ready <= 1'b0;
87
87
  end
88
88
  else begin
89
- wait_last_inf.ready <= ( long_inf.axi_rvalid&long_inf.axi_rready& long_inf.axi_rlast);
89
+ wait_last_inf.ready <= ( ( long_inf.axi_rvalid&long_inf.axi_rready)&long_inf.axi_rlast);
90
90
  end
91
91
  end
92
92
 
@@ -31,7 +31,7 @@ logic one_long_stream;
31
31
  logic fifo_wr;
32
32
  logic [ IDSIZE+4-1:0] curr_id ;
33
33
  logic [LSIZE-1:0] curr_length ;
34
- logic [ data_in.DSIZE-IDSIZE- LSIZE-1:0] curr_addr ;
34
+ logic [ ( data_in.DSIZE-IDSIZE)-LSIZE-1:0] curr_addr ;
35
35
  logic [LSIZE-1:0] wr_length ;
36
36
  (* MARK_DEBUG="true" *)(* dont_touch="true" *)logic fifo_full;
37
37
  (* MARK_DEBUG="true" *)(* dont_touch="true" *)logic fifo_empty;
@@ -68,7 +68,7 @@ typedef enum {
68
68
  } SE_STATE_ps;
69
69
  SE_STATE_ps CSTATE_ps,NSTATE_ps;
70
70
  initial begin
71
- assert( data_in.DSIZE+4== data_out.DSIZE)else begin
71
+ assert( ( data_in.DSIZE+4)==data_out.DSIZE)else begin
72
72
  $error("data_in.DSIZE<%d> != data_out.DSIZE<%d>",data_in.DSIZE,data_out.DSIZE);
73
73
  $stop;
74
74
  end
@@ -0,0 +1,56 @@
1
+ /**********************************************
2
+ _______________________________________
3
+ ___________ Cook Darwin __________
4
+ _______________________________________
5
+ descript: base on planer
6
+ author : Cook.Darwin
7
+ Version: VERA.0.0
8
+ creaded:
9
+ madified:
10
+ ***********************************************/
11
+ `timescale 1ns/1ps
12
+ `include "define_macro.sv"
13
+ module axi_stream_latency #(
14
+ parameter LAT = 3
15
+ )(
16
+ input reset,
17
+ axi_stream_inf.slaver axis_in,
18
+ axi_stream_inf.master axis_out
19
+ );
20
+
21
+ data_inf_c #(.DSIZE(axis_in.DSIZE + 1 + axis_in.KSIZE + axis_in.USIZE)) data_slaver (.clock(axis_in.aclk), .rst_n(axis_in.aresetn) );
22
+ data_inf_c #(.DSIZE(axis_in.DSIZE + 1 + axis_in.KSIZE + axis_in.USIZE + 1)) data_master (.clock(axis_in.aclk), .rst_n(axis_in.aresetn) );
23
+
24
+
25
+ data_inf_c_planer_A1 #(
26
+ .LAT (LAT ),
27
+ .DSIZE (1 ),
28
+ .HEAD ("ON" )
29
+ )data_inf_c_planer_A1_inst(
30
+ /* input */ .reset (reset ),
31
+ /* input [DSIZE-1:0] */ .pack_data (1'b0 ),
32
+ /* data_inf_c.slaver */ .slaver (data_slaver ),
33
+ /* data_inf_c.master */ .master (data_master )///HEAD=="ON" : {pack_data,slaver.data} or /HEAD=="OFF" : {slaver.data,pack_data}
34
+ );
35
+
36
+ assign data_slaver.data = {axis_in.axis_tuser, axis_in.axis_tkeep, axis_in.axis_tlast, axis_in.axis_tdata};
37
+ assign data_slaver.valid = axis_in.axis_tvalid;
38
+ assign axis_in.axis_tready = data_slaver.ready;
39
+
40
+ // axis_to_data_inf #(
41
+ // .CONTAIN_LAST ("ON")
42
+ // )axis_to_data_inf_inst(
43
+ // /* axi_stream_inf.slaver */ .axis_in (axis_in ),
44
+ // /* data_inf_c.master */ .data_out_inf (data_slaver )
45
+ // );
46
+
47
+ // data_c_to_axis_full data_c_to_axis_full_inst(
48
+ // /* data_inf_c.slaver */ .data_in_inf (data_master ),
49
+ // /* axi_stream_inf.master */ .axis_out (axis_out )
50
+ // );
51
+
52
+ assign {axis_out.axis_tuser, axis_out.axis_tkeep, axis_out.axis_tlast, axis_out.axis_tdata} = data_master.data[data_master.DSIZE-2:0];
53
+ assign axis_out.axis_tvalid = data_master.valid;
54
+ assign data_master.ready = axis_out.axis_tready;
55
+
56
+ endmodule
@@ -55,22 +55,22 @@ axis_direct axis_direct_end_inf_inst0 (
55
55
  );
56
56
  //-------- CLOCKs Total 3 ----------------------
57
57
  //--->> CheckClock <<----------------
58
- logic cc_done_7,cc_same_7;
59
- integer cc_afreq_7,cc_bfreq_7;
60
- ClockSameDomain CheckPClock_inst_7(
58
+ logic cc_done_8,cc_same_8;
59
+ integer cc_afreq_8,cc_bfreq_8;
60
+ ClockSameDomain CheckPClock_inst_8(
61
61
  /* input */ .aclk (origin_inf.aclk ),
62
62
  /* input */ .bclk (first_inf.aclk ),
63
- /* output logic */ .done (cc_done_7),
64
- /* output logic */ .same (cc_same_7),
65
- /* output integer */ .aFreqK (cc_afreq_7),
66
- /* output integer */ .bFreqK (cc_bfreq_7)
63
+ /* output logic */ .done (cc_done_8),
64
+ /* output logic */ .same (cc_same_8),
65
+ /* output integer */ .aFreqK (cc_afreq_8),
66
+ /* output integer */ .bFreqK (cc_bfreq_8)
67
67
  );
68
68
 
69
69
  initial begin
70
- wait(cc_done_7);
71
- assert(cc_same_7)
70
+ wait(cc_done_8);
71
+ assert(cc_same_8)
72
72
  else begin
73
- $error("--- Error : `axi_stream_split_channel` clock is not same, origin_inf.aclk< %0f M> != first_inf.aclk<%0f M>",1000000.0/cc_afreq_7, 1000000.0/cc_bfreq_7);
73
+ $error("--- Error : `axi_stream_split_channel` clock is not same, origin_inf.aclk< %0f M> != first_inf.aclk<%0f M>",1000000.0/cc_afreq_8, 1000000.0/cc_bfreq_8);
74
74
  repeat(10)begin
75
75
  @(posedge origin_inf.aclk);
76
76
  end
@@ -80,22 +80,22 @@ end
80
80
  //---<< CheckClock >>----------------
81
81
 
82
82
  //--->> CheckClock <<----------------
83
- logic cc_done_8,cc_same_8;
84
- integer cc_afreq_8,cc_bfreq_8;
85
- ClockSameDomain CheckPClock_inst_8(
83
+ logic cc_done_9,cc_same_9;
84
+ integer cc_afreq_9,cc_bfreq_9;
85
+ ClockSameDomain CheckPClock_inst_9(
86
86
  /* input */ .aclk (origin_inf.aclk ),
87
87
  /* input */ .bclk (end_inf.aclk ),
88
- /* output logic */ .done (cc_done_8),
89
- /* output logic */ .same (cc_same_8),
90
- /* output integer */ .aFreqK (cc_afreq_8),
91
- /* output integer */ .bFreqK (cc_bfreq_8)
88
+ /* output logic */ .done (cc_done_9),
89
+ /* output logic */ .same (cc_same_9),
90
+ /* output integer */ .aFreqK (cc_afreq_9),
91
+ /* output integer */ .bFreqK (cc_bfreq_9)
92
92
  );
93
93
 
94
94
  initial begin
95
- wait(cc_done_8);
96
- assert(cc_same_8)
95
+ wait(cc_done_9);
96
+ assert(cc_same_9)
97
97
  else begin
98
- $error("--- Error : `axi_stream_split_channel` clock is not same, origin_inf.aclk< %0f M> != end_inf.aclk<%0f M>",1000000.0/cc_afreq_8, 1000000.0/cc_bfreq_8);
98
+ $error("--- Error : `axi_stream_split_channel` clock is not same, origin_inf.aclk< %0f M> != end_inf.aclk<%0f M>",1000000.0/cc_afreq_9, 1000000.0/cc_bfreq_9);
99
99
  repeat(10)begin
100
100
  @(posedge origin_inf.aclk);
101
101
  end
@@ -1,5 +1,7 @@
1
1
  ## VERC 非整数型剪切,使用 right shift
2
2
  require_hdl 'axis_connect_pipe_right_shift_verb.sv'
3
+ # require_hdl 'axi_stream_latency.sv'
4
+ require_sdl 'axis_pipe_sync_seam.rb'
3
5
 
4
6
  TdlBuild.axis_head_cut_verc(__dir__) do
5
7
  parameter.BYTE_BITS 8
@@ -16,30 +18,61 @@ TdlBuild.axis_head_cut_verc(__dir__) do
16
18
 
17
19
  origin_inf.clock_reset_taps('clock', 'rst_n')
18
20
 
19
- axis_slaver_pipe_A1.axis_slaver_pipe_A1_inst do |h| #(
20
- h.param.DEPTH 3
21
- h.port.axis.slaver.axis_in origin_inf
22
- h.port.axis.master.axis_out origin_inf.copy(name: 'origin_inf_post')
23
- end
21
+ # axis_slaver_pipe_A1.axis_slaver_pipe_A1_inst do |h| #(
22
+ # h.param.DEPTH 3
23
+ # h.port.axis.slaver.axis_in origin_inf
24
+ # h.port.axis.master.axis_out origin_inf.copy(name: 'origin_inf_post')
25
+ # end
26
+
27
+ # axi_stream_latency.axi_stream_latency_inst do |h| #(
28
+ # h.parameter.LAT 3
29
+ # h.input.reset 1.b0
30
+ # h.port.axis.slaver.axis_in origin_inf
31
+ # h.port.axis.master.axis_out origin_inf.copy(name: 'origin_inf_post')
32
+ # end
33
+
34
+ axis_pipe_sync_seam.axis_pipe_sync_seam_inst do |h|
35
+ h.parameter.LAT 3
36
+ h.parameter.DSIZE 10+4+4
37
+ ## as like: hdl```
38
+ ## assign in_datas[0] = in_inf.data + 1;
39
+ ## assign in_datas[1] = out_datas[0]+1;```
40
+ h.input[h.param.LAT,h.param.DSIZE].in_datas logic[3,18].origin_sync_info
41
+ h.output[h.param.LAT,h.param.DSIZE].out_datas logic[3,18].origin_sync_info_out
42
+ h.port.axis.slaver.in_inf origin_inf
43
+ h.port.axis.master.out_inf origin_inf.copy(name: 'origin_inf_post')
44
+ end
24
45
 
25
46
  ## 解析编码
47
+ ## IN_DATA<0> IN_DATA<1> IN_DATA<2>
48
+ ###[11:8] bytes_x_tmp bytes_x_sub_nDx route_addr_P
49
+ ###[7 :4] bytes bytes_x_tmp_Q ???
50
+ ###[3 :0] bytes bytes_Q ??
51
+
52
+ ## OUT_DATA<0> OUT_DATA<1> IN_DATA<1>
53
+ ###[11:8] bytes_x_tmp_Q bytes_x_sub_nDx_Q route_addr
54
+ ###[7 :4] bytes_Q bytes_x_tmp_QQ ???
55
+ ###[3 :0] bytes_Q bytes_QQ ??
56
+
57
+ ## IN_DATA<0> IN_DATA<1> OUT<0> IN_DATA<2> OUT<1> OUT<2>
58
+ ## |- bytes ------- | bytes_Q ---------- | bytes_QQ
59
+ ## |> {bytes_x} -- | bytes_x ---------- | bytes_x_Q
60
+ ## |> {bytes_x_sub_nDx} | bytes_x_sub_nDx
61
+ ## |> {route_addr}-------- | route_addr
62
+
63
+ logic[10] - 'bytes_Q'
64
+ logic[10] - 'bytes_QQ'
26
65
  logic[4] - 'bytes_x'
27
66
  logic[4] - 'bytes_x_Q'
28
67
  logic[4] - 'bytes_x_tmp'
29
68
  logic[4] - 'bytes_x_sub_nDx'
69
+ logic[4] - 'bytes_x_sub_nDx_tmp'
30
70
  logic[2] - 'route_addr'
71
+ logic[2] - 'route_addr_tmp'
72
+ # logic - 'route_addr_vld'
31
73
 
32
- logic[4] - 'bytes_y'
33
- logic[10] - 'tmp_loop'
34
-
35
- # genvar - 'cc'
36
74
 
37
75
  always_comb() do
38
- # FOREACH(tmp_loop) do |ii|
39
- # IF bytes < "#{param.DX}*(10-#{ii})".to_nq do
40
- # bytes_x_tmp <= (10-1-ii)
41
- # end
42
- # end
43
76
  bytes_x_tmp <= 0.A
44
77
  FOR(start: 0,stop: 10) do |ii|
45
78
  IF bytes < "#{param.DX}*(10-#{ii})".to_nq do
@@ -48,39 +81,62 @@ TdlBuild.axis_head_cut_verc(__dir__) do
48
81
  end
49
82
  end
50
83
 
51
- always_ff(posedge.clock ,negedge.rst_n) do
52
- IF ~rst_n do
53
- bytes_x <= 0.A
54
- bytes_x_Q <= 0.A
55
- bytes_x_sub_nDx <= 0.A
56
- end
57
- ELSE do
58
- bytes_x <= bytes_x_tmp
59
- bytes_x_Q <= bytes_x
60
- bytes_x_sub_nDx <= bytes - bytes_x*param.DX
61
- end
84
+ Assign do
85
+ ## --------IN<0>--
86
+ origin_sync_info[0] <= logic_bind_(bytes_x_tmp, bytes_x_tmp , bytes)
87
+ ## ===============
88
+ ## --------OUT<0>
89
+ logic_bind_(bytes_x, bytes_Q) <= logic_bind_(origin_sync_info_out[0][13,10], origin_sync_info_out[0][9,0])
90
+ ## ==============
91
+ ## --------IN<1>
92
+ bytes_x_sub_nDx_tmp <= bytes_Q - bytes_x*param.DX
93
+ origin_sync_info[1] <= logic_bind_(bytes_x_sub_nDx_tmp, bytes_x, bytes_Q)
94
+ ## ==============
95
+ ## --------OUT<1>
96
+ logic_bind_(bytes_x_sub_nDx, bytes_x_Q,bytes_QQ) <= logic_bind_(origin_sync_info_out[1][17,14],origin_sync_info_out[1][13,10], origin_sync_info_out[1][9,0])
97
+ ## ==============
98
+ ## --------IN<2>
99
+ origin_sync_info[2] <= logic_bind_(10.d0, route_addr_tmp)
100
+ ## ==============
101
+ ## --------OUT<2>
102
+ route_addr <= origin_sync_info_out[2][1,0]
103
+ ## ==============
62
104
  end
63
-
64
- always_ff(posedge.clock, negedge.rst_n) do
65
- IF ~rst_n do
66
- route_addr <= 0.A
105
+ always_comb do
106
+ IF bytes_QQ == 0.A do
107
+ route_addr_tmp <= 2.d0
67
108
  end
68
- ELSE do
69
- IF bytes == 0.A do
70
- route_addr <= 2.d0
71
- end
72
- ELSIF bytes_x == 0.A do
73
- route_addr <= 2.d2
74
- end
75
- ELSIF bytes_x_sub_nDx == 0.A do
76
- route_addr <= 2.d1
77
- end
78
- ELSE do
79
- route_addr <= 2.d1
80
- end
109
+ ELSIF bytes_x_Q == 0.A do
110
+ route_addr_tmp <= 2.d2
111
+ end
112
+ ELSIF bytes_x_sub_nDx == 0.A do
113
+ route_addr_tmp <= 2.d1
81
114
  end
115
+ ELSE do
116
+ route_addr_tmp <= 2.d1
117
+ end
82
118
  end
83
119
 
120
+ # always_ff(posedge.clock ,negedge.rst_n) do
121
+ # IF ~rst_n do
122
+ # bytes_x <= 0.A
123
+ # bytes_x_Q <= 0.A
124
+ # bytes_x_sub_nDx <= 0.A
125
+ # bytes_x_vld <= 1.b0
126
+ # bytes_Q <= 0.A
127
+ # bytes_QQ <= 0.A
128
+ # end
129
+ # ELSE do
130
+ # bytes_Q <= bytes
131
+ # bytes_QQ <= bytes_Q
132
+
133
+ # bytes_x <= bytes_x_tmp
134
+ # bytes_x_Q <= bytes_x
135
+
136
+ # bytes_x_sub_nDx <= bytes_Q - bytes_x*param.DX
137
+ # bytes_x_vld <= origin_inf.vld_rdy
138
+ # end
139
+ # end
84
140
 
85
141
  axi_stream_interconnect_S2M.axi_stream_interconnect_S2M_inst do |h| #(
86
142
  h.param.NUM 3
@@ -11,7 +11,8 @@ madified:
11
11
  `timescale 1ns/1ps
12
12
 
13
13
  module axis_head_cut_verc #(
14
- parameter BYTE_BITS = 8
14
+ parameter BYTE_BITS = 8,
15
+ parameter DX = origin_inf.DSIZE/BYTE_BITS
15
16
  )(
16
17
  input [9:0] bytes,
17
18
  axi_stream_inf.slaver origin_inf,
@@ -20,16 +21,19 @@ module axis_head_cut_verc #(
20
21
 
21
22
  //==========================================================================
22
23
  //-------- define ----------------------------------------------------------
23
- localparam DX = origin_inf.DSIZE/BYTE_BITS;
24
24
  logic clock;
25
25
  logic rst_n;
26
+ logic [18-1:0] origin_sync_info[3-1:0] ;
27
+ logic [18-1:0] origin_sync_info_out[3-1:0] ;
28
+ logic [10-1:0] bytes_Q ;
29
+ logic [10-1:0] bytes_QQ ;
26
30
  logic [4-1:0] bytes_x ;
27
31
  logic [4-1:0] bytes_x_Q ;
28
32
  logic [4-1:0] bytes_x_tmp ;
29
33
  logic [4-1:0] bytes_x_sub_nDx ;
34
+ logic [4-1:0] bytes_x_sub_nDx_tmp ;
30
35
  logic [2-1:0] route_addr ;
31
- logic [4-1:0] bytes_y ;
32
- logic [10-1:0] tmp_loop ;
36
+ logic [2-1:0] route_addr_tmp ;
33
37
  logic fifo_wr_en;
34
38
  logic [4-1:0] int_cut_len ;
35
39
  logic [4-1:0] shift_sel_pre ;
@@ -41,14 +45,17 @@ axi_stream_inf #(.DSIZE(origin_inf.DSIZE),.USIZE(1)) origin_inf_ss (.aclk(origin
41
45
  axi_stream_inf #(.DSIZE(origin_inf.DSIZE),.USIZE(1)) origin_inf_cut_mix (.aclk(origin_inf.aclk),.aresetn(origin_inf.aresetn),.aclken(1'b1)) ;
42
46
  axi_stream_inf #(.DSIZE(origin_inf.DSIZE),.USIZE(1)) origin_inf_ss_E0 (.aclk(origin_inf.aclk),.aresetn(origin_inf.aresetn),.aclken(1'b1)) ;
43
47
  axi_stream_inf #(.DSIZE(origin_inf.DSIZE),.USIZE(1)) origin_inf_ss_E0_CH (.aclk(origin_inf.aclk),.aresetn(origin_inf.aresetn),.aclken(1'b1)) ;
44
- axi_stream_inf #(.DSIZE(out_inf.DSIZE),.USIZE(1)) out_inf_branchR587 (.aclk(out_inf.aclk),.aresetn(out_inf.aresetn),.aclken(1'b1)) ;
48
+ axi_stream_inf #(.DSIZE(out_inf.DSIZE),.USIZE(1)) out_inf_branchR671 (.aclk(out_inf.aclk),.aresetn(out_inf.aresetn),.aclken(1'b1)) ;
45
49
  //==========================================================================
46
50
  //-------- instance --------------------------------------------------------
47
- axis_slaver_pipe_A1 #(
48
- .DEPTH (3 )
49
- )axis_slaver_pipe_A1_inst(
50
- /* axi_stream_inf.slaver */.axis_in (origin_inf ),
51
- /* axi_stream_inf.master */.axis_out (origin_inf_post )
51
+ axis_pipe_sync_seam #(
52
+ .LAT (3 ),
53
+ .DSIZE (18 )
54
+ )axis_pipe_sync_seam_inst(
55
+ /* input */.in_datas (origin_sync_info ),
56
+ /* output */.out_datas (origin_sync_info_out ),
57
+ /* axi_stream_inf.slaver */.in_inf (origin_inf ),
58
+ /* axi_stream_inf.master */.out_inf (origin_inf_post )
52
59
  );
53
60
  axi_stream_interconnect_S2M #(
54
61
  .NUM (3 )
@@ -115,7 +122,7 @@ axis_connect_pipe_right_shift_verb #(
115
122
  axis_head_cut_verb last_cut_inst(
116
123
  /* input */.length (16'd1 ),
117
124
  /* axi_stream_inf.slaver */.axis_in (origin_inf_ss_E0_CH ),
118
- /* axi_stream_inf.master */.axis_out (out_inf_branchR587 )
125
+ /* axi_stream_inf.master */.axis_out (out_inf_branchR671 )
119
126
  );
120
127
  //==========================================================================
121
128
  //-------- expression ------------------------------------------------------
@@ -129,7 +136,7 @@ axis_direct axis_direct_out_inf_inst0 (
129
136
  );
130
137
 
131
138
  axis_direct axis_direct_out_inf_inst1 (
132
- /* axi_stream_inf.slaver*/ .slaver (out_inf_branchR587),
139
+ /* axi_stream_inf.slaver*/ .slaver (out_inf_branchR671),
133
140
  /* axi_stream_inf.master*/ .master (sub_out_inf[1])
134
141
  );
135
142
 
@@ -160,41 +167,31 @@ always_comb begin
160
167
  bytes_x_tmp = '0;
161
168
  for(integer gvar_cc_1=0;gvar_cc_1<10;gvar_cc_1=gvar_cc_1+1)begin
162
169
  if( bytes<DX*(10-gvar_cc_1))begin
163
- bytes_x_tmp = ( 10-1- gvar_cc_1);
170
+ bytes_x_tmp = ( ( 10-1)-gvar_cc_1);
164
171
  end
165
172
  end
166
173
  end
167
174
 
168
- always_ff@(posedge clock,negedge rst_n) begin
169
- if(~rst_n)begin
170
- bytes_x <= '0;
171
- bytes_x_Q <= '0;
172
- bytes_x_sub_nDx <= '0;
175
+ assign origin_sync_info[0] = {bytes_x_tmp,bytes_x_tmp,bytes};
176
+ assign {bytes_x,bytes_Q} = {origin_sync_info_out[0][13:10],origin_sync_info_out[0][9:0]};
177
+ assign bytes_x_sub_nDx_tmp = ( bytes_Q-( bytes_x*DX));
178
+ assign origin_sync_info[1] = {bytes_x_sub_nDx_tmp,bytes_x,bytes_Q};
179
+ assign {bytes_x_sub_nDx,bytes_x_Q,bytes_QQ} = {origin_sync_info_out[1][17:14],origin_sync_info_out[1][13:10],origin_sync_info_out[1][9:0]};
180
+ assign origin_sync_info[2] = {10'd0,route_addr_tmp};
181
+ assign route_addr = origin_sync_info_out[2][1:0];
182
+
183
+ always_comb begin
184
+ if( bytes_QQ=='0)begin
185
+ route_addr_tmp = 2'd0;
173
186
  end
174
- else begin
175
- bytes_x <= bytes_x_tmp;
176
- bytes_x_Q <= bytes_x;
177
- bytes_x_sub_nDx <= ( bytes-( bytes_x*DX));
187
+ else if( bytes_x_Q=='0)begin
188
+ route_addr_tmp = 2'd2;
178
189
  end
179
- end
180
-
181
- always_ff@(posedge clock,negedge rst_n) begin
182
- if(~rst_n)begin
183
- route_addr <= '0;
190
+ else if( bytes_x_sub_nDx=='0)begin
191
+ route_addr_tmp = 2'd1;
184
192
  end
185
193
  else begin
186
- if( bytes=='0)begin
187
- route_addr <= 2'd0;
188
- end
189
- else if( bytes_x=='0)begin
190
- route_addr <= 2'd2;
191
- end
192
- else if( bytes_x_sub_nDx=='0)begin
193
- route_addr <= 2'd1;
194
- end
195
- else begin
196
- route_addr <= 2'd1;
197
- end
194
+ route_addr_tmp = 2'd1;
198
195
  end
199
196
  end
200
197