From 668e13753cc6d7af84634840ed76cb10acd75a72 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 5 Jun 2024 15:29:47 +0200 Subject: [PATCH] sw: Integrate the `nr_clusters` in to `cluster` and give default `1` value --- docs/schema/snitch_cluster.schema.json | 5 +++++ target/snitch_cluster/cfg/default.hjson | 3 --- target/snitch_cluster/cfg/fdiv.hjson | 3 --- target/snitch_cluster/cfg/omega.hjson | 3 --- .../sw/runtime/common/snitch_cluster_defs.h.tpl | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/schema/snitch_cluster.schema.json b/docs/schema/snitch_cluster.schema.json index f9d5831ca..8b364d180 100644 --- a/docs/schema/snitch_cluster.schema.json +++ b/docs/schema/snitch_cluster.schema.json @@ -14,6 +14,11 @@ "description": "Optional name for the generated wrapper.", "default": "snitch_cluster" }, + "nr_clusters": { + "type": "number", + "description": "Number of clusters. Only relevant for the SW runtime.", + "default": 1 + }, "boot_addr": { "type": "number", "description": "Address from which all harts of the cluster start to boot. The default setting is `0x8000_0000`.", diff --git a/target/snitch_cluster/cfg/default.hjson b/target/snitch_cluster/cfg/default.hjson index ce30fe6a2..93cb2dbec 100644 --- a/target/snitch_cluster/cfg/default.hjson +++ b/target/snitch_cluster/cfg/default.hjson @@ -4,9 +4,6 @@ // Cluster configuration for a simple testbench system. { - // Needed only for multi-cluster SW environment - nr_clusters: 1, - cluster: { boot_addr: 4096, // 0x1000 cluster_base_addr: 268435456, // 0x1000_0000 diff --git a/target/snitch_cluster/cfg/fdiv.hjson b/target/snitch_cluster/cfg/fdiv.hjson index dce6cb0cb..c58409ef7 100644 --- a/target/snitch_cluster/cfg/fdiv.hjson +++ b/target/snitch_cluster/cfg/fdiv.hjson @@ -4,9 +4,6 @@ // Cluster configuration for a simple testbench system. { - // Needed only for multi-cluster SW environment - nr_clusters: 1, - cluster: { boot_addr: 4096, // 0x1000 cluster_base_addr: 268435456, // 0x1000_0000 diff --git a/target/snitch_cluster/cfg/omega.hjson b/target/snitch_cluster/cfg/omega.hjson index eb78d2af6..65655936a 100644 --- a/target/snitch_cluster/cfg/omega.hjson +++ b/target/snitch_cluster/cfg/omega.hjson @@ -4,9 +4,6 @@ // Cluster configuration for a simple testbench system. { - // Needed only for multi-cluster SW environment - nr_clusters: 1, - cluster: { boot_addr: 4096, // 0x1000 cluster_base_addr: 268435456, // 0x1000_0000 diff --git a/target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h.tpl b/target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h.tpl index 106e83b34..db765ae9c 100644 --- a/target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h.tpl +++ b/target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h.tpl @@ -9,7 +9,7 @@ // Hardware parameters #define SNRT_BASE_HARTID CFG_CLUSTER_BASE_HARTID #define SNRT_CLUSTER_CORE_NUM CFG_CLUSTER_NR_CORES -#define SNRT_CLUSTER_NUM ${cfg['nr_clusters']} +#define SNRT_CLUSTER_NUM ${cfg['cluster']['nr_clusters']} #define SNRT_CLUSTER_DM_CORE_NUM 1 #define SNRT_TCDM_START_ADDR CLUSTER_TCDM_BASE_ADDR #define SNRT_TCDM_SIZE (CLUSTER_PERIPH_BASE_ADDR - CLUSTER_TCDM_BASE_ADDR)