-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
2,056 additions
and
1,730 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,30 @@ | |
// | ||
// Author: Tim Fischer <[email protected]> | ||
|
||
`include "axi/typedef.svh" | ||
`include "floo_noc/typedef.svh" | ||
|
||
/// Wrapper of a multi-link router for narrow and wide links | ||
module floo_narrow_wide_router | ||
import floo_pkg::*; | ||
import floo_narrow_wide_pkg::*; | ||
#( | ||
parameter int unsigned NumRoutes = NumDirections, | ||
parameter int unsigned NumInputs = NumRoutes, | ||
parameter int unsigned NumOutputs = NumRoutes, | ||
parameter int unsigned ChannelFifoDepth = 0, | ||
parameter int unsigned OutputFifoDepth = 0, | ||
parameter route_algo_e RouteAlgo = XYRouting, | ||
parameter bit XYRouteOpt = 1'b1, | ||
/// Used for ID-based and XY routing | ||
parameter int unsigned IdWidth = 0, | ||
parameter type id_t = logic[IdWidth-1:0], | ||
/// Used for ID-based routing | ||
parameter int unsigned NumAddrRules = 0, | ||
parameter type addr_rule_t = logic | ||
module floo_nw_router #( | ||
Check warning on line 11 in hw/floo_narrow_wide_router.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] hw/floo_narrow_wide_router.sv#L11
Raw output
|
||
parameter floo_pkg::axi_cfg_t AxiCfgN = '0, | ||
parameter floo_pkg::axi_cfg_t AxiCfgW = '0, | ||
parameter floo_pkg::route_algo_e RouteAlgo = floo_pkg::XYRouting, | ||
parameter int unsigned NumRoutes = 0, | ||
parameter int unsigned NumInputs = NumRoutes, | ||
parameter int unsigned NumOutputs = NumRoutes, | ||
parameter int unsigned InFifoDepth = 0, | ||
parameter int unsigned OutFifoDepth = 0, | ||
parameter bit XYRouteOpt = 1'b1, | ||
/// Used for ID-based and XY routing | ||
parameter int unsigned IdWidth = 0, | ||
parameter type id_t = logic[IdWidth-1:0], | ||
parameter type hdr_t = logic, | ||
/// Used for ID-based routing | ||
parameter int unsigned NumAddrRules = 0, | ||
parameter type addr_rule_t = logic, | ||
parameter type floo_req_t = logic, | ||
parameter type floo_rsp_t = logic, | ||
parameter type floo_wide_t = logic | ||
) ( | ||
input logic clk_i, | ||
input logic rst_ni, | ||
|
@@ -34,10 +40,25 @@ module floo_narrow_wide_router | |
input floo_rsp_t [NumOutputs-1:0] floo_rsp_i, | ||
output floo_req_t [NumOutputs-1:0] floo_req_o, | ||
output floo_rsp_t [NumInputs-1:0] floo_rsp_o, | ||
input floo_wide_t [NumRoutes-1:0] floo_wide_i, | ||
output floo_wide_t [NumRoutes-1:0] floo_wide_o | ||
input floo_wide_t [NumRoutes-1:0] floo_wide_i, | ||
output floo_wide_t [NumRoutes-1:0] floo_wide_o | ||
); | ||
|
||
typedef logic [AxiCfgN.AddrWidth-1:0] axi_addr_t; | ||
typedef logic [AxiCfgN.InIdWidth-1:0] axi_narrow_in_id_t; | ||
typedef logic [AxiCfgN.UserWidth-1:0] axi_narrow_user_t; | ||
typedef logic [AxiCfgN.DataWidth-1:0] axi_narrow_data_t; | ||
typedef logic [AxiCfgN.DataWidth/8-1:0] axi_narrow_strb_t; | ||
typedef logic [AxiCfgW.InIdWidth-1:0] axi_wide_in_id_t; | ||
typedef logic [AxiCfgW.UserWidth-1:0] axi_wide_user_t; | ||
typedef logic [AxiCfgW.DataWidth-1:0] axi_wide_data_t; | ||
typedef logic [AxiCfgW.DataWidth/8-1:0] axi_wide_strb_t; | ||
|
||
// (Re-) definitons of `axi_in` and `floo` types, for transport | ||
`AXI_TYPEDEF_ALL_CT(axi_narrow, axi_narrow_req_t, axi_narrow_rsp_t, axi_addr_t, axi_narrow_in_id_t, axi_narrow_data_t, axi_narrow_strb_t, axi_narrow_user_t) | ||
Check warning on line 58 in hw/floo_narrow_wide_router.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] hw/floo_narrow_wide_router.sv#L58
Raw output
|
||
`AXI_TYPEDEF_ALL_CT(axi_wide, axi_wide_req_t, axi_wide_rsp_t, axi_addr_t, axi_wide_in_id_t, axi_wide_data_t, axi_wide_strb_t, axi_wide_user_t) | ||
Check warning on line 59 in hw/floo_narrow_wide_router.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] hw/floo_narrow_wide_router.sv#L59
Raw output
|
||
`FLOO_TYPEDEF_NW_CHAN_ALL(axi, req, rsp, wide, axi_narrow, axi_wide, AxiCfgN, AxiCfgW, hdr_t) | ||
|
||
floo_req_chan_t [NumInputs-1:0] req_in; | ||
floo_rsp_chan_t [NumInputs-1:0] rsp_out; | ||
floo_req_chan_t [NumOutputs-1:0] req_out; | ||
|
@@ -78,19 +99,19 @@ module floo_narrow_wide_router | |
end | ||
|
||
floo_router #( | ||
.NumPhysChannels ( 1 ), | ||
.NumVirtChannels ( 1 ), | ||
.NumInput ( NumInputs ), | ||
.NumOutput ( NumOutputs ), | ||
.flit_t ( floo_req_generic_flit_t ), | ||
.ChannelFifoDepth ( ChannelFifoDepth ), | ||
.OutputFifoDepth ( OutputFifoDepth ), | ||
.RouteAlgo ( RouteAlgo ), | ||
.XYRouteOpt ( XYRouteOpt ), | ||
.IdWidth ( IdWidth ), | ||
.id_t ( id_t ), | ||
.NumAddrRules ( NumAddrRules ), | ||
.addr_rule_t ( addr_rule_t ) | ||
.NumPhysChannels ( 1 ), | ||
.NumVirtChannels ( 1 ), | ||
.NumInput ( NumInputs ), | ||
.NumOutput ( NumOutputs ), | ||
.flit_t ( floo_req_chan_t ), | ||
.InFifoDepth ( InFifoDepth ), | ||
.OutFifoDepth ( OutFifoDepth ), | ||
.RouteAlgo ( RouteAlgo ), | ||
.XYRouteOpt ( XYRouteOpt ), | ||
.IdWidth ( IdWidth ), | ||
.id_t ( id_t ), | ||
.NumAddrRules ( NumAddrRules ), | ||
.addr_rule_t ( addr_rule_t ) | ||
) i_req_floo_router ( | ||
.clk_i, | ||
.rst_ni, | ||
|
@@ -111,8 +132,8 @@ module floo_narrow_wide_router | |
.NumVirtChannels ( 1 ), | ||
.NumInput ( NumInputs ), | ||
.NumOutput ( NumOutputs ), | ||
.ChannelFifoDepth ( ChannelFifoDepth ), | ||
.OutputFifoDepth ( OutputFifoDepth ), | ||
.InFifoDepth ( InFifoDepth ), | ||
.OutFifoDepth ( OutFifoDepth ), | ||
.RouteAlgo ( RouteAlgo ), | ||
.XYRouteOpt ( XYRouteOpt ), | ||
.IdWidth ( IdWidth ), | ||
|
@@ -140,8 +161,8 @@ module floo_narrow_wide_router | |
.NumVirtChannels ( 1 ), | ||
.NumRoutes ( NumRoutes ), | ||
.flit_t ( floo_wide_generic_flit_t ), | ||
.ChannelFifoDepth ( ChannelFifoDepth ), | ||
.OutputFifoDepth ( OutputFifoDepth ), | ||
.InFifoDepth ( InFifoDepth ), | ||
.OutFifoDepth ( OutFifoDepth ), | ||
.RouteAlgo ( RouteAlgo ), | ||
.XYRouteOpt ( XYRouteOpt ), | ||
.IdWidth ( IdWidth ), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.