Skip to content

Commit

Permalink
runtime: Generate defines from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
fischeti committed Feb 16, 2024
1 parent 6b0f8bd commit d6996df
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target/snitch_cluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ test/bootrom.elf test/bootrom.dump test/bootrom.bin: test/bootrom.S test/bootrom
############

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

REGGEN_HEADERS = snitch_cluster_peripheral.h

Expand Down
21 changes: 21 additions & 0 deletions target/snitch_cluster/sw/runtime/common/snitch_cluster_defs.h.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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"

// 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_s1_quadrant'] * cfg['s1_quadrant']['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

0 comments on commit d6996df

Please sign in to comment.