小南鲸-FPGA 发表于 2024-11-28 17:23

接口类型转换

本帖最后由 小南鲸-FPGA 于 2024-11-28 17:58 编辑

<p>将sramif模块中的bankA和bankB转换为AXI-Stream接口,应当如何解决这个问题?(求助大佬)</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>module sramif #(</p>

<p>&nbsp; &nbsp; &nbsp;parameter integer NUM_CPUS = 1,</p>

<p>&nbsp; &nbsp; &nbsp;parameter integer AXI_SRAM_ID = 12</p>

<p>)(<br />
&nbsp; // ACE slave interface<br />
&nbsp; (* mark_debug = &quot;true&quot; *) output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awready_o,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awvalid_i,<br />
&nbsp; input &nbsp;wire [(AXI_SRAM_ID-1):0] &nbsp; ace_awid_i,<br />
&nbsp;(* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_awaddr_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awlen_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awsize_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awburst_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awbar_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awdomain_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awlock_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awcache_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awprot_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awsnoop_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awunique_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_wready_o,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_wvalid_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_wid_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_wdata_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_wstrb_i,<br />
&nbsp; (* mark_debug = &quot;true&quot; *) input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_wlast_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bready_i,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bvalid_o,<br />
&nbsp; output wire [(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bid_o,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bresp_o,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arready_o,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arvalid_i,<br />
&nbsp; input &nbsp;wire [(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arid_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_araddr_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arlen_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arsize_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arburst_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arbar_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_ardomain_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arlock_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arcache_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arprot_i,<br />
&nbsp; //input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arsnoop_i,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rready_i,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rvalid_o,<br />
&nbsp; output wire [(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rid_o,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rdata_o,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rresp_o,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rlast_o,</p>

<p>&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clk,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reset_n,</p>

<p>&nbsp; // npu axi register<br />
&nbsp; input logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fifo_count &nbsp; &nbsp; ,</p>

<p>&nbsp; // npu register interface<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sys_addr &nbsp; &nbsp; &nbsp; , // System Interface<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys_wr &nbsp; &nbsp; &nbsp; &nbsp; , // System Interface<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sys_wr_val &nbsp; &nbsp; , // System Interface<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys_rd &nbsp; &nbsp; &nbsp; &nbsp; , // System Interface<br />
&nbsp; input &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sys_ack &nbsp; &nbsp; &nbsp; &nbsp;, // System Interface<br />
&nbsp; input &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sys_rd_val &nbsp; &nbsp; , // System Interface</p>

<p>&nbsp; // npu data sram interface<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bankA_dma_cs &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bankA_dma_we &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; bankA_dma_addr &nbsp; &nbsp; &nbsp; ,&nbsp;<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp;bankA_dma_din &nbsp; &nbsp; &nbsp; &nbsp;,&nbsp;<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; bankA_dma_byte_en &nbsp; &nbsp;,<br />
&nbsp; input &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bankA_dma_dout &nbsp; &nbsp; &nbsp; ,&nbsp;<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bankB_dma_cs &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bankB_dma_we &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; bankB_dma_addr &nbsp; &nbsp; &nbsp; ,&nbsp;<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp;bankB_dma_din &nbsp; &nbsp; &nbsp; &nbsp;,&nbsp;<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; bankB_dma_byte_en &nbsp; &nbsp;,<br />
&nbsp; input &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bankB_dma_dout &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; // npu lut sram<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dma_lut_cs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dma_lut_we &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dma_lut_addr &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dma_lut_din &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dma_lut_byte_en &nbsp; &nbsp; ,<br />
&nbsp; input &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dma_lut_dout &nbsp; &nbsp; &nbsp; &nbsp;,</p>

<p>&nbsp; // Command manager interface<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cmd_cs &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cmd_we &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmd_addr &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; input &nbsp;logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmd_out &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; output logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
/*<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bist_mode &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; // clk / rst_n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i_apb_clk &nbsp; &nbsp; &nbsp; ,</p>

<p>&nbsp; // apb port &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i_psel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i_paddr &nbsp; &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i_penable &nbsp; &nbsp; &nbsp; ,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i_pwrite &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; input &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i_pwdata &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;o_prdata &nbsp; &nbsp; &nbsp; &nbsp;,<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npum_ctrl &nbsp; &nbsp; &nbsp; , //default:0<br />
&nbsp; output wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;npum_ramclk */<br />
);</p>

<p>&nbsp; localparam ADDR_WIDTH = 32;<br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // Signal declarations<br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; //reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rready_i_tmp;<br />
&nbsp; //always@(posedge clk)begin<br />
&nbsp; // &nbsp; &nbsp;ace_rready_i_tmp &lt;= ace_rready_i;<br />
&nbsp; //end<br />
&nbsp; logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;len_addr_count;<br />
&nbsp; logic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;len_addr_count_d1;</p>

<p>&nbsp; // Read/write arbitration<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_sel;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nxt_write_sel;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;write_sel_we;</p>

<p>&nbsp; // Unpacked address/control<br />
&nbsp; wire [(ADDR_WIDTH-1):0] unpk_wr_addr;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unpk_wr_last;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unpk_wr_valid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unpk_wr_ready;<br />
&nbsp; wire [(ADDR_WIDTH-1):0] unpk_rd_addr;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unpk_rd_last;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unpk_rd_valid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unpk_rd_ready;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unpk_rd_valid_d1;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unpk_rd_last_d1;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unpk_rd_last_d2;</p>

<p>&nbsp; // ACE signals<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_awready;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arready;<br />
&nbsp; reg &nbsp;[(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arid_reg;<br />
&nbsp; reg &nbsp;[(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arid_d2;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_arid_reg_we;<br />
&nbsp; reg &nbsp;[(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rid_we;<br />
&nbsp; reg &nbsp;[(AXI_SRAM_ID-1):0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bid_we;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_wready;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nxt_ace_wready;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_bvalid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nxt_ace_bvalid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_bresp;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rdata;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_rvalid;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nxt_ace_rvalid;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_rlast;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_rlast_temp;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rresp;</p>

<p>&nbsp; // Validation read/write<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_read;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; val_read_d1; // read data delay one cycle<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; val_read_d2; // read data delay two cycle<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_rd_data; // Read data<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_rd_data_big; // Read data<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_write;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_rd_ongoing;<br />
&nbsp; reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; val_rd_ongoing_reg;</p>

<p>&nbsp; logic unpk_wr_valid_d1;<br />
&nbsp; logic unpk_wr_valid_d2;<br />
&nbsp; logic preproc_valid;<br />
&nbsp; logic &nbsp; pre_type;<br />
&nbsp; logic bvalid_delay;<br />
&nbsp; logic ace_wvalid_d1;<br />
&nbsp; logic wstart;<br />
&nbsp;&nbsp;<br />
&nbsp; logic empty;<br />
&nbsp; logic empty_b1;<br />
&nbsp; logic almost_empty;<br />
/*<br />
&nbsp; //apb signals<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P0;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P1;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P2;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P3;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P4;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P5;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P6;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P7;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P8;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P9;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P10;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P11;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P12;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P13;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P14;<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o_sw_SLEEP_P15;</p>

<p><br />
apb_reg_memctl u_apb_reg_memctl<br />
(<br />
&nbsp; .i_clk &nbsp; &nbsp; &nbsp; &nbsp; (i_apb_clk &nbsp; &nbsp; ),<br />
&nbsp; .i_rst_n &nbsp; &nbsp; &nbsp; (reset_n &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; .i_psel &nbsp; &nbsp; &nbsp; &nbsp;(i_psel &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; .i_paddr &nbsp; &nbsp; &nbsp; (i_paddr &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; .i_penable &nbsp; &nbsp; (i_penable &nbsp; &nbsp; ),<br />
&nbsp; .i_pwrite &nbsp; &nbsp; &nbsp;(i_pwrite &nbsp; &nbsp; &nbsp;),<br />
&nbsp; .i_pwdata &nbsp; &nbsp; &nbsp;(i_pwdata &nbsp; &nbsp; &nbsp;),<br />
&nbsp; .o_prdata &nbsp; &nbsp; &nbsp;(o_prdata &nbsp; &nbsp; &nbsp;),<br />
&nbsp; .o_sw_SLEEP_P0 (o_sw_SLEEP_P0 ),<br />
&nbsp; .o_sw_SLEEP_P1 (o_sw_SLEEP_P1 ),<br />
&nbsp; .o_sw_SLEEP_P2 (o_sw_SLEEP_P2 ),<br />
&nbsp; .o_sw_SLEEP_P3 (o_sw_SLEEP_P3 ),<br />
&nbsp; .o_sw_SLEEP_P4 (o_sw_SLEEP_P4 ),<br />
&nbsp; .o_sw_SLEEP_P5 (o_sw_SLEEP_P5 ),<br />
&nbsp; .o_sw_SLEEP_P6 (o_sw_SLEEP_P6 ),<br />
&nbsp; .o_sw_SLEEP_P7 (o_sw_SLEEP_P7 ),<br />
&nbsp; .o_sw_SLEEP_P8 (o_sw_SLEEP_P8 ),<br />
&nbsp; .o_sw_SLEEP_P9 (o_sw_SLEEP_P9 ),<br />
&nbsp; .o_sw_SLEEP_P10(o_sw_SLEEP_P10),<br />
&nbsp; .o_sw_SLEEP_P11(o_sw_SLEEP_P11),<br />
&nbsp; .o_sw_SLEEP_P12(o_sw_SLEEP_P12),<br />
&nbsp; .o_sw_SLEEP_P13(o_sw_SLEEP_P13),<br />
&nbsp; .o_sw_SLEEP_P14(o_sw_SLEEP_P14),<br />
&nbsp; .o_sw_SLEEP_P15(o_sw_SLEEP_P15),<br />
&nbsp; .o_sw_NPUM_CTRL(npum_ctrl &nbsp; &nbsp; )&nbsp;<br />
);</p>

<p>&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; //Power Down Mode<br />
&nbsp; //----------------------------------------------------------------------------<br />
ca53_cell_clkgate clkgate_ram_clk0 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P0 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk1 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P1 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk2 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P2 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk3 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P3 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk4 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P4 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk5 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P5 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk6 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P6 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk7 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P7 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk8 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P8 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk9 &nbsp; (.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P9 ), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk10 &nbsp;(.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P10), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk11 &nbsp;(.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P11), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk12 &nbsp;(.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P12), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk13 &nbsp;(.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P13), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk14 &nbsp;(.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P14), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
ca53_cell_clkgate clkgate_ram_clk15 &nbsp;(.clk_i(clk),.clk_enable_i(!o_sw_SLEEP_P15), .clk_senable_i(bist_mode),.clk_gated_o(npum_ramclk));<br />
*/<br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // ACE address unpacking<br />
&nbsp; //<br />
&nbsp; // &nbsp; An ACE read/write request can specify a burst while only providing the<br />
&nbsp; // &nbsp; address for the first transfer in the burst. &nbsp;To access the validation<br />
&nbsp; // &nbsp; memory resources these &#39;packed&#39; addresses are unpacked into a series of<br />
&nbsp; // &nbsp; requests, each providing the full address.<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>&nbsp; // Write channel<br />
&nbsp; execution_tb_ace_intf_addr_unpack #(.ADDR_WIDTH(ADDR_WIDTH))<br />
&nbsp; &nbsp; u_execution_tb_ace_intf_addr_unpack_wr<br />
&nbsp; &nbsp; &nbsp; (// Clocks and resets<br />
&nbsp; &nbsp; &nbsp; &nbsp;.clk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (clk),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.reset_n &nbsp; &nbsp; &nbsp; &nbsp; (reset_n),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;// ACE write address channel<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axaddr_i &nbsp; &nbsp;(ace_awaddr_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axburst_i &nbsp; (ace_awburst_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axsize_i &nbsp; &nbsp;(ace_awsize_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axlen_i &nbsp; &nbsp; (ace_awlen_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axprot_i &nbsp; &nbsp;(ace_awprot_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axvalid_i &nbsp; (ace_awvalid_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axready_o &nbsp; (ace_awready),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;.len_addr_count &nbsp;(len_addr_count),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;// Unpacked write address/control<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_addr_o &nbsp; &nbsp; (unpk_wr_addr),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_last_o &nbsp; &nbsp; (unpk_wr_last),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_valid_o &nbsp; &nbsp;(unpk_wr_valid),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_ready_i &nbsp; &nbsp;(unpk_wr_ready)<br />
&nbsp; &nbsp; &nbsp; );<br />
&nbsp; // The ACE write address channel is stalled until the ACE write channel<br />
&nbsp; // provides data on a completed W channel handshake.<br />
&nbsp; //<br />
&nbsp; // However, for the last beat of the burst the stall is extended until the end<br />
&nbsp; // of the ACE write response channel handshake. &nbsp;This is required so that no<br />
&nbsp; // other requests on the AW channel are started until the current request has<br />
&nbsp; // completely cleared; the address unpacker can only handle a single<br />
&nbsp; // outstanding write.<br />
&nbsp; assign unpk_wr_ready = (ace_wvalid_i &amp; ace_wready &amp; ~unpk_wr_last) |<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(ace_bvalid &amp; ace_bready_i);</p>

<p>&nbsp; // Read channel<br />
&nbsp; execution_tb_ace_intf_addr_unpack<br />
&nbsp; &nbsp; u_execution_tb_ace_intf_addr_unpack_rd<br />
&nbsp; &nbsp; &nbsp; (// Clocks and resets<br />
&nbsp; &nbsp; &nbsp; &nbsp;.clk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (clk),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.reset_n &nbsp; &nbsp; &nbsp; &nbsp; (reset_n),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;// ACE read address channel<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axaddr_i &nbsp; &nbsp;(ace_araddr_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axburst_i &nbsp; (ace_arburst_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axsize_i &nbsp; &nbsp;(ace_arsize_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axlen_i &nbsp; &nbsp; (ace_arlen_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axprot_i &nbsp; &nbsp;(ace_arprot_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axvalid_i &nbsp; (ace_arvalid_i),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.ace_axready_o &nbsp; (ace_arready),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;.len_addr_count &nbsp;(),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;// Unpacked write address channel<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_addr_o &nbsp; &nbsp; (unpk_rd_addr),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_last_o &nbsp; &nbsp; (unpk_rd_last),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_valid_o &nbsp; &nbsp;(unpk_rd_valid),<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_ready_i &nbsp; &nbsp;(unpk_rd_ready)<br />
&nbsp; &nbsp; &nbsp; );</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if(!reset_n)<br />
&nbsp; &nbsp; &nbsp; len_addr_count_d1 &lt;= {8{1&#39;b0}};<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; len_addr_count_d1 &lt;= len_addr_count;</p>

<p><br />
&nbsp; // The ACE read address channel stalls until the read is issued to the<br />
&nbsp; // validation subsystem.<br />
&nbsp; assign unpk_rd_ready = val_read;</p>

<p><br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // ACE transaction IDs<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>&nbsp; // ARID register:<br />
&nbsp; // &nbsp; Capture ARID on a completed ACE AR handskake to form the correct ID for<br />
&nbsp; // &nbsp; the read response<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_arid_reg &lt;= {(AXI_SRAM_ID){1&#39;b0}};<br />
&nbsp; &nbsp; else if (ace_arid_reg_we)<br />
&nbsp; &nbsp; &nbsp; ace_arid_reg &lt;= ace_arid_i;</p>

<p>&nbsp; assign ace_arid_reg_we = ace_arready &amp; ace_arvalid_i;<br />
&nbsp;&nbsp;<br />
&nbsp; // read data delay a cycle and rid need delay a cycle<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_arid_d2 &lt;= {(AXI_SRAM_ID){1&#39;b0}};<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; ace_arid_d2 &lt;= ace_arid_reg;<br />
// &nbsp; &nbsp;else if (ace_arid_reg_we)<br />
// &nbsp; &nbsp; &nbsp;//ace_arid_d2 &lt;= ace_arid_i;<br />
// &nbsp; &nbsp; &nbsp;ace_arid_d2 &lt;= ace_arid_reg;</p>

<p>&nbsp; // RID:<br />
&nbsp; // &nbsp; RID will normally be from ace_arid_reg, but because we can accept the<br />
&nbsp; // &nbsp; next AR request while waiting for the previous request&#39;s RREADY we have<br />
&nbsp; // &nbsp; to cover this extra window.<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_rid &lt;= {(AXI_SRAM_ID){1&#39;b0}};<br />
&nbsp; &nbsp; else if (ace_rid_we)<br />
&nbsp; &nbsp; &nbsp; ace_rid &lt;= ace_arid_d2;</p>

<p>&nbsp; assign ace_rid_we = unpk_rd_valid_d1 &amp; ~(ace_rlast &amp; ace_rvalid &amp; ~ace_rready_i);<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; unpk_rd_valid_d1 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; unpk_rd_valid_d1 &lt;= unpk_rd_valid;</p>

<p><br />
&nbsp; // BID:<br />
&nbsp; // &nbsp; Takes a copy of AWID when the write address handshake is complete.<br />
&nbsp; // &nbsp; Bits of the ID contains the CPU number of the CPU that made the<br />
&nbsp; // &nbsp; request.<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_bid &lt;= {(AXI_SRAM_ID){1&#39;b0}};<br />
&nbsp; &nbsp; else if (ace_bid_we)<br />
&nbsp; &nbsp; &nbsp; ace_bid &lt;= ace_awid_i;</p>

<p>&nbsp; assign ace_bid_we = ace_awready &amp; ace_awvalid_i;</p>

<p><br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // Write channel handshake<br />
&nbsp; //<br />
&nbsp; // &nbsp; Once a write address handshake has completed, writes for that transaction<br />
&nbsp; // &nbsp; do not incur any stalls. &nbsp;Therefore WREADY is brought high after a write<br />
&nbsp; // &nbsp; address handshake and stays high until the handshake for the last data<br />
&nbsp; // &nbsp; beat completes and the write response has handshaked.<br />
&nbsp; //<br />
&nbsp; // &nbsp; We must wait for the write response handshake to complete so as not to<br />
&nbsp; // &nbsp; handshake any new write transactions that the processor may have<br />
&nbsp; // &nbsp; presented.<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_wready &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; ace_wready &lt;= nxt_ace_wready;</p>

<p>&nbsp; assign nxt_ace_wready = unpk_wr_valid &amp; preproc_valid &amp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Ongoing write<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ~(ace_wvalid_i &amp; ace_wready &amp; ace_wlast_i) &amp; &nbsp;// Not last beat<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ~ace_bvalid; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Not waiting for BREAD</p>

<p>&nbsp; // unpk_valid delay one cycle for val_write_i<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; unpk_wr_valid_d1 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; unpk_wr_valid_d1 &lt;= unpk_wr_valid;<br />
&nbsp; // unpk_valid delay 2 cycle for val_write_i<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; unpk_wr_valid_d2 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; unpk_wr_valid_d2 &lt;= unpk_wr_valid_d1;</p>

<p>&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // Write response channel handshake<br />
&nbsp; //<br />
&nbsp; // &nbsp; The write response is driven after the final beat of write data has been<br />
&nbsp; // &nbsp; written (i.e. its write handshake has completed.) &nbsp;BVALID stays high<br />
&nbsp; // &nbsp; until the processor completes the handshake.<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_bvalid &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; ace_bvalid &lt;= nxt_ace_bvalid;</p>

<p>&nbsp; //assign nxt_ace_bvalid = ~bvalid_delay &amp; ((ace_wvalid_i &amp; ace_wready &amp; unpk_wr_last) | ace_bvalid) &amp;<br />
&nbsp; assign nxt_ace_bvalid = ((ace_wvalid_i &amp; ace_wready &amp; unpk_wr_last) | ace_bvalid) &amp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ~(ace_bvalid &amp; ace_bready_i);</p>

<p>&nbsp; assign ace_bresp = 2&#39;b00; // OKAY response</p>

<p><br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // Read channel data register and handshake<br />
&nbsp; //<br />
&nbsp; // &nbsp; Read data from the validation memory model is registered before being<br />
&nbsp; // &nbsp; sent to the processor.<br />
&nbsp; //<br />
&nbsp; // &nbsp; RVALID is set high at the same time and stays high until the processor<br />
&nbsp; // &nbsp; completes the handshake.<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>// &nbsp;always @ (posedge clk or negedge reset_n)<br />
// &nbsp; &nbsp;if (!reset_n)<br />
// &nbsp; &nbsp; &nbsp;ace_rdata &lt;= {128{1&#39;b0}};<br />
// &nbsp; &nbsp;else if (val_read_d2)<br />
// &nbsp; &nbsp; &nbsp;ace_rdata &lt;= val_rd_data_big;</p>

<p>sramif_fifo u_sramif_fifo(<br />
&nbsp; &nbsp; .clk &nbsp; &nbsp; &nbsp;(clk &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; .rst_n &nbsp; &nbsp;(reset_n ),<br />
&nbsp; &nbsp; .flush &nbsp; &nbsp;( 1&#39;b0 &nbsp; ),<br />
&nbsp; &nbsp; .write &nbsp; &nbsp;(val_read_d2 ),<br />
&nbsp; &nbsp; .data_in &nbsp;(val_rd_data_big ),<br />
&nbsp; &nbsp; .read &nbsp; &nbsp; (~empty &amp; ace_rready_i ),<br />
&nbsp; &nbsp; .data_out (ace_rdata ),<br />
&nbsp; &nbsp; .full &nbsp; &nbsp; ( ),<br />
&nbsp; &nbsp; .almost_empty &nbsp; &nbsp;(almost_empty ),<br />
&nbsp; &nbsp; .empty_b1 (empty_b1 ),<br />
&nbsp; &nbsp; .empty &nbsp; &nbsp;(empty )<br />
);</p>

<p>assign val_rd_data_big &nbsp; &nbsp;= {val_rd_data, val_rd_data, val_rd_data, val_rd_data};<br />
assign val_rd_data_big &nbsp; = {val_rd_data, val_rd_data, val_rd_data, val_rd_data};<br />
assign val_rd_data_big &nbsp; = {val_rd_data, val_rd_data, val_rd_data, val_rd_data};<br />
assign val_rd_data_big &nbsp; = {val_rd_data, val_rd_data, val_rd_data, val_rd_data};</p>

<p>&nbsp; // RVALID<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_rvalid &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; ace_rvalid &lt;= nxt_ace_rvalid;</p>

<p>&nbsp; assign nxt_ace_rvalid = val_rd_ongoing | (ace_rvalid &amp; ~ace_rready_i);</p>

<p>&nbsp; // Drive RLAST from the unpacked interface when the read is ongoing<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; ace_rlast &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else if (ace_rvalid &amp; ace_rready_i &amp; ace_rlast)<br />
&nbsp; &nbsp; &nbsp; ace_rlast &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else if (val_read_d2)<br />
&nbsp; &nbsp; &nbsp; ace_rlast &lt;= unpk_rd_last_d2;</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; unpk_rd_last_d1 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; unpk_rd_last_d1 &lt;= unpk_rd_last;<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; unpk_rd_last_d2 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; unpk_rd_last_d2 &lt;= unpk_rd_last_d1;</p>

<p>&nbsp; // The validation memories never give an error response<br />
&nbsp; assign ace_rresp = 2&#39;b00; &nbsp;// OKAY response</p>

<p><br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // Validation read/write valid<br />
&nbsp; //<br />
&nbsp; // &nbsp; A read to the validation memory interface is valid when the address<br />
&nbsp; // &nbsp; unpacker signals a valid read and we are not waiting on RREADY (which<br />
&nbsp; // &nbsp; stalls the next read.)<br />
&nbsp; //<br />
&nbsp; // &nbsp; Since write data is accepted as soon as it is provided by the processor,<br />
&nbsp; // &nbsp; a write to the validation memory interface is valid when there&#39;s<br />
&nbsp; // &nbsp; a completed ACE write channel handshake.<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>&nbsp; assign val_read &nbsp;= unpk_rd_valid &amp; ~(ace_rvalid &amp; ~ace_rready_i);<br />
&nbsp; assign val_write = ace_wvalid_i &amp; ((ace_wready &amp; pre_type != 2&#39;h2) |&nbsp;<br />
&nbsp; &nbsp; (unpk_wr_valid_d1 &amp; pre_type == 2&#39;h2 &amp; (!unpk_wr_valid_d2 || wstart ||<br />
&nbsp; &nbsp; (len_addr_count != len_addr_count_d1 &amp;&amp; len_addr_count_d1 != 8&#39;b0))));</p>

<p>// &nbsp;assign val_write = ace_wvalid_i &amp; ((ace_wready &amp; pre_type != 2&#39;h2) |&nbsp;<br />
// &nbsp; &nbsp;(unpk_wr_valid_d1 &amp; pre_type == 2&#39;h2 &amp; (!unpk_wr_valid_d2 ||&nbsp;<br />
// &nbsp; &nbsp;(len_addr_count != len_addr_count_d1 &amp;&amp; len_addr_count_d1 != 8&#39;b0))));</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; wstart &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else if(unpk_wr_valid_d1 &amp;&amp; ~unpk_wr_valid_d2 &amp;&amp; ~ace_wvalid_i)<br />
&nbsp; &nbsp; &nbsp; wstart &lt;= 1&#39;b1;<br />
&nbsp; &nbsp; else if(ace_wvalid_i)<br />
&nbsp; &nbsp; &nbsp; wstart &lt;= 1&#39;b0;<br />
&nbsp;&nbsp;<br />
// &nbsp;assign val_write = ace_wvalid_i &amp; ((ace_wready &amp; pre_type != 2&#39;h2) | (unpk_wr_valid_d1 &amp; ~unpk_wr_valid_d2 &amp; pre_type == 2&#39;h2));<br />
// write data valid after unpk wr addr valid one cycle<br />
// &nbsp;assign val_write = ace_wvalid_i &amp; ace_wready;</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; val_read_d1 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; val_read_d1 &lt;= val_read;<br />
&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; val_read_d2 &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; val_read_d2 &lt;= val_read_d1;</p>

<p>&nbsp; // Set a flag when a read is sent to the validation components and stays high<br />
&nbsp; // until the read data is presented to the ACE interface, accounting for any<br />
&nbsp; // stalls from the RVALID/RREADY handshake<br />
&nbsp; assign val_rd_ongoing = ~empty_b1 | (val_rd_ongoing_reg &amp; ~(ace_rvalid &amp; ace_rready_i));</p>

<p>&nbsp; always @ (posedge clk or negedge reset_n)<br />
&nbsp; &nbsp; if (!reset_n)<br />
&nbsp; &nbsp; &nbsp; val_rd_ongoing_reg &lt;= 1&#39;b0;<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; val_rd_ongoing_reg &lt;= val_rd_ongoing;</p>

<p><br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // Output assignments<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>// &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_read_o, &nbsp; &nbsp;// Read valid<br />
&nbsp; wire [(ADDR_WIDTH-1):0] val_rd_addr; // Read address<br />
// &nbsp;wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_write_o, &nbsp; // Write valid<br />
&nbsp; wire [(ADDR_WIDTH-1):0] val_wr_addr; // Write address<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; val_wr_strb; // Write strobes<br />
&nbsp; wire &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;val_wr_data; &nbsp;// Write data</p>

<p>&nbsp; // Validation memory interface<br />
&nbsp; //assign val_read &nbsp; &nbsp; &nbsp;= val_read;<br />
&nbsp; assign val_rd_addr &nbsp; = unpk_rd_addr;<br />
&nbsp; //assign val_write &nbsp; &nbsp; = val_write;<br />
&nbsp; assign val_wr_addr &nbsp; = unpk_wr_addr;<br />
&nbsp; // change little-big endian<br />
&nbsp; assign val_wr_data &nbsp; = {ace_wdata_i, ace_wdata_i, ace_wdata_i, ace_wdata_i};<br />
&nbsp; assign val_wr_data &nbsp; = {ace_wdata_i, ace_wdata_i, ace_wdata_i, ace_wdata_i};<br />
&nbsp; assign val_wr_data &nbsp; = {ace_wdata_i, ace_wdata_i, ace_wdata_i, ace_wdata_i};<br />
&nbsp; assign val_wr_data &nbsp; = {ace_wdata_i, ace_wdata_i, ace_wdata_i, ace_wdata_i};<br />
&nbsp; //assign val_wr_data &nbsp; = ace_wdata_i;<br />
&nbsp; //assign val_wr_strb &nbsp; = ace_wstrb_i;<br />
&nbsp; assign val_wr_strb &nbsp; = {ace_wstrb_i, ace_wstrb_i,ace_wstrb_i,ace_wstrb_i,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_wstrb_i, ace_wstrb_i,ace_wstrb_i,ace_wstrb_i,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_wstrb_i, ace_wstrb_i,ace_wstrb_i,ace_wstrb_i,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ace_wstrb_i, ace_wstrb_i,ace_wstrb_i,ace_wstrb_i};</p>

<p>&nbsp; //reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rvalid_o_tmp;<br />
&nbsp; //reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rid_o_tmp;<br />
&nbsp; //reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rresp_o_tmp;<br />
&nbsp; //reg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ace_rlast_o_tmp;<br />
&nbsp; //always@(posedge clk)begin<br />
&nbsp; // &nbsp; &nbsp;ace_rvalid_o_tmp &lt;= ace_rid &nbsp; &nbsp;;<br />
&nbsp; // &nbsp; &nbsp;ace_rid_o_tmp &nbsp; &nbsp;&lt;= ace_rresp &nbsp;;<br />
&nbsp; // &nbsp; &nbsp;ace_rresp_o_tmp &nbsp;&lt;= ace_rlast &nbsp;;<br />
&nbsp; // &nbsp; &nbsp;ace_rlast_o_tmp &nbsp;&lt;= ace_rvalid ;<br />
&nbsp; //end</p>

<p>&nbsp; // ACE outputs<br />
&nbsp; assign ace_awready_o = ace_awready;<br />
&nbsp; assign ace_wready_o &nbsp;= ace_wready;<br />
&nbsp; assign ace_bvalid_o &nbsp;= ace_bvalid;<br />
&nbsp; assign ace_bid_o &nbsp; &nbsp; = ace_bid;<br />
&nbsp; assign ace_bresp_o &nbsp; = ace_bresp;<br />
&nbsp; assign ace_arready_o = ace_arready;<br />
&nbsp; assign ace_rvalid_o &nbsp;= ace_rvalid;<br />
&nbsp; assign ace_rid_o &nbsp; &nbsp; = ace_rid;<br />
&nbsp; assign ace_rdata_o &nbsp; = ace_rdata;<br />
&nbsp; //assign ace_rdata_o &nbsp; = val_rd_data;<br />
&nbsp; assign ace_rresp_o &nbsp; = ace_rresp;<br />
&nbsp; assign ace_rlast_o &nbsp; = ace_rlast;</p>

<p><br />
&nbsp; //----------------------------------------------------------------------------<br />
&nbsp; // System address decoder<br />
&nbsp; //<br />
&nbsp; // &nbsp; The validation memory starts at address 0x000_0000_0000 and aliases<br />
&nbsp; // &nbsp; through the whole memory map, except for the region 0x000_1300_0000 to<br />
&nbsp; // &nbsp; 0x000_13FF_FFFF which is reserved for the tube and trickbox registers.<br />
&nbsp; //<br />
&nbsp; // &nbsp; This region contains:<br />
&nbsp; //<br />
&nbsp; // &nbsp; &nbsp; 0x000_1300_0000 : Tube<br />
&nbsp; // &nbsp; &nbsp; 0x000_1300_0008 : Trickbox - FIQ counter load<br />
&nbsp; // &nbsp; &nbsp; 0x000_1300_000C : Trickbox - FIQ clear<br />
&nbsp; //<br />
&nbsp; // &nbsp; Other locations in the trickbox region are reserved.<br />
&nbsp; //----------------------------------------------------------------------------</p>

<p>&nbsp; sramif_decoder<br />
&nbsp; &nbsp; u_sramif_decoder<br />
&nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.clk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (clk),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.reset_n &nbsp; &nbsp; &nbsp; &nbsp; (reset_n),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Read port<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_read_i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(val_read),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_rd_addr_i &nbsp; &nbsp; &nbsp; (val_rd_addr),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_rd_data_o &nbsp; &nbsp; &nbsp; (val_rd_data),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Write port<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_write_i &nbsp; &nbsp; &nbsp; &nbsp; (val_write),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_wr_addr_i &nbsp; &nbsp; &nbsp; (val_wr_addr),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_wr_strb_i &nbsp; &nbsp; &nbsp; (val_wr_strb),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.val_wr_data_i &nbsp; &nbsp; &nbsp; (val_wr_data),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// unpack address<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// a cycle ahead w_data_en<br />
&nbsp; &nbsp; &nbsp; &nbsp;.unpk_valid_i &nbsp; &nbsp;(unpk_wr_valid),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// axi fifo register interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.fifo_count &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(fifo_count),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// preprocess interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.preproc_valid &nbsp; &nbsp; &nbsp; (preproc_valid),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.pre_type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(pre_type),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.bvalid_delay &nbsp; &nbsp; &nbsp; &nbsp;(bvalid_delay),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// sram interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankA_dma_cs &nbsp; &nbsp; &nbsp; &nbsp;( bankA_dma_cs &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankA_dma_we &nbsp; &nbsp; &nbsp; &nbsp;( bankA_dma_we &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankA_dma_addr &nbsp; &nbsp; &nbsp;( bankA_dma_addr &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankA_dma_din &nbsp; &nbsp; &nbsp; ( bankA_dma_din &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankA_dma_byte_en &nbsp; ( bankA_dma_byte_en &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankA_dma_dout &nbsp; &nbsp; &nbsp;( bankA_dma_dout &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankB_dma_cs &nbsp; &nbsp; &nbsp; &nbsp;( bankB_dma_cs &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankB_dma_we &nbsp; &nbsp; &nbsp; &nbsp;( bankB_dma_we &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankB_dma_addr &nbsp; &nbsp; &nbsp;( bankB_dma_addr &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankB_dma_din &nbsp; &nbsp; &nbsp; ( bankB_dma_din &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankB_dma_byte_en &nbsp; ( bankB_dma_byte_en &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .bankB_dma_dout &nbsp; &nbsp; &nbsp;( bankB_dma_dout &nbsp; &nbsp; &nbsp;),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; // lut sram interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; .dma_lut_cs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( dma_lut_cs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .dma_lut_we &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( dma_lut_we &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .dma_lut_addr &nbsp; &nbsp; &nbsp; &nbsp;( dma_lut_addr &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .dma_lut_din &nbsp; &nbsp; &nbsp; &nbsp; ( dma_lut_din &nbsp; &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .dma_lut_byte_en &nbsp; &nbsp; ( dma_lut_byte_en &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .dma_lut_dout &nbsp; &nbsp; &nbsp; &nbsp;( dma_lut_dout &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; // npu reg interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; .sys_addr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( sys_addr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .sys_wr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( sys_wr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .sys_wr_val &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( sys_wr_val &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .sys_rd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( sys_rd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .sys_ack &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( sys_ack &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .sys_rd_val &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( sys_rd_val &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; // npu command sram interface<br />
&nbsp; &nbsp; &nbsp; &nbsp; .cmd_cs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( cmd_cs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .cmd_we &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( cmd_we &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .cmd_addr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( cmd_addr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .cmd_out &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( cmd_out &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ),<br />
&nbsp; &nbsp; &nbsp; &nbsp; .cmd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( cmd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )&nbsp;</p>

<p>&nbsp; &nbsp; &nbsp; );</p>

<p>endmodule<br />
&nbsp;</p>

小南鲸-FPGA 发表于 2024-11-29 16:01

12345323865 发表于 2024-11-29 15:17
**** 作者被禁止或删除 内容自动屏蔽 ****

<p>?</p>

<p>&nbsp;</p>
页: [1]
查看完整版本: 接口类型转换