axi_tdl 0.0.4 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +1 -16
- data/README.md +7 -1
- data/axi_tdl.gemspec +2 -2
- data/lib/axi/AXI4/axi4_dpram_cache.rb +1 -0
- data/lib/axi/AXI4/axi4_dpram_cache.sv +4 -4
- data/lib/axi/AXI4/axis_to_axi4_wr.rb +5 -0
- data/lib/axi/AXI4/axis_to_axi4_wr.sv +7 -7
- data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.sv +1 -1
- data/lib/axi/AXI4/packet_partition/data_inf_partition.sv +2 -2
- data/lib/axi/AXI_stream/axi_stream_latency.sv +56 -0
- data/lib/axi/AXI_stream/axi_stream_split_channel.sv +20 -20
- data/lib/axi/AXI_stream/axis_head_cut_verc.rb +99 -43
- data/lib/axi/AXI_stream/axis_head_cut_verc.sv +36 -39
- data/lib/axi/AXI_stream/axis_insert_copy.sv +1 -1
- data/lib/axi/AXI_stream/axis_length_split_with_user.sv +87 -0
- data/lib/axi/AXI_stream/axis_pipe_sync_seam.rb +41 -0
- data/lib/axi/AXI_stream/axis_pipe_sync_seam.sv +48 -0
- data/lib/axi/AXI_stream/axis_rom_contect_sim.rb +1 -0
- data/lib/axi/AXI_stream/packet_fifo/axi_stream_packet_long_fifo.sv +37 -16
- data/lib/axi/AXI_stream/parse_big_field_table_A2.sv +3 -2
- data/lib/axi/data_interface/data_inf_c/data_c_pipe_force_vld_bind_data.sv +1 -1
- data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync.sv +70 -0
- data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.rb +49 -0
- data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +84 -0
- data/lib/axi_tdl.rb +20 -0
- data/lib/axi_tdl/version.rb +1 -1
- data/lib/tdl/SDL/axistream/axi_stream_packet_long_fifo_sdl.rb +1 -0
- data/lib/tdl/SDL/path_lib.rb +1 -1
- data/lib/tdl/SDL/vcs_axi4_comptable.rb +9 -0
- data/lib/tdl/SDL/vcs_axis_comptable.rb +17 -0
- data/lib/tdl/SDL/vcs_data_c_comptable.rb +9 -0
- data/lib/tdl/class_hdl/hdl_redefine_opertor.rb +15 -3
- data/lib/tdl/examples/11_test_unit/tb_exp_test_unit.sv +2 -0
- data/lib/tdl/examples/2_hdl_class/module_def.rb +2 -1
- data/lib/tdl/examples/2_hdl_class/test_inst_sugar.rb +3 -1
- data/lib/tdl/examples/2_hdl_class/tmp/always_ff_test.sv +1 -1
- data/lib/tdl/examples/2_hdl_class/tmp/test_function.sv +2 -2
- data/lib/tdl/examples/8_top_module/tb_test_top.sv +0 -1
- data/lib/tdl/examples/9_itegration/tb_test_tttop.sv +0 -1
- data/lib/tdl/exlib/test_point.rb +8 -2
- data/lib/tdl/sdlmodule/sdlmodule.rb +64 -0
- data/lib/tdl/sdlmodule/sdlmodule_draw.rb +13 -0
- data/lib/tdl/sdlmodule/top_module.rb +1 -0
- data/lib/tdl/tdl.rb +14 -2
- data/lib/tdl/tdlerror/tdlerror.rb +1 -0
- metadata +114 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb3c990c7f63ad8275055e50f7fa4bc856bfb6301246796eba5ee6dcf3236b4
|
4
|
+
data.tar.gz: fd6e9c7f4ae21f787c00302f8d180df111416d1ea46bae5bf7c54ddc9e8ed8e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1018742a13f565eca63e54753ddd816d656bb2ef299e575adbc1a33ef0fc161088a423e209d194505cc875061ce01741c7947ae4e0c31285a7887d865494b381
|
7
|
+
data.tar.gz: 6de023c61b43cdbb04a2c86233a91285a156d4daf94647f8057a40c45114b287502b9a6167e3eea916eec4677821e3e0e61927385f02757f156dff9a4a364077
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,32 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
axi_tdl (0.0.
|
4
|
+
axi_tdl (0.0.9)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
coderay (1.1.3)
|
10
|
-
diff-lcs (1.4.4)
|
11
10
|
method_source (1.0.0)
|
12
11
|
minitest (5.14.3)
|
13
12
|
pry (0.14.0)
|
14
13
|
coderay (~> 1.1)
|
15
14
|
method_source (~> 1.0)
|
16
15
|
rake (10.5.0)
|
17
|
-
rspec (3.10.0)
|
18
|
-
rspec-core (~> 3.10.0)
|
19
|
-
rspec-expectations (~> 3.10.0)
|
20
|
-
rspec-mocks (~> 3.10.0)
|
21
|
-
rspec-core (3.10.1)
|
22
|
-
rspec-support (~> 3.10.0)
|
23
|
-
rspec-expectations (3.10.1)
|
24
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
-
rspec-support (~> 3.10.0)
|
26
|
-
rspec-mocks (3.10.2)
|
27
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
-
rspec-support (~> 3.10.0)
|
29
|
-
rspec-support (3.10.2)
|
30
16
|
|
31
17
|
PLATFORMS
|
32
18
|
ruby
|
@@ -37,7 +23,6 @@ DEPENDENCIES
|
|
37
23
|
minitest
|
38
24
|
pry
|
39
25
|
rake (~> 10.0)
|
40
|
-
rspec
|
41
26
|
|
42
27
|
BUNDLED WITH
|
43
28
|
1.17.3
|
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Axi
|
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.
|
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
|
+
|
4
|
+
  axi hdl path
|
5
|
+
```ruby
|
6
|
+
require 'axi_tdl'
|
7
|
+
AxiTdl::AXI_PATH
|
8
|
+
```
|
3
9
|
# Other
|
4
10
|
  It contain a simple interface that only define three signals, `valid`, `ready`, and `data`. I think it is useful for design.
|
5
11
|
|
data/axi_tdl.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.license = "LGPL-2.1"
|
17
17
|
spec.files = Dir['lib/**/*']
|
18
18
|
spec.require_paths = ["lib"]
|
19
|
-
|
19
|
+
spec.required_ruby_version = '>= 2.5.0'
|
20
20
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
21
21
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
22
22
|
if spec.respond_to?(:metadata)
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
|
38
38
|
spec.add_development_dependency "bundler", "~> 1.16"
|
39
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
40
|
-
spec.add_development_dependency "rspec"
|
40
|
+
# spec.add_development_dependency "rspec"
|
41
41
|
spec.add_development_dependency "pry"
|
42
42
|
spec.add_development_dependency "minitest"
|
43
43
|
end
|
@@ -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-
|
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-
|
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-
|
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-
|
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))
|
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 (
|
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
|
-
)
|
103
|
-
/* input */.origin (
|
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&
|
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-
|
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==
|
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
|
59
|
-
integer
|
60
|
-
ClockSameDomain
|
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 (
|
64
|
-
/* output logic */ .same (
|
65
|
-
/* output integer */ .aFreqK (
|
66
|
-
/* output integer */ .bFreqK (
|
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(
|
71
|
-
assert(
|
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/
|
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
|
84
|
-
integer
|
85
|
-
ClockSameDomain
|
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 (
|
89
|
-
/* output logic */ .same (
|
90
|
-
/* output integer */ .aFreqK (
|
91
|
-
/* output integer */ .bFreqK (
|
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(
|
96
|
-
assert(
|
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/
|
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
|
@@ -7,7 +9,7 @@ TdlBuild.axis_head_cut_verc(__dir__) do
|
|
7
9
|
port.axis.slaver - 'origin_inf'
|
8
10
|
port.axis.master - 'out_inf'
|
9
11
|
|
10
|
-
|
12
|
+
parameter.DX (origin_inf.DSIZE / param.BYTE_BITS)
|
11
13
|
|
12
14
|
Initial do
|
13
15
|
assert(param.DX < 17, "param.DX<%0d> !< 17",param.DX)
|
@@ -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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
-
|
65
|
-
|
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
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|