Skip to content

Commit

Permalink
target: Rename PLATFORM_HEADERS_DIR to SNRT_HAL_HDRS_DIR
Browse files Browse the repository at this point in the history
Streamlines the name so that Snitch-based systems can reuse
Snitch's snRuntime build scripts.
  • Loading branch information
colluca committed Sep 5, 2024
1 parent 591f5ef commit 3c521f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions target/snitch_cluster/sw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ CLUSTER_GEN_HEADERS = snitch_cluster_cfg.h \

REGGEN_HEADERS = snitch_cluster_peripheral.h

TARGET_C_HDRS_DIR = $(ROOT)/target/snitch_cluster/sw/runtime/common
TARGET_C_HDRS = $(addprefix $(TARGET_C_HDRS_DIR)/,$(CLUSTER_GEN_HEADERS) $(REGGEN_HEADERS))
SNRT_HAL_HDRS_DIR = $(ROOT)/target/snitch_cluster/sw/runtime/common
SNRT_HAL_HDRS = $(addprefix $(SNRT_HAL_HDRS_DIR)/,$(CLUSTER_GEN_HEADERS) $(REGGEN_HEADERS))

# CLUSTERGEN headers
$(addprefix $(TARGET_C_HDRS_DIR)/,$(CLUSTER_GEN_HEADERS)): %.h: $(CFG) $(CLUSTER_GEN_PREREQ) %.h.tpl
$(addprefix $(SNRT_HAL_HDRS_DIR)/,$(CLUSTER_GEN_HEADERS)): %.h: $(CFG) $(CLUSTER_GEN_PREREQ) %.h.tpl
@echo "[CLUSTERGEN] Generate $@"
$(CLUSTER_GEN) -c $< --outdir $(TARGET_C_HDRS_DIR) --template $@.tpl
$(CLUSTER_GEN) -c $< --outdir $(SNRT_HAL_HDRS_DIR) --template $@.tpl

# REGGEN headers
$(TARGET_C_HDRS_DIR)/snitch_cluster_peripheral.h: $(ROOT)/hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg.hjson $(REGGEN)
$(SNRT_HAL_HDRS_DIR)/snitch_cluster_peripheral.h: $(ROOT)/hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg.hjson $(REGGEN)
$(call reggen_generate_header,$@,$<)

.PHONY: clean-headers
clean-sw: clean-headers
clean-headers:
rm -f $(TARGET_C_HDRS)
rm -f $(SNRT_HAL_HDRS)

##################
# Subdirectories #
Expand Down
2 changes: 1 addition & 1 deletion target/snitch_cluster/sw/apps/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Build variables #
###################

$(APP)_HEADERS += $(TARGET_C_HDRS)
$(APP)_HEADERS += $(SNRT_HAL_HDRS)

$(APP)_INCDIRS += $(SNRT_INCDIRS)
$(APP)_INCDIRS += $(ROOT)/sw/deps/riscv-opcodes
Expand Down
4 changes: 2 additions & 2 deletions target/snitch_cluster/sw/runtime/runtime.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SNRT_INCDIRS += $(SNRT_DIR)/src/omp
SNRT_INCDIRS += $(SNRT_DIR)/api/omp
SNRT_INCDIRS += $(SNRT_DIR)/vendor/riscv-opcodes
SNRT_INCDIRS += $(SNRT_SRCDIR)
SNRT_INCDIRS += $(SNRT_TARGET_DIR)/../common
SNRT_INCDIRS += $(SNRT_HAL_HDRS_DIR)

SNRT_RISCV_CFLAGS += $(RISCV_CFLAGS)
SNRT_RISCV_CFLAGS += $(addprefix -I,$(SNRT_INCDIRS))
Expand Down Expand Up @@ -83,7 +83,7 @@ $(SNRT_LIB): $(SNRT_OBJS) | $(SNRT_BUILDDIR)
$(SNRT_DUMP): $(SNRT_LIB) | $(SNRT_BUILDDIR)
$(RISCV_OBJDUMP) $(RISCV_OBJDUMP_FLAGS) $< > $@

$(SNRT_DEPS): | $(TARGET_C_HDRS)
$(SNRT_DEPS): | $(SNRT_HAL_HDRS)

ifneq ($(filter-out clean%,$(MAKECMDGOALS)),)
-include $(SNRT_DEPS)
Expand Down
2 changes: 1 addition & 1 deletion target/snitch_cluster/sw/tests/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $(TESTS_BUILDDIR)/%.elf: $(TESTS_SRCDIR)/%.c $(LD_DEPS) $(TESTS_BUILDDIR)/%.d |
$(TESTS_BUILDDIR)/%.dump: $(TESTS_BUILDDIR)/%.elf | $(TESTS_BUILDDIR)
$(RISCV_OBJDUMP) $(RISCV_OBJDUMP_FLAGS) $< > $@

$(TEST_DEPS): | $(TARGET_C_HDRS)
$(TEST_DEPS): | $(SNRT_HAL_HDRS)

ifneq ($(filter-out clean%,$(MAKECMDGOALS)),)
-include $(DEP)
Expand Down

0 comments on commit 3c521f1

Please sign in to comment.