Skip to content

Commit

Permalink
cfg: Merge config + put the nr_clusters parameter in the top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
fischeti authored and colluca committed Aug 1, 2024
1 parent c0b8dc2 commit df6c738
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 31 deletions.
5 changes: 0 additions & 5 deletions docs/schema/snitch_cluster.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
"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`.",
Expand Down
5 changes: 5 additions & 0 deletions docs/schema/snitch_cluster_tb.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"cluster": {
"$ref": "http://pulp-platform.org/snitch_cluster/snitch_cluster.schema.json"
},
"nr_clusters": {
"type": "number",
"description": "Number of clusters. Relevant for the SW runtime.",
"default": 1
},
"dram": {
"title": "DRAM",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion hw/snitch_cluster/test/bootdata.cc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const BootData BOOTDATA = {.boot_addr = ${hex(cfg['cluster']['boot_addr'])},
.tcdm_offset = ${hex(cfg['cluster']['cluster_base_offset'])},
.global_mem_start = ${hex(cfg['dram']['address'])},
.global_mem_end = ${hex(cfg['dram']['address'] + cfg['dram']['length'])},
.cluster_count = ${cfg['cluster']['nr_clusters']},
.cluster_count = ${cfg['nr_clusters']},
.clint_base = ${hex(cfg['peripherals']['clint']['address'])}};

} // namespace sim
3 changes: 1 addition & 2 deletions target/snitch_cluster/sw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ clean: clean-sw
####################

CLUSTER_GEN_HEADERS = snitch_cluster_cfg.h \
snitch_cluster_addrmap.h \
snitch_cluster_defs.h
snitch_cluster_addrmap.h

REGGEN_HEADERS = snitch_cluster_peripheral.h

Expand Down
1 change: 0 additions & 1 deletion target/snitch_cluster/sw/runtime/common/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
snitch_cluster_cfg.h
snitch_cluster_defs.h
snitch_cluster_addrmap.h
snitch_cluster_peripheral.h
14 changes: 13 additions & 1 deletion target/snitch_cluster/sw/runtime/common/snitch_cluster_cfg.h.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,16 @@
// SPDX-License-Identifier: Apache-2.0

#define CFG_CLUSTER_NR_CORES ${cfg['cluster']['nr_cores']}
#define CFG_CLUSTER_BASE_HARTID ${cfg['cluster']['cluster_base_hartid']}
#define CFG_CLUSTER_BASE_HARTID ${cfg['cluster']['cluster_base_hartid']}
#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_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)
#define SNRT_CLUSTER_OFFSET ${cfg['cluster']['cluster_base_offset']}
#define SNRT_CLUSTER_HW_BARRIER_ADDR \
(CLUSTER_PERIPH_BASE_ADDR + SNITCH_CLUSTER_PERIPHERAL_HW_BARRIER_REG_OFFSET)

// Software configuration
#define SNRT_LOG2_STACK_SIZE 10
7 changes: 7 additions & 0 deletions target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2023 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "snitch_cluster_addrmap.h"
#include "snitch_cluster_cfg.h"
#include "snitch_cluster_peripheral.h"
21 changes: 0 additions & 21 deletions target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h.tpl

This file was deleted.

0 comments on commit df6c738

Please sign in to comment.