//====================================================================== // // Copyright (c) 2019, NORDUnet A/S All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // - Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // - Neither the name of the NORDUnet nor the names of its contributors may // be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // //====================================================================== module modexpng_recombinator_block ( clk, rst_n, ena, rdy, fsm_state_next, word_index_last, dsp_xy_ce_p, dsp_x_p, dsp_y_p, col_index, col_index_last, rd_narrow_xy_addr, rd_narrow_xy_bank, rcmb_wide_xy_bank, rcmb_wide_xy_addr, rcmb_wide_x_dout, rcmb_wide_y_dout, rcmb_wide_xy_valid, rcmb_narrow_xy_bank, rcmb_narrow_xy_addr, rcmb_narrow_x_dout, rcmb_narrow_y_dout, rcmb_narrow_xy_valid, rdct_narrow_xy_bank, rdct_narrow_xy_addr, rdct_narrow_x_dout, rdct_narrow_y_dout, rdct_narrow_xy_valid ); // // Headers // `include "modexpng_parameters.vh" `include "modexpng_mmm_dual_fsm.vh" input clk; input rst_n; input ena; output rdy; input [MMM_FSM_STATE_W -1:0] fsm_state_next; input [ OP_ADDR_W -1:0] word_index_last; input dsp_xy_ce_p; input [ MAC_W * NUM_MULTS_AUX -1:0] dsp_x_p; input [ MAC_W * NUM_MULTS_AUX -1:0] dsp_y_p; input [ COL_INDEX_W -1:0] col_index; input [ COL_INDEX_W -1:0] col_index_last; input [ BANK_ADDR_W -1:0] rd_narrow_xy_bank; input [ OP_ADDR_W -1:0] rd_narrow_xy_addr; output [ BANK_ADDR_W -1:0] rcmb_wide_xy_bank; output [ OP_ADDR_W -1:0] rcmb_wide_xy_addr; output [ WORD_EXT_W -1:0] rcmb_wide_x_dout; output [ WORD_EXT_W -1:0] rcmb_wide_y_dout; output rcmb_wide_xy_valid; output [ BANK_ADDR_W -1:0] rcmb_narrow_xy_bank; output [ OP_ADDR_W -1:0] rcmb_narrow_xy_addr; output [ WORD_EXT_W -1:0] rcmb_narrow_x_dout; output [ WORD_EXT_W -1:0] rcmb_narrow_y_dout; output rcmb_narrow_xy_valid; output [ BANK_ADDR_W -1:0] rdct_narrow_xy_bank; output [ OP_ADDR_W -1:0] rdct_narrow_xy_addr; output [ WORD_EXT_W -1:0] rdct_narrow_x_dout; output [ WORD_EXT_W -1:0] rdct_narrow_y_dout; output rdct_narrow_xy_valid; // // Latches // reg [MAC_W-1:0] dsp_x_p_latch[0:NUM_MULTS_AUX-1]; reg [MAC_W-1:0] dsp_y_p_latch[0:NUM_MULTS_AUX-1]; // // Mapping // wire [MAC_W-1:0] dsp_x_p_split[0:NUM_MULTS_AUX-1]; wire [MAC_W-1:0] dsp_y_p_split[0:NUM_MULTS_AUX-1]; genvar z; generate for (z=0; z