OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk
`include "pronoc_def.v" /********************************************************************** ** File: mesh_torus_noc.v ** ** Copyright (C) 2014-2017 Alireza Monemi ** ** This file is part of ProNoC ** ** ProNoC ( stands for Prototype Network-on-chip) is free software: ** 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, ** either version 2 of the License, or (at your option) any later version. ** ** ProNoC is distributed in the hope that it will be useful, but WITHOUT ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ** or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General ** Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with ProNoC. If not, see . ** ** ** Description: ** the NoC top module. It generate one of the mesh, torus, ring, or line topologies by ** connecting routers ** **************************************************************/ `define router_id(x,y) ((y * NX) + x) `define endp_id(x,y,l) ((y * NX) + x) * NL + l module mesh_torus_noc_top #( parameter NOC_ID=0 ) ( reset, clk, chan_in_all, chan_out_all, router_event ); `NOC_CONF input clk,reset; //Endpoints ports input smartflit_chanel_t chan_in_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 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]; wire [RAw-1 : 0] current_r_addr [NR-1 : 0]; genvar x,y,l; generate /* verilator lint_off WIDTH */ if( TOPOLOGY == "RING" || TOPOLOGY == "LINE") begin : ring_line /* verilator lint_on WIDTH */ for (x=0; x0)begin :not_first_x assign router_chan_in[x][BACKWARD]= router_chan_out [(x-1)][FORWARD]; end else begin :first_x /* verilator lint_off WIDTH */ if(TOPOLOGY == "LINE") begin : line_first_x /* verilator lint_on WIDTH */ assign router_chan_in[x][BACKWARD]={SMARTFLIT_CHANEL_w{1'b0}}; end else begin : ring_first_x assign router_chan_in[x][BACKWARD]= router_chan_out [(NX-1)][FORWARD]; end end // connect other local ports for (l=0; l0) begin : not_first_y assign router_chan_in[`router_id(x,y)][NORTH] = router_chan_out [`router_id(x,(y-1))][SOUTH]; end else begin :first_y /* verilator lint_off WIDTH */ if(TOPOLOGY == "MESH") begin : first_y_mesh /* verilator lint_on WIDTH */ assign router_chan_in[`router_id(x,y)][NORTH] = {SMARTFLIT_CHANEL_w{1'b0}}; /* verilator lint_off WIDTH */ end else if(TOPOLOGY == "TORUS") begin :first_y_torus /* verilator lint_on WIDTH */ assign router_chan_in[`router_id(x,y)][NORTH] = router_chan_out [`router_id(x,(NY-1))][SOUTH]; /* verilator lint_off WIDTH */ end else if(TOPOLOGY == "FMESH") begin : first_y_fmesh //connect to endp /* verilator lint_on WIDTH */ localparam NORTH_ID = NX*NY*NL + x; assign router_chan_in [`router_id(x,y)][NORTH] = chan_in_all [NORTH_ID]; assign chan_out_all [NORTH_ID] = router_chan_out [`router_id(x,y)][NORTH]; end//topology end//y>0 if(x>0)begin :not_first_x assign router_chan_in[`router_id(x,y)][WEST] = router_chan_out [`router_id((x-1),y)][EAST]; end else begin :first_x /* verilator lint_off WIDTH */ if(TOPOLOGY == "MESH") begin :first_x_mesh /* verilator lint_on WIDTH */ assign router_chan_in[`router_id(x,y)][WEST] = {SMARTFLIT_CHANEL_w{1'b0}}; /* verilator lint_off WIDTH */ end else if(TOPOLOGY == "TORUS") begin :first_x_torus /* verilator lint_on WIDTH */ assign router_chan_in[`router_id(x,y)][WEST] = router_chan_out [`router_id((NX-1),y)][EAST] ; /* verilator lint_off WIDTH */ end else if(TOPOLOGY == "FMESH") begin : first_x_fmesh //connect to endp /* verilator lint_on WIDTH */ localparam WEST_ID = NX*NY*NL +2*NX + y; assign router_chan_in [`router_id(x,y)][WEST] = chan_in_all [WEST_ID]; assign chan_out_all [WEST_ID] = router_chan_out [`router_id(x,y)][WEST]; end//topology end if(y < NY-1) begin : firsty assign router_chan_in[`router_id(x,y)][SOUTH] = router_chan_out [`router_id(x,(y+1))][NORTH]; end else begin : lasty /* verilator lint_off WIDTH */ if(TOPOLOGY == "MESH") begin :ly_mesh /* verilator lint_on WIDTH */ assign router_chan_in[`router_id(x,y)][SOUTH]= {SMARTFLIT_CHANEL_w{1'b0}}; /* verilator lint_off WIDTH */ end else if(TOPOLOGY == "TORUS") begin :ly_torus /* verilator lint_on WIDTH */ assign router_chan_in[`router_id(x,y)][SOUTH]= router_chan_out [`router_id(x,0)][NORTH]; end else if(TOPOLOGY == "FMESH") begin : ly_fmesh //connect to endp /* verilator lint_on WIDTH */ localparam SOUTH_ID = NX*NY*NL + NX + x; assign router_chan_in [`router_id(x,y)][SOUTH] = chan_in_all [SOUTH_ID]; assign chan_out_all [SOUTH_ID] = router_chan_out [`router_id(x,y)][SOUTH]; end//topology end // endpoint(s) connection // connect other local ports for (l=0; l

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [rtl/] [src_noc/] [mesh_torus_noc_top.sv] - Blame information for rev 56

Details | Compare with Previous | View Log

Line No. Rev Author Line

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.