diff --git a/rtl/basic/hwpe_stream_fence.sv b/rtl/basic/hwpe_stream_fence.sv index ba8bc29..89556b3 100644 --- a/rtl/basic/hwpe_stream_fence.sv +++ b/rtl/basic/hwpe_stream_fence.sv @@ -29,20 +29,23 @@ * .. _hwpe_stream_fence_params: * .. table:: **hwpe_stream_fence** design-time parameters. * - * +------------------+-------------+---------------------------------------------+ - * | **Name** | **Default** | **Description** | - * +------------------+-------------+---------------------------------------------+ - * | *NB_STREAMS* | 2 | Number of input/output HWPE-Stream streams. | - * +------------------+-------------+---------------------------------------------+ - * | *DATA_WIDTH* | 32 | Width of the HWPE-Stream streams. | - * +------------------+-------------+---------------------------------------------+ + * +------------------+----------------+---------------------------------------------+ + * | **Name** | **Default** | **Description** | + * +------------------+----------------+---------------------------------------------+ + * | *NB_STREAMS* | 2 | Number of input/output HWPE-Stream streams. | + * +------------------+----------------+---------------------------------------------+ + * | *DATA_WIDTH* | 32 | Width of the HWPE-Stream streams. | + * +------------------+----------------+---------------------------------------------+ + * | *STRB_WIDTH* | DATA_WIDTH / 8 | Width of the HWPE-Stream strobe signal. | + * +------------------+----------------+---------------------------------------------+ */ import hwpe_stream_package::*; module hwpe_stream_fence #( parameter int unsigned NB_STREAMS = 2, - parameter int unsigned DATA_WIDTH = 32 + parameter int unsigned DATA_WIDTH = 32, + parameter int unsigned STRB_WIDTH = DATA_WIDTH/8 ) ( input logic clk_i, @@ -59,7 +62,7 @@ module hwpe_stream_fence #( logic out_valid; logic [NB_STREAMS-1:0] fence_state_q, fence_state_d; logic [NB_STREAMS-1:0][DATA_WIDTH-1:0] data_q; - logic [NB_STREAMS-1:0][DATA_WIDTH/8-1:0] strb_q; + logic [NB_STREAMS-1:0][STRB_WIDTH-1:0] strb_q; generate for(genvar ii=0; ii0, the module produces a HWPE-MemDecoupled interface and includes a TCDM FIFO of this depth. | - * +-------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ - * | *DATA_WIDTH* | 32 | Width of input/output streams. | - * +-------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ - * | *LATCH_FIFO* | 0 | If 1, use latches instead of flip-flops (requires special constraints in synthesis). | - * +-------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ - * | *TRANS_CNT* | 16 | Number of bits supported in the transaction counter of the address generator, which will overflow at 2^ `TRANS_CNT`. | - * +-------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ - * | *REALIGNABLE* | 1 | If set to 0, the sink will not support non-word-aligned HWPE-Mem accesses. | - * +-------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | **Name** | **Default** | **Description** | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | *TCDM_FIFO_DEPTH* | 2 | If >0, the module produces a HWPE-MemDecoupled interface and includes a TCDM FIFO of this depth. | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | *DATA_WIDTH* | 32 | Width of input/output streams. | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | *STRB_WIDTH* | DATA_WIDTH / 8 | Width of input/output stream strobe signal. | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | *LATCH_FIFO* | 0 | If 1, use latches instead of flip-flops (requires special constraints in synthesis). | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | *TRANS_CNT* | 16 | Number of bits supported in the transaction counter of the address generator, which will overflow at 2^ `TRANS_CNT`. | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ + * | *REALIGNABLE* | 1 | If set to 0, the sink will not support non-word-aligned HWPE-Mem accesses. | + * +-------------------+----------------+------------------------------------------------------------------------------------------------------------------------+ * * .. tabularcolumns:: |l|l|J| * .. _hwpe_stream_sink_ctrl: @@ -92,6 +94,7 @@ module hwpe_stream_sink #( // Stream interface params parameter int unsigned DATA_WIDTH = 32, + parameter int unsigned STRB_WIDTH = DATA_WIDTH/8, parameter int unsigned NB_TCDM_PORTS = DATA_WIDTH/32, parameter int unsigned REALIGNABLE = 1, parameter int unsigned LATCH_FIFO = 0, @@ -132,7 +135,8 @@ module hwpe_stream_sink ); hwpe_stream_intf_stream #( - .DATA_WIDTH ( DATA_WIDTH ) + .DATA_WIDTH ( DATA_WIDTH ), + .STRB_WIDTH ( STRB_WIDTH ) ) realigned_stream ( .clk ( clk_realign_gated ) ); @@ -142,6 +146,7 @@ module hwpe_stream_sink hwpe_stream_split #( .DATA_WIDTH_IN ( DATA_WIDTH ), + .STRB_WIDTH_IN ( STRB_WIDTH ), .NB_OUT_STREAMS( NB_TCDM_PORTS ) ) i_stream_split ( .clk_i ( clk_i ), @@ -179,7 +184,8 @@ module hwpe_stream_sink generate if (REALIGNABLE) begin : realign_gen hwpe_stream_sink_realign #( - .DATA_WIDTH ( DATA_WIDTH ) + .DATA_WIDTH ( DATA_WIDTH ), + .STRB_WIDTH ( STRB_WIDTH ) ) i_realign ( .clk_i ( clk_realign_gated ), .rst_ni ( rst_ni ), diff --git a/rtl/streamer/hwpe_stream_sink_realign.sv b/rtl/streamer/hwpe_stream_sink_realign.sv index e696b93..ffe4024 100644 --- a/rtl/streamer/hwpe_stream_sink_realign.sv +++ b/rtl/streamer/hwpe_stream_sink_realign.sv @@ -23,11 +23,13 @@ * .. _hwpe_stream_sink_realign_params: * .. table:: **hwpe_stream_sink_realign** design-time parameters. * - * +-------------------+-------------+--------------------------------------------------------------------------------------------------------------------------+ - * | **Name** | **Default** | **Description** | - * +-------------------+-------------+--------------------------------------------------------------------------------------------------------------------------+ - * | *DATA_WIDTH* | 32 | Width of input/output streams. | - * +-------------------+-------------+--------------------------------------------------------------------------------------------------------------------------+ + * +-------------------+----------------+--------------------------------------------------------------------------------------------------------------------------+ + * | **Name** | **Default** | **Description** | + * +-------------------+----------------+--------------------------------------------------------------------------------------------------------------------------+ + * | *DATA_WIDTH* | 32 | Width of input/output streams. | + * +-------------------+----------------+--------------------------------------------------------------------------------------------------------------------------+ + * | *STRB_WIDTH* | DATA_WIDTH / 8 | Width of input/output stream strobe signals. | + * +-------------------+----------------+--------------------------------------------------------------------------------------------------------------------------+ * * .. tabularcolumns:: |l|l|J| * .. _hwpe_stream_sink_realign_ctrl: @@ -56,7 +58,8 @@ import hwpe_stream_package::*; module hwpe_stream_sink_realign #( - parameter int unsigned DATA_WIDTH = 32 + parameter int unsigned DATA_WIDTH = 32, + parameter int unsigned STRB_WIDTH = DATA_WIDTH/8 ) ( input logic clk_i, @@ -66,27 +69,27 @@ module hwpe_stream_sink_realign #( input ctrl_realign_t ctrl_i, - input logic [DATA_WIDTH/8-1:0] strb_i, + input logic [STRB_WIDTH-1:0] strb_i, hwpe_stream_intf_stream.sink push_i, hwpe_stream_intf_stream.source pop_o ); - logic [DATA_WIDTH/8-1:0] strb_q; - logic unsigned [$clog2(DATA_WIDTH/8):0] strb_rotate_inv_d; - logic unsigned [$clog2(DATA_WIDTH/8):0] strb_rotate_inv_q; - logic unsigned [$clog2(DATA_WIDTH/8):0] strb_rotate_d; - logic unsigned [$clog2(DATA_WIDTH/8):0] strb_rotate_q; - logic unsigned [$clog2(DATA_WIDTH/8)+3:0] strb_rotate_d_shifted; - logic unsigned [$clog2(DATA_WIDTH/8)+3:0] strb_rotate_q_shifted; - logic unsigned [$clog2(DATA_WIDTH/8)+3:0] strb_rotate_inv_shifted; + logic [STRB_WIDTH-1:0] strb_q; + logic unsigned [$clog2(STRB_WIDTH):0] strb_rotate_inv_d; + logic unsigned [$clog2(STRB_WIDTH):0] strb_rotate_inv_q; + logic unsigned [$clog2(STRB_WIDTH):0] strb_rotate_d; + logic unsigned [$clog2(STRB_WIDTH):0] strb_rotate_q; + logic unsigned [$clog2(STRB_WIDTH)+3:0] strb_rotate_d_shifted; + logic unsigned [$clog2(STRB_WIDTH)+3:0] strb_rotate_q_shifted; + logic unsigned [$clog2(STRB_WIDTH)+3:0] strb_rotate_inv_shifted; logic [DATA_WIDTH-1:0] stream_data_q; - logic [DATA_WIDTH/8-1:0] stream_strb_q; - logic [DATA_WIDTH/8-1:0] stream_strb_latest_q; + logic [STRB_WIDTH-1:0] stream_strb_q; + logic [STRB_WIDTH-1:0] stream_strb_latest_q; logic [DATA_WIDTH-1:0] int_data; logic [DATA_WIDTH-1:0] int_data_q; - logic [DATA_WIDTH/8-1:0] int_strb; - logic [DATA_WIDTH/8-1:0] int_strb_q; + logic [STRB_WIDTH-1:0] int_strb; + logic [STRB_WIDTH-1:0] int_strb_q; logic int_valid; logic int_valid_q; logic int_ready; @@ -121,15 +124,15 @@ module hwpe_stream_sink_realign #( begin strb_rotate_inv_d = '0; if(ctrl_i.first) begin - for (int i=0; i