Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ variables:
# Collect bender sourcess
- bender checkout
# Install the python venv
- make python-venv
- source iis-env.sh
# Initialize the PD repository
- make init-pd
cache:
Expand Down
4 changes: 2 additions & 2 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ packages:
dependencies:
- common_cells
common_cells:
revision: e1c09c75775c5f03eb45906d5145dbd2f5bcfb95
revision: ce5344d6a1ab313b791c1bea161c1e1052ffe2f0
version: null
source:
Git: https://github.com/pulp-platform/common_cells.git
Expand Down Expand Up @@ -207,7 +207,7 @@ packages:
Path: .deps/fhg_spu_cluster
dependencies: []
floo_noc:
revision: ea35a9909d60d552bbdafc7e898590f326b1898a
revision: 7780dd43c3776d89f00047c5797f1562cba9e3ae
version: null
source:
Git: https://github.com/pulp-platform/FlooNoC.git
Expand Down
2 changes: 1 addition & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", rev: "snitch" }
cheshire: { git: "https://github.com/pulp-platform/cheshire.git", rev: "picobello" }
snitch_cluster: { git: "https://github.com/pulp-platform/snitch_cluster.git", rev: "5d6c957c70e3824e2330d8308eb904724cd41cbe" }
floo_noc: { git: "https://github.com/pulp-platform/FlooNoC.git", rev: "develop" }
floo_noc: { git: "https://github.com/pulp-platform/FlooNoC.git", rev: "floogen-mcast" }
obi: { git: "https://github.com/pulp-platform/obi.git", rev: "acfcd0f80c7539aa8da7821a66d9acf2074a5b4e" }
redmule: { git: "https://github.com/pulp-platform/redmule.git", rev: "picobello" }
hci: { git: "https://github.com/pulp-platform/hci.git", rev: "06fcba671e060f2e1b03b7ebe2d3e719f1557099" }
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ SN_GEN_DIR = $(PB_GEN_DIR)
include $(SN_ROOT)/make/common.mk
include $(SN_ROOT)/make/rtl.mk

$(SN_CFG): $(FLOO_CFG)
@sed -i 's/nr_clusters: .*/nr_clusters: $(SN_CLUSTERS),/' $<

.PHONY: sn-hw-clean sn-hw-all

sn-hw-all: $(SN_CLUSTER_WRAPPER) $(SN_CLUSTER_PKG)
Expand All @@ -116,9 +119,6 @@ sn-hw-clean:
###########
# FlooNoC #
###########
.PHONY: update-sn-cfg
update-sn-cfg: $(SN_CFG)
@sed -i 's/nr_clusters: .*/nr_clusters: $(SN_CLUSTERS),/' $<

.PHONY: floo-hw-all floo-clean

Expand Down Expand Up @@ -174,7 +174,7 @@ PB_HW_ALL += $(CHS_HW_ALL)
PB_HW_ALL += $(CHS_SIM_ALL)
PB_HW_ALL += $(PB_GEN_DIR)/floo_picobello_noc_pkg.sv
PB_HW_ALL += $(PB_RDL_HW_ALL)
PB_HW_ALL += update-sn-cfg
PB_HW_ALL += $(SN_CFG)

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

Expand Down
17 changes: 13 additions & 4 deletions cfg/picobello_noc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,36 @@ protocols:
data_width: 64
addr_width: 48
id_width: 5
user_width: 3
user_width:
mcast_mask: 48
user: 5
- name: "narrow_out"
type: "narrow"
protocol: "AXI4"
data_width: 64
addr_width: 48
id_width: 2
user_width: 3
user_width:
mcast_mask: 48
user: 5
- name: "wide_in"
type: "wide"
protocol: "AXI4"
data_width: 512
addr_width: 48
id_width: 3
user_width: 1
user_width:
mcast_mask: 48
user: 1
- name: "wide_out"
type: "wide"
protocol: "AXI4"
data_width: 512
addr_width: 48
id_width: 1
user_width: 1
user_width:
mcast_mask: 48
user: 1

endpoints:
- name: "cluster"
Expand All @@ -48,6 +56,7 @@ endpoints:
base: 0x2000_0000
size: 0x0004_0000
rdl_name: "snitch_cluster"
en_multicast: true
mgr_port_protocol:
- "narrow_in"
- "wide_in"
Expand Down
10 changes: 5 additions & 5 deletions hw/cluster_tile.sv
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ module cluster_tile
.RouteCfg (floo_picobello_noc_pkg::RouteCfg),
.AtopSupport (1'b1),
.MaxAtomicTxns (1),
.Sam (picobello_pkg::SamMcast),
.Sam (floo_picobello_noc_pkg::McastSam),
.id_t (floo_picobello_noc_pkg::id_t),
.rob_idx_t (floo_picobello_noc_pkg::rob_idx_t),
.hdr_t (floo_picobello_noc_pkg::hdr_t),
.sam_rule_t (picobello_pkg::sam_multicast_rule_t),
.sam_idx_t (picobello_pkg::sam_idx_t),
.mask_sel_t (picobello_pkg::mask_sel_t),
.sam_rule_t (floo_picobello_noc_pkg::mcast_sam_rule_t),
.sam_idx_t (floo_picobello_noc_pkg::mcast_idx_t),
.mask_sel_t (floo_picobello_noc_pkg::mcast_mask_sel_t),
.axi_narrow_in_req_t (snitch_cluster_pkg::narrow_out_req_t),
.axi_narrow_in_rsp_t (snitch_cluster_pkg::narrow_out_resp_t),
.axi_narrow_out_req_t(snitch_cluster_pkg::narrow_in_req_t),
Expand All @@ -278,7 +278,7 @@ module cluster_tile
.floo_rsp_t (floo_picobello_noc_pkg::floo_rsp_t),
.floo_wide_t (floo_picobello_noc_pkg::floo_wide_t),
.sram_cfg_t (snitch_cluster_pkg::sram_cfg_t),
.user_struct_t (picobello_pkg::mcast_user_t)
.user_struct_t (floo_picobello_noc_pkg::mcast_axi_narrow_in_user_t)
) i_chimney (
.clk_i (tile_clk),
.rst_ni (tile_rst_n),
Expand Down
136 changes: 0 additions & 136 deletions hw/picobello_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -245,104 +245,6 @@ package picobello_pkg;
// MULTICAST //
/////////////////////

// Helper functions to support the multicast feature.
//
// The original System Address Map (SAM) must be modified to encode, within the `idx` field,
// additional information needed to translate the address base mask into an X/Y coordinate-based mask.
//
// The additional fields are:
// - `offset_id_x`: the offset in the tile address where the X coordinate encoding starts
// - `len_id_x`: the number of bits used to encode the X coordinate
// - `offset_id_y`: the offset in the tile address where the Y coordinate encoding starts
// - `len_id_y`: the number of bits used to encode the Y coordinate

// Support multicast only for cluster tiles.
// TODO(lleone): Extend multicast feature for Memory tiles as well
localparam int unsigned NumMcastEndPoints = NumClusters;

typedef logic [aw_bt'(AxiCfgN.AddrWidth)-1:0] user_mask_t;

typedef struct packed {
user_mask_t mcast_mask;
logic [snitch_cluster_pkg::AtomicIdWidth-1:0] atomic;
} mcast_user_t;

typedef struct packed {
logic [5:0] offset;
logic [2:0] len;
logic [2:0] grp_base_id;
} mask_sel_t;

typedef struct packed {
id_t id;
mask_sel_t mask_x;
mask_sel_t mask_y;
} sam_idx_t;

typedef struct packed {
sam_idx_t idx;
logic [aw_bt'(AxiCfgN.AddrWidth)-1:0] start_addr;
logic [aw_bt'(AxiCfgN.AddrWidth)-1:0] end_addr;
} sam_multicast_rule_t;


// Packed original SAM with extra information necessary for multicast handling
function automatic sam_multicast_rule_t [SamNumRules-1:0] get_sam_multicast();
sam_multicast_rule_t [SamNumRules-1:0] sam_multicast;

int unsigned len_id_x, len_id_y;
int unsigned offset_id_x, offset_id_y;
int unsigned empty_cols, empty_rows;
int unsigned tileSize;
// Evaluate where the X and Y node coordinate associated with the multicast endpoints
// are actaully located
// clog2 returns 0 when idx.x = 1. To workaround this problem, separate the case where max idx is 1
len_id_x = (Sam[NumClusters-1].idx.x == 1) ? 1 : $clog2(Sam[NumClusters-1].idx.x);
len_id_y = (Sam[NumClusters-1].idx.y == 1) ? 1 : $clog2(Sam[NumClusters-1].idx.y);
tileSize = ep_addr_size(sam_idx_e'(NumClusters - 1));
offset_id_y = $clog2(tileSize);
offset_id_x = $clog2(tileSize) + len_id_y;

// Evaluate the number of empty columns in the artificial MeshMap.
// From this information calculate the base ID of the first cluster
// in the mutlicast group.

// TODO(lleone): This is a temporary solution. In a fully configurable system,
// the base ID doesn't match with the number of empty rows/columns. This is
// true only in the 7x4 mesh.
empty_cols = $countones(get_empty_cols(MeshMap) + 1);
empty_rows = $countones(get_empty_rows(MeshMap));

for (int rule = 0; rule < SamNumRules; rule++) begin
sam_multicast[rule].idx.id = Sam[rule].idx;
sam_multicast[rule].start_addr = Sam[rule].start_addr;
sam_multicast[rule].end_addr = Sam[rule].end_addr;

// Only Cluster tiles can be target of multicast request.
if (rule < NumMcastEndPoints) begin

// Fill new Sam struct with the extra multicast info
sam_multicast[rule].idx.mask_x = '{
offset: offset_id_x,
len: len_id_x,
grp_base_id: empty_cols
};
sam_multicast[rule].idx.mask_y = '{
offset: offset_id_y,
len: len_id_y,
grp_base_id: empty_rows
};
end else begin
sam_multicast[rule].idx.mask_x = '{offset: '0, len: '0, grp_base_id: 0};
sam_multicast[rule].idx.mask_y = '{offset: '0, len: '0, grp_base_id: 0};
end

end
return sam_multicast;
endfunction

localparam sam_multicast_rule_t [SamNumRules-1:0] SamMcast = get_sam_multicast();

function automatic floo_pkg::route_cfg_t gen_nomcast_route_cfg();
floo_pkg::route_cfg_t ret = floo_picobello_noc_pkg::RouteCfg;
// Disable multicast for non-cluster tiles
Expand All @@ -353,44 +255,6 @@ package picobello_pkg;
// Define no multicast RouteCfg for Memory tiles, Chehsihre and FhG
localparam floo_pkg::route_cfg_t RouteCfgNoMcast = gen_nomcast_route_cfg();

// Print the system address map for th emulticast rules.
// TODO(lleone): Generalize for normal address map
function automatic print_sam_multicast(sam_multicast_rule_t [SamNumRules-1:0] sam_multicast);
$display("\n--- [SAM] System Address Map (%0d entries) ---", SamNumRules);
$display("[");
for (int i = 0; i < SamNumRules; i++) begin
$write(" { idx: { id: {x: %0d, y: %0d, port: %0d},", SamMcast[i].idx.id.x,
SamMcast[i].idx.id.y, SamMcast[i].idx.id.port_id);
$write(" mask_x: {offset: %0d, len: %0d, base_id: %0d},", SamMcast[i].idx.mask_x.offset,
SamMcast[i].idx.mask_x.len, SamMcast[i].idx.mask_x.grp_base_id);
$write(" mask_y: {offset: %0d, len: %0d, base_id: %0d} },", SamMcast[i].idx.mask_y.offset,
SamMcast[i].idx.mask_y.len, SamMcast[i].idx.mask_y.grp_base_id);
$write("start: 0x%0h, end: 0x%0h }\n", SamMcast[i].start_addr, SamMcast[i].end_addr);
end
$display("]");
$display("----------------------------------------------------------");
$display("NumDummyTiles: %0d", NumDummyTiles);
$display("Mesh DIm X: %0d", MeshDim.x);
$display("Mesh DIm Y: %0d", MeshDim.y);
$display("MaxId: {x: %0d, y: %0d}", MaxId.x, MaxId.y);
$display("MinId: {x: %0d, y: %0d}", MinId.x, MinId.y);
for (int row = 0; row <= MaxId.y; row++) begin
for (int col = 0; col <= MaxId.x; col++) begin
$write("%0d ", MeshMap[row][col]);
end
$display("");
end
$display("\n--- Physical System Address Map (%0d entries) ---", SamNumRules);
$display("[");
for (int i = 0; i < SamNumRules; i++) begin
$write(" { idx: { id: {x: %0d, y: %0d, port: %0d},", SamPhysical[i].idx.x,
SamPhysical[i].idx.y, SamPhysical[i].idx.port_id);
$write("start: 0x%0h, end: 0x%0h }\n", SamPhysical[i].start_addr, SamPhysical[i].end_addr);
end
$display("]");
$display("----------------------------------------------------------");
endfunction

////////////////
// Cheshire //
////////////////
Expand Down
10 changes: 5 additions & 5 deletions hw/picobello_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module picobello_top
for (genvar c = 0; c < NumClusters; c++) begin : gen_clusters

localparam int ClusterSamIdx = c + ClusterX0Y0SamIdx;
localparam id_t ClusterId = SamMcast[ClusterSamIdx].idx.id;
localparam id_t ClusterId = McastSam[ClusterSamIdx].idx.id;
localparam id_t ClusterPhysicalId = picobello_pkg::SamPhysical[ClusterSamIdx].idx;
localparam int X = int'(ClusterPhysicalId.x);
localparam int Y = int'(ClusterPhysicalId.y);
Expand Down Expand Up @@ -130,7 +130,7 @@ module picobello_top
logic [ iomsb(CheshireCfg.NumExtIrqHarts):0] mtip_ext;
logic [ iomsb(CheshireCfg.NumExtIrqHarts):0] msip_ext;

localparam id_t CheshireId = SamMcast[CheshireInternalSamIdx].idx.id;
localparam id_t CheshireId = McastSam[CheshireInternalSamIdx].idx.id;
localparam id_t CheshirePhysicalId = SamPhysical[CheshireInternalSamIdx].idx;

cheshire_tile i_cheshire_tile (
Expand Down Expand Up @@ -268,7 +268,7 @@ module picobello_top
for (genvar m = 0; m < NumMemTiles; m++) begin : gen_memtile

localparam int MemTileSamIdx = m + L2Spm0SamIdx;
localparam id_t MemTileId = SamMcast[MemTileSamIdx].idx.id;
localparam id_t MemTileId = McastSam[MemTileSamIdx].idx.id;
localparam id_t MemTilePhysicalId = SamPhysical[MemTileSamIdx].idx;
localparam int MemTileX = int'(MemTilePhysicalId.x);
localparam int MemTileY = int'(MemTilePhysicalId.y);
Expand Down Expand Up @@ -301,7 +301,7 @@ module picobello_top

// Narrow SPM tile
localparam int SpmNarrowTileSamIdx = int'(TopSpmNarrowSamIdx);
localparam id_t SpmNarrowTileId = SamMcast[SpmNarrowTileSamIdx].idx.id;
localparam id_t SpmNarrowTileId = McastSam[SpmNarrowTileSamIdx].idx.id;
localparam id_t SpmNarrowTilePhysicalId = SamPhysical[SpmNarrowTileSamIdx].idx;
localparam int SpmNarrowTileX = int'(SpmNarrowTilePhysicalId.x);
localparam int SpmNarrowTileY = int'(SpmNarrowTilePhysicalId.y);
Expand Down Expand Up @@ -337,7 +337,7 @@ module picobello_top

// Wide SPM tile
localparam int SpmWideTileSamIdx = int'(TopSpmWideSamIdx);
localparam id_t SpmWideTileId = SamMcast[SpmWideTileSamIdx].idx.id;
localparam id_t SpmWideTileId = McastSam[SpmWideTileSamIdx].idx.id;
localparam id_t SpmWideTilePhysicalId = SamPhysical[SpmWideTileSamIdx].idx;
localparam int SpmWideTileX = int'(SpmWideTilePhysicalId.x);
localparam int SpmWideTileY = int'(SpmWideTilePhysicalId.y);
Expand Down
4 changes: 0 additions & 4 deletions target/sim/src/fixture_picobello_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,4 @@ module fixture_picobello_top;
.*
);

initial begin
print_sam_multicast(SamMcast);
end

endmodule