Line 6... |
Line 6... |
|
|
|
|
/**********************************************************************
|
/**********************************************************************
|
** File: /home/alireza/work/git/hca_git/ProNoC/mpsoc/rtl/src_topolgy/custom1/custom1_noc_genvar.sv
|
** File: /home/alireza/work/git/hca_git/ProNoC/mpsoc/rtl/src_topolgy/custom1/custom1_noc_genvar.sv
|
**
|
**
|
** Copyright (C) 2014-2019 Alireza Monemi
|
** Copyright (C) 2014-2021 Alireza Monemi
|
**
|
**
|
** This file is part of ProNoC 1.9.1
|
** This file is part of ProNoC 2.0.0
|
**
|
**
|
** ProNoC ( stands for Prototype Network-on-chip) is free software:
|
** ProNoC ( stands for Prototype Network-on-chip) is free software:
|
** you can redistribute it and/or modify it under the terms of the GNU
|
** you can redistribute it and/or modify it under the terms of the GNU
|
** Lesser General Public License as published by the Free Software Foundation,
|
** Lesser General Public License as published by the Free Software Foundation,
|
** either version 2 of the License, or (at your option) any later version.
|
** either version 2 of the License, or (at your option) any later version.
|
Line 24... |
Line 24... |
**
|
**
|
** You should have received a copy of the GNU Lesser General Public
|
** You should have received a copy of the GNU Lesser General Public
|
** License along with ProNoC. If not, see .
|
** License along with ProNoC. If not, see .
|
******************************************************************************/
|
******************************************************************************/
|
|
|
|
`include "pronoc_def.v"
|
|
|
module custom1_noc_genvar
|
module custom1_noc_genvar
|
import pronoc_pkg::*;
|
import pronoc_pkg::*;
|
(
|
(
|
|
|
reset,
|
reset,
|
clk,
|
clk,
|
chan_in_all,
|
chan_in_all,
|
chan_out_all
|
chan_out_all,
|
|
router_event
|
);
|
);
|
|
|
function integer log2;
|
function integer log2;
|
input integer number; begin
|
input integer number; begin
|
log2=(number <=1) ? 1: 0;
|
log2=(number <=1) ? 1: 0;
|
Line 56... |
Line 59... |
input reset;
|
input reset;
|
input clk;
|
input clk;
|
input smartflit_chanel_t chan_in_all [NE-1 : 0];
|
input smartflit_chanel_t chan_in_all [NE-1 : 0];
|
output smartflit_chanel_t chan_out_all [NE-1 : 0];
|
output smartflit_chanel_t chan_out_all [NE-1 : 0];
|
|
|
|
//Events
|
|
output router_event_t router_event [NR-1 : 0][MAX_P-1 : 0];
|
|
|
//all routers port
|
//all routers port
|
smartflit_chanel_t router_chan_in [NR-1 :0][MAX_P-1 : 0];
|
smartflit_chanel_t router_chan_in [NR-1 :0][MAX_P-1 : 0];
|
smartflit_chanel_t router_chan_out [NR-1 :0][MAX_P-1 : 0];
|
smartflit_chanel_t router_chan_out [NR-1 :0][MAX_P-1 : 0];
|
|
|
|
|
wire [RAw-1 : 0] current_r_addr [NR-1 : 0];
|
wire [RAw-1 : 0] current_r_addr [NR-1 : 0];
|
|
|
|
|
|
|
|
|
Line 74... |
Line 81... |
|
|
genvar i;
|
genvar i;
|
generate
|
generate
|
|
|
for( i=0; i<4; i=i+1) begin : router_3_port_lp
|
for( i=0; i<4; i=i+1) begin : router_3_port_lp
|
|
localparam RID = i;
|
|
assign current_r_addr [RID] = RID[RAw-1: 0];
|
|
|
router_top #(
|
router_top #(
|
.P(3)
|
.P(3)
|
)
|
)
|
router_3_port
|
router_3_port
|
(
|
(
|
.clk(clk),
|
.clk(clk),
|
.reset(reset),
|
.reset(reset),
|
.current_r_addr(i),
|
.current_r_id(RID),
|
.chan_in (router_chan_in[i]),
|
.current_r_addr(current_r_addr[RID]),
|
.chan_out (router_chan_out[i])
|
.chan_in (router_chan_in [RID] [2 : 0]),
|
|
.chan_out (router_chan_out[RID] [2 : 0]),
|
|
.router_event(router_event[RID] [2 : 0])
|
);
|
);
|
|
|
|
|
|
|
end
|
end
|
|
|
for( i=0; i<8; i=i+1) begin : router_4_port_lp
|
for( i=0; i<8; i=i+1) begin : router_4_port_lp
|
|
localparam RID = i+4;
|
|
assign current_r_addr [RID] = RID[RAw-1: 0];
|
|
|
router_top #(
|
router_top #(
|
.P(4)
|
.P(4)
|
)
|
)
|
router_4_port
|
router_4_port
|
(
|
(
|
.clk(clk),
|
.clk(clk),
|
.reset(reset),
|
.reset(reset),
|
.current_r_addr(i+4),
|
.current_r_id(RID),
|
.chan_in (router_chan_in[i+4]),
|
.current_r_addr(current_r_addr[RID]),
|
.chan_out (router_chan_out[i+4])
|
.chan_in (router_chan_in [RID] [3 : 0]),
|
|
.chan_out (router_chan_out[RID] [3 : 0]),
|
|
.router_event(router_event[RID] [3 : 0])
|
);
|
);
|
|
|
|
|
|
|
end
|
end
|
|
|
for( i=0; i<4; i=i+1) begin : router_5_port_lp
|
for( i=0; i<4; i=i+1) begin : router_5_port_lp
|
|
localparam RID = i+12;
|
|
assign current_r_addr [RID] = RID[RAw-1: 0];
|
|
|
router_top #(
|
router_top #(
|
.P(5)
|
.P(5)
|
)
|
)
|
router_5_port
|
router_5_port
|
(
|
(
|
.clk(clk),
|
.clk(clk),
|
.reset(reset),
|
.reset(reset),
|
.current_r_addr(i+12),
|
.current_r_id(RID),
|
.chan_in (router_chan_in[i+12]),
|
.current_r_addr(current_r_addr[RID]),
|
.chan_out (router_chan_out[i+12])
|
.chan_in (router_chan_in [RID] [4 : 0]),
|
|
.chan_out (router_chan_out[RID] [4 : 0]),
|
|
.router_event(router_event[RID] [4 : 0])
|
);
|
);
|
|
|
|
|
|
|
end
|
end
|