Skip to content

Commit 589ef14

Browse files
authored
hw: Improve parametrization, rename cluster tile (#14)
* cfg(floogen): Add description for address ranges * make: Adapt to new `floogen` CLI * deps: Bump dependencies * hw: Improve parametrization * hw: Rename `sparta_tile` to `cluster_tile` * pd: Bump commit * deps: Bump FlooNoC * hw(pkg): Fix mesh output width of `get_mesh_dim` function * deps: Bump FlooNoC
1 parent 235b47b commit 589ef14

7 files changed

+65
-47
lines changed

Bender.lock

+9-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ packages:
2424
- common_verification
2525
- tech_cells_generic
2626
axi_llc:
27-
revision: 559bcbd09a5a884dbe31e2d72fd95d024e357f39
28-
version: 0.2.1
27+
revision: 59bb8a681347e1133f11a82190fbf4bc11900d9e
28+
version: 0.2.2
2929
source:
3030
Git: https://github.com/pulp-platform/axi_llc.git
3131
dependencies:
@@ -120,8 +120,8 @@ packages:
120120
- scm
121121
- tech_cells_generic
122122
common_cells:
123-
revision: c27bce39ebb2e6bae52f60960814a2afca7bd4cb
124-
version: 1.37.0
123+
revision: 9afda9abb565971649c2aa0985639c096f351171
124+
version: 1.38.0
125125
source:
126126
Git: https://github.com/pulp-platform/common_cells.git
127127
dependencies:
@@ -151,7 +151,7 @@ packages:
151151
dependencies:
152152
- axi
153153
floo_noc:
154-
revision: 5c2762f2e02017d50b5a35ee2d076a23af4b2d07
154+
revision: 38a1b70fa9f94a85da5910defdd0e60fea9ab4c0
155155
version: null
156156
source:
157157
Git: https://github.com/pulp-platform/FlooNoC.git
@@ -233,11 +233,12 @@ packages:
233233
- common_cells
234234
- tech_cells_generic
235235
scm:
236-
revision: 998466d2a3c2d7d572e43d2666d93c4f767d8d60
237-
version: 1.1.1
236+
revision: 472f99affe44ff7b282b519c047a3cfeb35b16c6
237+
version: 1.2.0
238238
source:
239239
Git: https://github.com/pulp-platform/scm.git
240-
dependencies: []
240+
dependencies:
241+
- tech_cells_generic
241242
serial_link:
242243
revision: c55df03a1da06b00e567cf968b1b1a5f40c9f802
243244
version: 1.1.2

Bender.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ sources:
2020
# package. Files in level 1 only depend on files in level 0, files in level 2 on files in
2121
# levels 1 and 0, etc. Files within a level are ordered alphabetically.
2222
# Level 0
23-
- .generated/floo_picobello_noc.sv
23+
- .generated/floo_picobello_noc_pkg.sv
2424
# Level 1
2525
- hw/picobello_pkg.sv
2626
# Level 2
27-
- hw/sparta_tile.sv
27+
- hw/cluster_tile.sv
2828
- hw/cheshire_tile.sv
2929
- hw/mem_tile.sv
3030
# Level 3

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ FLOO_ROOT = $(shell $(BENDER) path floo_noc)
6767
FLOO_GEN ?= floogen
6868
FLOO_CFG = $(PB_ROOT)/cfg/picobello_noc.yml
6969

70-
floo-hw-all: $(PB_GEN_DIR)/floo_picobello_noc.sv
71-
$(PB_GEN_DIR)/floo_picobello_noc.sv: $(FLOO_CFG) | $(PB_GEN_DIR)
72-
$(FLOO_GEN) -c $(FLOO_CFG) -o $(PB_GEN_DIR) $(FLOO_GEN_ARGS)
70+
floo-hw-all: $(PB_GEN_DIR)/floo_picobello_noc_pkg.sv
71+
$(PB_GEN_DIR)/floo_picobello_noc_pkg.sv: $(FLOO_CFG) | $(PB_GEN_DIR)
72+
$(FLOO_GEN) -c $(FLOO_CFG) -o $(PB_GEN_DIR) --only-pkg
7373

7474
floo-clean:
75-
rm -rf $(PB_GEN_DIR)/floo_picobello_noc.sv
75+
rm -rf $(PB_GEN_DIR)/floo_picobello_noc_pkg.sv
7676

7777
.PHONY: floo-install-floogen
7878
floo-install-floogen:
@@ -83,7 +83,7 @@ floo-install-floogen:
8383
###################
8484

8585
PD_REMOTE ?= [email protected]:picobello/picobello-pd.git
86-
PD_COMMIT ?= cd9f7dd2be136b02a620a99126c3e0c2c659e98f
86+
PD_COMMIT ?= b1a84dd3a762ce8d3837c540d9afd8605b1d05e7
8787
PD_DIR = $(PB_ROOT)/pd
8888

8989
.PHONY: init-pd clean-pd
@@ -105,7 +105,7 @@ clean-pd:
105105
PB_HW_ALL += $(CHS_HW_ALL)
106106
PB_HW_ALL += $(CHS_SIM_ALL)
107107
PB_HW_ALL += $(SN_GEN_DIR)/snitch_cluster_wrapper.sv
108-
PB_HW_ALL += $(PB_GEN_DIR)/floo_picobello_noc.sv
108+
PB_HW_ALL += $(PB_GEN_DIR)/floo_picobello_noc_pkg.sv
109109

110110
.PHONY: picobello-hw-all picobello-clean clean
111111

cfg/picobello_noc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ endpoints:
5656
addr_range:
5757
- start: 0x0000_0000
5858
end: 0x2000_0000
59+
desc: "internal"
5960
- start: 0x8000_0000
6061
end: 0x2_0000_0000
62+
desc: "external"
6163
mgr_port_protocol:
6264
- "narrow_in"
6365
sbr_port_protocol:

hw/sparta_tile.sv hw/cluster_tile.sv

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
`include "axi/assign.svh"
88

9-
module sparta_tile
9+
module cluster_tile
1010
import floo_pkg::*;
1111
import floo_picobello_noc_pkg::*;
1212
import picobello_pkg::*;

hw/picobello_pkg.sv

+24-9
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,32 @@ package picobello_pkg;
1919
// FlooNoC //
2020
///////////////
2121

22-
// TODO: make this better parametrizable
23-
localparam int unsigned NumXMesh = 3;
24-
localparam int unsigned NumYMesh = 2;
22+
typedef struct packed {
23+
int unsigned x;
24+
int unsigned y;
25+
} mesh_dim_t;
26+
27+
function automatic mesh_dim_t get_mesh_dim();
28+
mesh_dim_t tile_id_max = '{x: 0, y: 0};
29+
mesh_dim_t tile_id_min = '{x: '1, y: '1};
30+
for (int i = 0; i < SamNumRules; i++) begin
31+
tile_id_max.x = max(tile_id_max.x, int'(Sam[i].idx.x));
32+
tile_id_max.y = max(tile_id_max.y, int'(Sam[i].idx.y));
33+
tile_id_min.x = min(tile_id_min.x, int'(Sam[i].idx.x));
34+
tile_id_min.y = min(tile_id_min.y, int'(Sam[i].idx.y));
35+
end
36+
return '{x: tile_id_max.x - tile_id_min.x + 1,
37+
y: tile_id_max.y - tile_id_min.y + 1};
38+
endfunction
39+
40+
localparam mesh_dim_t MeshDim = get_mesh_dim();
41+
localparam int unsigned NumTiles = MeshDim.x * MeshDim.y;
2542
localparam int unsigned NumClusters = Cheshire - ClusterX0Y0;
26-
localparam int unsigned NumTiles = NumXMesh * NumYMesh;
2743

2844
// Whether the connection is a tie-off or a valid neighbor
2945
function automatic bit is_tie_off(int x, int y, route_direction_e dir);
30-
return (x == 0 && dir == West) || (x == NumXMesh-1 && dir == East) ||
31-
(y == 0 && dir == South) || (y == NumYMesh-1 && dir == North);
46+
return (x == 0 && dir == West) || (x == MeshDim.x-1 && dir == East) ||
47+
(y == 0 && dir == South) || (y == MeshDim.y-1 && dir == North);
3248
endfunction
3349

3450
// Returns the X-coordinate of the neighbor in the given direction
@@ -47,7 +63,7 @@ package picobello_pkg;
4763
endfunction
4864

4965
// Returns the address size of a FlooNoC endpoint
50-
function automatic int unsigned ep_addr_size(ep_id_e ep);
66+
function automatic int unsigned ep_addr_size(sam_idx_e ep);
5167
return Sam[ep].end_addr - Sam[ep].start_addr;
5268
endfunction
5369

@@ -91,8 +107,7 @@ package picobello_pkg;
91107
// Mem Tile //
92108
////////////////
93109

94-
// TODO(fischeti): Fix the index in FlooGen
95110
// The L2 SPM memory size of every mem tile
96-
localparam int unsigned MemTileSize = ep_addr_size(ep_id_e'(L2Spm+1));
111+
localparam int unsigned MemTileSize = ep_addr_size(L2SpmSamIdx);
97112

98113
endpackage

hw/picobello_top.sv

+21-21
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,13 @@ module picobello_top
5959
output logic [SlinkNumChan-1:0][SlinkNumLanes-1:0] slink_o
6060
);
6161

62-
localparam int unsigned NumClusters = Cheshire - ClusterX0Y0;
62+
floo_req_t [MeshDim.x-1:0][MeshDim.y-1:0][West:North] floo_req_in, floo_req_out;
63+
floo_rsp_t [MeshDim.x-1:0][MeshDim.y-1:0][West:North] floo_rsp_in, floo_rsp_out;
64+
floo_wide_t [MeshDim.x-1:0][MeshDim.y-1:0][West:North] floo_wide_in, floo_wide_out;
6365

64-
floo_req_t [NumXMesh-1:0][NumYMesh-1:0][West:North] floo_req_in, floo_req_out;
65-
floo_rsp_t [NumXMesh-1:0][NumYMesh-1:0][West:North] floo_rsp_in, floo_rsp_out;
66-
floo_wide_t [NumXMesh-1:0][NumYMesh-1:0][West:North] floo_wide_in, floo_wide_out;
67-
68-
69-
//////////////////
70-
// SPARTA tiles //
71-
//////////////////
66+
///////////////////
67+
// Cluster tiles //
68+
///////////////////
7269

7370
logic [NumClusters-1:0][NrCores-1:0] debug_req, meip, mtip, msip;
7471

@@ -78,13 +75,16 @@ module picobello_top
7875
assign mtip = '0;
7976
assign msip = '0;
8077

81-
for (genvar c = int'(ClusterX0Y0); c < ClusterX0Y0 + NumClusters; c++) begin : gen_clusters
78+
for (genvar c = 0; c < NumClusters; c++) begin : gen_clusters
8279

83-
localparam int X = int'(Sam[c].idx.x);
84-
localparam int Y = int'(Sam[c].idx.y);
85-
localparam int unsigned HartBaseId = (c - ClusterX0Y0) * NrCores;
80+
localparam int ClusterSamIdx = c + ClusterX0Y0SamIdx;
81+
localparam id_t ClusterId = Sam[ClusterSamIdx].idx;
82+
localparam int X = int'(ClusterId.x);
83+
localparam int Y = int'(ClusterId.y);
84+
localparam int unsigned HartBaseId = c * NrCores;
85+
localparam axi_wide_in_addr_t ClusterBaseAddr = Sam[ClusterSamIdx].start_addr;
8686

87-
sparta_tile i_sparta_tile (
87+
cluster_tile i_cluster_tile (
8888
.clk_i,
8989
.rst_ni,
9090
.test_enable_i ( test_mode_i ),
@@ -93,8 +93,8 @@ module picobello_top
9393
.mtip_i ( mtip[c] ),
9494
.msip_i ( msip[c] ),
9595
.hart_base_id_i ( HartBaseId[9:0] ),
96-
.cluster_base_addr_i ( Sam[c].start_addr ),
97-
.id_i ( Sam[c].idx ),
96+
.cluster_base_addr_i ( ClusterBaseAddr ),
97+
.id_i ( ClusterId ),
9898
.floo_req_o ( floo_req_out[X][Y] ),
9999
.floo_rsp_i ( floo_rsp_in[X][Y] ),
100100
.floo_wide_o ( floo_wide_out[X][Y] ),
@@ -113,7 +113,7 @@ module picobello_top
113113
logic [iomsb(CheshireCfg.NumExtIrqHarts):0] mtip_ext;
114114
logic [iomsb(CheshireCfg.NumExtIrqHarts):0] msip_ext;
115115

116-
localparam id_t CheshireId = Sam[Cheshire].idx;
116+
localparam id_t CheshireId = Sam[CheshireInternalSamIdx].idx;
117117

118118
cheshire_tile i_cheshire_tile (
119119
.clk_i,
@@ -166,12 +166,12 @@ module picobello_top
166166
.floo_rsp_o (floo_rsp_out[CheshireId.x][CheshireId.y]),
167167
.floo_wide_i (floo_wide_in[CheshireId.x][CheshireId.y])
168168
);
169+
169170
//////////////
170171
// Mem tile //
171172
//////////////
172173

173-
// TODO(fischeti): Make this better parametrizable
174-
localparam id_t MemTileId = Sam[L2Spm+1].idx;
174+
localparam id_t MemTileId = Sam[L2SpmSamIdx].idx;
175175

176176
mem_tile i_mem_tile (
177177
.clk_i,
@@ -190,8 +190,8 @@ module picobello_top
190190
// NoC Connections //
191191
/////////////////////
192192

193-
for (genvar x = 0; x < NumXMesh; x++) begin : gen_x
194-
for (genvar y = 0; y < NumYMesh; y++) begin : gen_y
193+
for (genvar x = 0; x < MeshDim.x; x++) begin : gen_x
194+
for (genvar y = 0; y < MeshDim.y; y++) begin : gen_y
195195
for (genvar d = int'(North); d <= int'(West); d++) begin : gen_dir
196196
localparam route_direction_e Dir = route_direction_e'(d);
197197
if (is_tie_off(x, y, Dir)) begin : gen_tie_off

0 commit comments

Comments
 (0)