Skip to content

Commit 9520744

Browse files
committed
target: Use absolute path to test directory
This is required cause an absolute path to `snitch_bootrom.sv` is used in the Make dependency list, while a relative path is used in a rule target. This would lead to a "No rule to make target" error when building the HW after a `make clean`.
1 parent c9f92d1 commit 9520744

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

target/snitch_cluster/Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ CLUSTER_GEN_SRC ?= $(wildcard $(ROOT)/util/clustergen/*.py)
4949

5050
BIN_DIR ?= bin
5151
GENERATED_DIR ?= $(MKFILE_DIR)generated
52+
TEST_DIR ?= $(MKFILE_DIR)test
5253
PERIPH_DIR ?= $(ROOT)/hw/snitch_cluster/src/snitch_cluster_peripheral
5354

5455
# If the configuration file is overriden on the command-line (through
@@ -149,7 +150,7 @@ include $(ROOT)/target/snitch_cluster/sw.mk
149150
GENERATED_RTL_SOURCES = $(PERIPH_DIR)/snitch_cluster_peripheral_reg_top.sv
150151
GENERATED_RTL_SOURCES += $(PERIPH_DIR)/snitch_cluster_peripheral_reg_pkg.sv
151152
GENERATED_RTL_SOURCES += $(GENERATED_DIR)/snitch_cluster_wrapper.sv
152-
GENERATED_RTL_SOURCES += test/snitch_bootrom.sv
153+
GENERATED_RTL_SOURCES += $(TEST_DIR)/snitch_bootrom.sv
153154

154155
.PHONY: rtl clean-rtl
155156

@@ -178,12 +179,12 @@ $(PERIPH_DIR)/snitch_cluster_peripheral_reg_top.sv: $(PERIPH_DIR)/snitch_cluster
178179

179180
# Bootrom
180181
.PHONY: bootrom
181-
bootrom: test/snitch_bootrom.sv
182-
test/bootrom.elf test/bootrom.dump test/bootrom.bin test/snitch_bootrom.sv: test/bootrom.S test/bootrom.ld $(BOOTROM_GEN)
183-
$(RISCV_CC) -mabi=ilp32d -march=rv32imafd -static -nostartfiles -fuse-ld=$(RISCV_LD) -Lsw/runtime -Ttest/bootrom.ld $< -o test/bootrom.elf
184-
$(RISCV_OBJDUMP) -d test/bootrom.elf > test/bootrom.dump
185-
$(RISCV_OBJCOPY) -j .text -O binary test/bootrom.elf test/bootrom.bin
186-
$(BOOTROM_GEN) --sv-module snitch_bootrom test/bootrom.bin > test/snitch_bootrom.sv
182+
bootrom: $(TEST_DIR)/snitch_bootrom.sv
183+
$(TEST_DIR)/bootrom.elf $(TEST_DIR)/bootrom.dump $(TEST_DIR)/bootrom.bin $(TEST_DIR)/snitch_bootrom.sv: $(TEST_DIR)/bootrom.S $(TEST_DIR)/bootrom.ld $(BOOTROM_GEN)
184+
$(RISCV_CC) -mabi=ilp32d -march=rv32imafd -static -nostartfiles -fuse-ld=$(RISCV_LD) -Lsw/runtime -T$(TEST_DIR)/bootrom.ld $< -o $(TEST_DIR)/bootrom.elf
185+
$(RISCV_OBJDUMP) -d $(TEST_DIR)/bootrom.elf > $(TEST_DIR)/bootrom.dump
186+
$(RISCV_OBJCOPY) -j .text -O binary $(TEST_DIR)/bootrom.elf $(TEST_DIR)/bootrom.bin
187+
$(BOOTROM_GEN) --sv-module snitch_bootrom $(TEST_DIR)/bootrom.bin > $(TEST_DIR)/snitch_bootrom.sv
187188

188189
#############
189190
# Verilator #
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11

2-
test/bootrom.elf: file format elf32-littleriscv
3-
2+
/usr/scratch/vulcano/colluca/workspace/snitch_cluster/fix-dma-xbar/target/snitch_cluster/test/bootrom.elf: file format elf32-littleriscv
43

54
Disassembly of section .text:
65

76
00000000 <_snitch_park>:
8-
0: 97 02 00 00 auipc t0, 0
9-
4: 93 82 02 02 addi t0, t0, 32
7+
0: 97 02 00 00 auipc t0, 0x0
8+
4: 93 82 02 02 addi t0, t0, 0x20
109
8: 73 90 52 30 csrw mtvec, t0
11-
c: 73 60 04 30 csrsi mstatus, 8
12-
10: b7 02 08 00 lui t0, 128
13-
14: 93 82 82 00 addi t0, t0, 8
10+
c: 73 60 04 30 csrsi mstatus, 0x8
11+
10: b7 02 08 00 lui t0, 0x80
12+
14: 93 82 82 00 addi t0, t0, 0x8
1413
18: 73 90 42 30 csrw mie, t0
15-
1c: 73 00 50 10 wfi
14+
1c: 73 00 50 10 wfi
1615

1716
00000020 <_snitch_resume>:
18-
20: 97 02 00 00 auipc t0, 0
19-
24: 37 13 00 00 lui t1, 1
20-
28: 13 03 83 16 addi t1, t1, 360
17+
20: 97 02 00 00 auipc t0, 0x0
18+
24: 37 13 00 00 lui t1, 0x1
19+
28: 13 03 83 16 addi t1, t1, 0x168
2120
2c: b3 82 62 00 add t0, t0, t1
22-
30: 83 a2 02 00 lw t0, 0(t0)
21+
30: 83 a2 02 00 lw t0, 0x0(t0)
2322
34: e7 80 02 00 jalr t0
2423
38: 6f f0 9f fc j 0x0 <_snitch_park>
52 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)