axi_tdl 0.2.0 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gem-push.yml +46 -28
  3. data/.github/workflows/ruby.yml +1 -1
  4. data/.gitignore +2 -1
  5. data/.travis.yml +1 -0
  6. data/axi_tdl.gemspec +1 -1
  7. data/lib/axi/AXI4/axi4_long_to_axi4_wide_B1.sv +5 -3
  8. data/lib/axi/AXI4/interconnect/axi4_mix_interconnect_M2S.sv +4 -2
  9. data/lib/axi/AXI4/interconnect/axi4_rd_mix_interconnect_M2S_A2.sv +4 -2
  10. data/lib/axi/AXI4/long_axis_to_axi4_wr.rb +1 -0
  11. data/lib/axi/AXI4/odata_pool_axi4_A4.sv +173 -0
  12. data/lib/axi/AXI4/packet_fifo/axi4_packet_fifo_B1.sv +66 -0
  13. data/lib/axi/AXI4/packet_fifo/axi4_rd_packet_fifo_A1.sv +260 -0
  14. data/lib/axi/AXI4/packet_fifo/axi4_wr_packet_fifo_A1.sv +192 -0
  15. data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.rb +4 -2
  16. data/lib/axi/AXI4/wide_axis_to_axi4_wr.sv +1 -1
  17. data/lib/axi/AXI_stream/axi_stream_split_channel.sv +21 -21
  18. data/lib/axi/AXI_stream/axi_streams_combin.sv +2 -1
  19. data/lib/axi/AXI_stream/axi_streams_combin_A1.sv +2 -1
  20. data/lib/axi/AXI_stream/axi_streams_scaler.sv +2 -1
  21. data/lib/axi/AXI_stream/axi_streams_scaler_A1.sv +2 -1
  22. data/lib/axi/AXI_stream/axis_combin_with_fifo.sv +2 -1
  23. data/lib/axi/AXI_stream/axis_head_cut_verc.rb +2 -0
  24. data/lib/axi/AXI_stream/gen_big_field_table.sv +3 -2
  25. data/lib/axi/AXI_stream/gen_origin_axis_A3.sv +163 -0
  26. data/lib/axi/AXI_stream/packet_fifo/axi_stream_packet_fifo_B1F.sv +129 -0
  27. data/lib/axi/AXI_stream/parse_big_field_table_main.sv +101 -0
  28. data/lib/axi/AXI_stream/parse_big_field_table_mirror.sv +94 -0
  29. data/lib/axi/axi4_to_xilinx_ddr_native/axi4_to_native_for_ddr_ip_C2.sv +75 -0
  30. data/lib/axi/axi4_to_xilinx_ddr_native/ddr_native_fifo_A2.sv +206 -0
  31. data/lib/axi/axi4_to_xilinx_ddr_native/ddr_native_fifo_B1.sv +297 -0
  32. data/lib/axi/axi4_to_xilinx_ddr_native/model_ddr_ip_app.sv +2 -2
  33. data/lib/axi/common/common_ram_wrapper.sv +1 -1
  34. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +11 -11
  35. data/lib/axi/data_interface/data_inf_c/data_c_scaler.sv +2 -1
  36. data/lib/axi/data_interface/data_inf_c/data_c_scaler_A1.sv +2 -1
  37. data/lib/axi/data_interface/data_streams_combin.sv +2 -1
  38. data/lib/axi/data_interface/data_streams_combin_A1.sv +2 -1
  39. data/lib/axi/data_interface/data_streams_scaler.sv +2 -1
  40. data/lib/axi_tdl/version.rb +1 -1
  41. data/lib/tdl/axi4/axi4_interconnect_verb.rb +5 -1
  42. data/lib/tdl/examples/2_hdl_class/tmp/test_module_var.sv +2 -2
  43. data/lib/tdl/examples/2_hdl_class/tmp/test_vcs_string.sv +1 -1
  44. data/lib/tdl/examples/8_top_module/test_top.sv +7 -26
  45. data/lib/tdl/examples/8_top_module/test_top_sim.sv +26 -7
  46. data/lib/tdl/examples/9_itegration/test_tttop.sv +7 -38
  47. data/lib/tdl/examples/9_itegration/test_tttop_sim.sv +38 -7
  48. data/lib/tdl/rebuild_ele/ele_base.rb +14 -0
  49. metadata +14 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07d14bdc63e601755761b703ae0203852d824e1ffbb0cff1cd61e0c427325401
4
- data.tar.gz: 94c7af9a7d499b545956f3f4363eb622aba5d78c67be914958867381764e43d6
3
+ metadata.gz: cbd04437f9a54f453a70249ea3800e0ad83b7afca7b2eb8aa4e968160a44b714
4
+ data.tar.gz: 4e0e182673271971834246838aa7f2d2735bf6c16ec8d02bf6cecacc63ef9f9d
5
5
  SHA512:
6
- metadata.gz: ceee62403d3d7c232713c554600bc774edea66c5aeb059471ea2a1f3ce6f8a5e96826b5204d8ec3e5e825b192648573ac2f4b1c8aee6358e104c714fa2f5a97e
7
- data.tar.gz: aa71d8cf174190ee50e8b2347509160b8890b963dbba84e25e2133dc90e7d25608b192dcb6d72ff22e799e714b672c665c24fdad6df7fb8bbc7c8f27e8aa70bf
6
+ metadata.gz: 756a91a926f7933d0b9f282bc10effc50f7505026b31b15ae4af55e0229bd515687fe30ba35b4d5593ba313655e46643e29089292456079475c7ac6baa9ea562
7
+ data.tar.gz: 5100e94f2d061d83cf6f0caae29401bfaefefa15bb5f911d6fbf9b84c5aba9bcb891bee496761b76c9e6b1627a57917d7a9e0ac60e4c549699ef475894c7dd3a
@@ -1,6 +1,18 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
1
10
  name: Ruby Gem
2
11
 
3
12
  on:
13
+ # Manually publish
14
+ workflow_dispatch:
15
+ # Alternatively, publish whenever changes are merged to the `main` branch.
4
16
  push:
5
17
  branches: [ main ]
6
18
  pull_request:
@@ -10,35 +22,41 @@ jobs:
10
22
  build:
11
23
  name: Build + Publish
12
24
  runs-on: ubuntu-latest
25
+ permissions:
26
+ packages: write
27
+ contents: read
13
28
 
14
29
  steps:
15
- - uses: actions/checkout@v2
16
- - name: Set up Ruby 2.6
17
- uses: actions/setup-ruby@v1
18
- with:
19
- ruby-version: 2.6.x
20
-
21
- - name: Publish to GPR
22
- run: |
23
- mkdir -p $HOME/.gem
24
- touch $HOME/.gem/credentials
25
- chmod 0600 $HOME/.gem/credentials
26
- printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
27
- gem build *.gemspec
28
- gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
29
- env:
30
- GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
31
- OWNER: ${{ github.repository_owner }}
32
-
33
- - name: Publish to RubyGems
34
- run: |
35
- mkdir -p $HOME/.gem
36
- touch $HOME/.gem/credentials
37
- chmod 0600 $HOME/.gem/credentials
38
- printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
39
- gem build *.gemspec
40
- gem push *.gem
41
- env:
30
+ - uses: actions/checkout@v3
31
+ - name: Set up Ruby 2.6
32
+ uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
33
+ with:
34
+ ruby-version: 2.6
35
+ - run: bundle install
36
+
37
+ - name: Publish to GPR
38
+ run: |
39
+ mkdir -p $HOME/.gem
40
+ touch $HOME/.gem/credentials
41
+ chmod 0600 $HOME/.gem/credentials
42
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
43
+ gem build *.gemspec
44
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
45
+ env:
46
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
47
+ OWNER: ${{ github.repository_owner }}
48
+
49
+ - name: Publish to RubyGems
50
+ run: |
51
+ mkdir -p $HOME/.gem
52
+ touch $HOME/.gem/credentials
53
+ chmod 0600 $HOME/.gem/credentials
54
+ printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
55
+ gem build *.gemspec
56
+ gem push *.gem
57
+ env:
58
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
42
59
  GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
43
60
  RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
44
- # RELEASE_COMMAND: rake release
61
+
62
+
@@ -19,7 +19,7 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  strategy:
21
21
  matrix:
22
- ruby-version: ['2.6', '2.7', '3.0']
22
+ ruby-version: ['2.6','2.7', '3.0']
23
23
 
24
24
  steps:
25
25
  - uses: actions/checkout@v2
data/.gitignore CHANGED
@@ -9,4 +9,5 @@
9
9
  .rake_tasks~
10
10
  lib/tdl/auto_script/tmp/
11
11
  /*.gem
12
- Gemfile.lock
12
+ Gemfile.lock
13
+ bk*.yml
data/.travis.yml CHANGED
@@ -4,6 +4,7 @@ before_install:
4
4
 
5
5
  rvm:
6
6
  - 2.6
7
+ - 2.7
7
8
  - 3.0
8
9
 
9
10
  script: rake test
data/axi_tdl.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.license = "LGPL-2.1"
16
16
  spec.files = Dir['lib/**/*']
17
17
  spec.require_paths = ["lib"]
18
- spec.required_ruby_version = '>= 2.5.0'
18
+ spec.required_ruby_version = '>= 2.6.0'
19
19
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
20
  # to allow pushing to a single host or delete this section to allow pushing to any host.
21
21
  if spec.respond_to?(:metadata)
@@ -109,8 +109,8 @@ axi4_partition_OD #(
109
109
  // .ADDR_STEP (slaver_inf.DSIZE/(master_inf.DSIZE/8.0) )
110
110
  // .ADDR_STEP (4*slaver_inf.DSIZE/16.0 )
111
111
  )axi4_partition_inst(
112
- /* axi_inf.slaver_inf */ .slaver_inf (axi_inf_first_wc ),
113
- /* axi_inf.master_inf */ .master_inf (axi_inf_pout )
112
+ /* axi_inf.slaver_inf */ .slaver (axi_inf_first_wc ),
113
+ /* axi_inf.master_inf */ .master (axi_inf_pout )
114
114
  );
115
115
 
116
116
  axi4_data_convert_verb #(
@@ -133,9 +133,11 @@ end
133
133
  endgenerate
134
134
 
135
135
 
136
- axi4_packet_fifo_verb #( //512
136
+ // axi4_packet_fifo_verb #( //512
137
+ axi4_packet_fifo_B1 #( //
137
138
  .PIPE (PIPE ),
138
139
  .DEPTH (4 ),
140
+ .MAX_DATA_LEN (1024*2),
139
141
  .SLAVER_MODE (SLAVER_MODE ), //
140
142
  .MASTER_MODE (MASTER_MODE ) //
141
143
  )axi4_packet_fifo_inst(
@@ -12,7 +12,8 @@ madified:
12
12
  ***********************************************/
13
13
  `timescale 1ns/1ps
14
14
  module axi4_mix_interconnect_M2S #(
15
- parameter NUM = 8
15
+ parameter NUM = 8,
16
+ parameter MASTER_IDSIZE = 8
16
17
  )(
17
18
  axi_inf.slaver slaver [NUM-1:0],
18
19
  axi_inf.master master
@@ -38,7 +39,8 @@ axi4_wr_interconnect_M2S_A1 #( //axi4 dont support write burst out-of-order
38
39
  // );
39
40
 
40
41
  axi4_rd_mix_interconnect_M2S_A2 #(
41
- .NUM (NUM )
42
+ .NUM (NUM ),
43
+ .MASTER_IDSIZE (MASTER_IDSIZE)
42
44
  )axi4_rd_mix_interconnect_M2S_inst(
43
45
  /* axi_inf.slaver_rd */ .slaver (`slaver_vcs_cptRead ), //[NUM-1:0],
44
46
  /* axi_inf.master_rd */ .master (`master_vcs_cptRead )
@@ -14,7 +14,8 @@ madified:
14
14
  ***********************************************/
15
15
  `timescale 1ns/1ps
16
16
  module axi4_rd_mix_interconnect_M2S_A2 #(
17
- parameter NUM = 8
17
+ parameter NUM = 8,
18
+ parameter MASTER_IDSIZE = 8
18
19
  )(
19
20
  axi_inf.slaver_rd slaver [NUM-1:0],
20
21
  axi_inf.master_rd master
@@ -24,7 +25,8 @@ localparam NSIZE = $clog2(NUM);
24
25
  import SystemPkg::*;
25
26
 
26
27
  // localparam LAZISE = slaver[0].IDSIZE;
27
- localparam LAZISE = master.IDSIZE - NSIZE;
28
+ // localparam LAZISE = master.IDSIZE - NSIZE;
29
+ localparam LAZISE = MASTER_IDSIZE - NSIZE;
28
30
 
29
31
  initial begin
30
32
  // assert(slaver[0].IDSIZE+NSIZE == master.IDSIZE)
@@ -2,6 +2,7 @@
2
2
  require_hdl "axis_length_split_with_addr.sv"
3
3
  require_hdl 'axi_stream_long_fifo_verb.sv'
4
4
  require_shdl 'axi4_wr_auxiliary_gen_without_resp','axis_valve_with_pipe'
5
+ require_shdl 'independent_clock_fifo'
5
6
 
6
7
  TdlBuild.long_axis_to_axi4_wr(__dir__) do
7
8
  parameter.BYTE_DEPTH 8192*2
@@ -0,0 +1,173 @@
1
+ /**********************************************
2
+ _______________________________________
3
+ ___________ Cook Darwin __________
4
+ _______________________________________
5
+ descript:
6
+ author : Cook.Darwin
7
+ Version: VERA.1.0 2017/9/18
8
+ use axis out
9
+ Version: VERA.2.0 ###### Tue Jan 7 09:47:51 CST 2020
10
+ data_inf_c replace valid ready
11
+ Version: VERA.4.0
12
+ Vision AXI PARAMETER
13
+ creaded: 2017/3/1
14
+ madified:
15
+ ***********************************************/
16
+ `timescale 1ns/1ps
17
+ (* axi4 = "true" *)
18
+ module odata_pool_axi4_A4 #(
19
+ parameter IDSIZE = 2,
20
+ parameter ASIZE = 32,
21
+ parameter LSIZE = 16
22
+ )(
23
+ axi_stream_inf.master out_axis,
24
+ data_inf_c.slaver addr_size_inf, //ADDR: 32 SIZE: 32
25
+ axi_inf.master_rd axi_master
26
+ );
27
+
28
+ `include "define_macro.sv"
29
+
30
+ logic fifo_empty;
31
+ logic fifo_full;
32
+ logic [31:0] fifo_addr;
33
+ logic [31:0] fifo_size;
34
+ logic fifo_rd_en;
35
+
36
+ independent_clock_fifo #(
37
+ .DEPTH (4 ),
38
+ .DSIZE (64 )
39
+ )independent_clock_fifo_inst_req(
40
+ /* input */ .wr_clk (addr_size_inf.clock ),
41
+ /* input */ .wr_rst_n (addr_size_inf.rst_n ),
42
+ /* input */ .rd_clk (axi_master.axi_aclk ),
43
+ /* input */ .rd_rst_n (axi_master.axi_aresetn ),
44
+ /* input [DSIZE-1:0] */ .wdata (addr_size_inf.data ),
45
+ /* input */ .wr_en (addr_size_inf.valid && addr_size_inf.ready ),
46
+ /* output logic[DSIZE-1:0] */ .rdata ({fifo_addr,fifo_size} ),
47
+ /* input */ .rd_en ((fifo_rd_en && !fifo_empty) ),
48
+ /* output logic */ .empty (fifo_empty ),
49
+ /* output logic */ .full (fifo_full )
50
+ );
51
+
52
+ assign addr_size_inf.ready = !fifo_full;
53
+
54
+ initial begin
55
+ if(out_axis.DSIZE != axi_master.DSIZE)begin
56
+ $error("DATA POOL AXI4 DATA WIDTH ERROR DSIZE[%d]--axi_master.DSIZE[%d]",out_axis.DSIZE,axi_master.DSIZE);
57
+ $finish;
58
+ end
59
+ assert (axi_master.IDSIZE==IDSIZE)
60
+ else $error("axi_master.IDSIZE==IDSIZE");
61
+
62
+ assert (axi_master.ASIZE==ASIZE)
63
+ else $error("axi_master.ASIZE==ASIZE");
64
+
65
+ assert (axi_master.LSIZE==LSIZE)
66
+ else $error("axi_master.LSIZE==LSIZE");
67
+ end
68
+
69
+ axi_stream_inf #(.DSIZE(IDSIZE+ASIZE+LSIZE)) addr_len_inf (.aclk(axi_master.axi_aclk),.aresetn(axi_master.axi_aresetn),.aclken(1'b1));
70
+
71
+ logic [IDSIZE-1:0] id;
72
+ logic [ASIZE-1:0] addr;
73
+ logic [LSIZE-1:0] length;
74
+ logic force_align_status;
75
+
76
+ assign id = '0;
77
+ assign addr = fifo_addr[ASIZE-1:0];
78
+ assign length = fifo_size[LSIZE:0];
79
+
80
+ assign addr_len_inf.axis_tdata = {id,addr,length};
81
+
82
+ `VCS_AXI4_CPT_LT(axi_master,master_rd,master_rd_aux,)
83
+ axi4_rd_auxiliary_gen_A1 axi4_rd_auxiliary_gen_inst(
84
+ /* axi_stream_inf.slaver */ .id_add_len_in (addr_len_inf ), //tlast is not necessary
85
+ /* axi_inf.master_rd_aux */ .axi_rd_aux (`axi_master_vcs_cpt )
86
+ );
87
+
88
+ assign addr_len_inf.axis_tvalid = !fifo_empty && (fifo_size[LSIZE:0]!='0);
89
+ assign fifo_rd_en = addr_len_inf.axis_tready;
90
+
91
+ //--->> FIFO
92
+
93
+ logic axis_fifo_empty;
94
+ logic axis_fifo_full;
95
+ logic axis_fifo_rd_en;
96
+ logic [out_axis.DSIZE+1-1:0] axis_fifo_rd_data;
97
+
98
+ //--->> forece rd_en <<---------------------------
99
+
100
+ logic force_rd_en;
101
+
102
+ logic cmded_empty;
103
+
104
+ independent_clock_fifo #(
105
+ .DEPTH (4 ),
106
+ .DSIZE (1 )
107
+ )independent_clock_fifo_inst(
108
+ /* input */ .wr_clk (axi_master.axi_aclk ),
109
+ /* input */ .wr_rst_n (axi_master.axi_aresetn ),
110
+ /* input */ .rd_clk (out_axis.aclk ),
111
+ /* input */ .rd_rst_n (out_axis.aresetn ),
112
+ /* input [DSIZE-1:0] */ .wdata (1'b1),
113
+ /* input */ .wr_en (axi_master.axi_arready && axi_master.axi_arvalid),
114
+ /* output logic[DSIZE-1:0] */ .rdata (),
115
+ /* input */ .rd_en (out_axis.axis_tvalid && out_axis.axis_tready && out_axis.axis_tlast),
116
+ /* output logic */ .empty (cmded_empty ),
117
+ /* output logic */ .full ()
118
+ );
119
+
120
+ assign force_rd_en = cmded_empty && !axis_fifo_empty;
121
+ //---<< forece rd_en >>---------------------------
122
+
123
+ xilinx_fifo_verb #(
124
+ //xilinx_fifo #(
125
+ .DSIZE (out_axis.DSIZE+1 )
126
+ )xilinx_fifo_inst(
127
+ /* input */ .wr_clk (axi_master.axi_aclk ),
128
+ /* input */ .wr_rst (!axi_master.axi_aresetn),
129
+ /* input */ .rd_clk (out_axis.aclk ),
130
+ /* input */ .rd_rst (!out_axis.aresetn ),
131
+ /* input [DSIZE-1:0] */ .din ({axi_master.axi_rlast,axi_master.axi_rdata} ),
132
+ /* input */ .wr_en ((axi_master.axi_rvalid && axi_master.axi_rready) ),
133
+ /* input */ .rd_en (axis_fifo_rd_en || force_rd_en ),
134
+ /* output [DSIZE-1:0] */ .dout (axis_fifo_rd_data ),
135
+ /* output */ .full (axis_fifo_full ),
136
+ /* output */ .empty (axis_fifo_empty ),
137
+ /* output [LSIZE-1:0] */ .rdcount (),
138
+ /* output [LSIZE-1:0] */ .wrcount ()
139
+ );
140
+
141
+
142
+ assign axi_master.axi_rready = !axis_fifo_full;
143
+
144
+ assign out_axis.axis_tdata = axis_fifo_rd_data[out_axis.DSIZE-1:0];
145
+ assign out_axis.axis_tlast = axis_fifo_rd_data[out_axis.DSIZE];
146
+ assign out_axis.axis_tvalid = !axis_fifo_empty;
147
+ assign out_axis.axis_tkeep = '1;
148
+ assign axis_fifo_rd_en = out_axis.axis_tvalid && out_axis.axis_tready;
149
+
150
+
151
+ //--->> force_align_status <<---------------------
152
+
153
+ // (* dont_touch = "true" *)
154
+ logic [23:0] axi4_rd_cnt;
155
+
156
+ always@(posedge axi_master.axi_aclk)
157
+ if(axi_master.axi_rvalid && axi_master.axi_rready && axi_master.axi_rlast)
158
+ axi4_rd_cnt <= '0;
159
+ else if(axi_master.axi_rvalid && axi_master.axi_rready)
160
+ axi4_rd_cnt <= axi4_rd_cnt + 1'b1;
161
+ else axi4_rd_cnt <= axi4_rd_cnt;
162
+
163
+ always@(posedge axi_master.axi_aclk ,negedge axi_master.axi_aresetn)
164
+ if(!axi_master.axi_aresetn)
165
+ force_align_status <= 1'b0;
166
+ else if(axi_master.axi_rvalid && axi_master.axi_rready && axi_master.axi_rlast)
167
+ force_align_status <= axi_master.axi_rcnt != axi4_rd_cnt;
168
+ else if(axis_fifo_empty && cmded_empty)
169
+ force_align_status <= 1'b0;
170
+ else force_align_status <= force_align_status;
171
+
172
+ //---<< force_align_status >>---------------------
173
+ endmodule
@@ -0,0 +1,66 @@
1
+ /**********************************************
2
+ _______________________________________
3
+ ___________ Cook Darwin __________
4
+ _______________________________________
5
+ descript:
6
+ author : Cook.Darwin
7
+ Version: VERB.1.0
8
+ longer fifo
9
+ creaded: 2017/2/28
10
+ madified:
11
+ ***********************************************/
12
+ `timescale 1ns/1ps
13
+ `include "define_macro.sv"
14
+ module axi4_packet_fifo_B1 #(
15
+ parameter PIPE = "OFF",
16
+ parameter DEPTH = 4,
17
+ parameter MAX_DATA_LEN = 1024*16,
18
+ `parameter_string MODE = "BOTH", //ONLY_WRITE ONLY_READ BOTH
19
+ `parameter_string SLAVER_MODE = "BOTH", //
20
+ `parameter_string MASTER_MODE = "BOTH" //
21
+ )(
22
+ axi_inf.slaver axi_in,
23
+ axi_inf.master axi_out
24
+ );
25
+
26
+ import SystemPkg::*;
27
+
28
+ initial begin
29
+ assert(SLAVER_MODE == MASTER_MODE)
30
+ else begin
31
+ $error("SLAVER AXIS MODE != MASTER AXIS MODE");
32
+ $stop;
33
+ end
34
+ end
35
+
36
+
37
+ `VCS_AXI4_CPT(axi_in,slaver,slaver_rd,Read)
38
+ `VCS_AXI4_CPT(axi_in,slaver,slaver_wr,Write)
39
+ `VCS_AXI4_CPT_LT(axi_out,master_rd,master,Read)
40
+ `VCS_AXI4_CPT_LT(axi_out,master_wr,master,Write)
41
+
42
+
43
+ generate
44
+ if(SLAVER_MODE=="BOTH" || SLAVER_MODE=="ONLY_WRITE")
45
+ axi4_wr_packet_fifo_A1 #(
46
+ .PIPE (PIPE ),
47
+ .DEPTH (DEPTH ),
48
+ .MAX_DATA_LEN (MAX_DATA_LEN )
49
+ )axi4_wr_packet_fifo_inst(
50
+ /* axi_inf.slaver_wr */ .axi_in (`axi_in_vcs_cptWrite ),
51
+ /* axi_inf.master_wr */ .axi_out (`axi_out_vcs_cptWrite )
52
+ );
53
+ endgenerate
54
+
55
+ generate
56
+ if(SLAVER_MODE=="BOTH" || SLAVER_MODE=="ONLY_READ")
57
+ axi4_rd_packet_fifo_A1 #(
58
+ .DEPTH (DEPTH ),
59
+ .MAX_DATA_LEN (MAX_DATA_LEN )
60
+ )axi4_rd_packet_fifo_inst(
61
+ /* axi_inf.slaver_rd */ .slaver (`axi_in_vcs_cptRead ),
62
+ /* axi_inf.master_rd */ .master (`axi_out_vcs_cptRead )
63
+ );
64
+ endgenerate
65
+
66
+ endmodule