Skip to content

Commit 5d460b4

Browse files
authored
Merge pull request #1661 from jacassidy/SOC_project
Soc Project Lab2 Update
2 parents e898802 + 9d115e4 commit 5d460b4

File tree

5 files changed

+80
-22
lines changed

5 files changed

+80
-22
lines changed

examples/exercises/lynn/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PROCESSOR_TOP ?= riscvsingle # top-level module name
1616
PROCESSOR_CONFIG ?= $(CURDIR)/sample_processor/config
1717

1818
#--trace-all
19-
SAIL_TRACE_FLAGS ?=
19+
SAIL_TRACE_FLAGS ?= --trace-all
2020

2121
# ---- Synthesis Configuration ---- #
2222
SYNTH_TECH ?= sky130 #tsmc28 #tsmc28psyn
@@ -222,7 +222,7 @@ C_test:
222222
.PHONY: bringup_test
223223
bringup_test:
224224
@$(MAKE) -C $(BRINGUP_TEST_DIR) \
225-
XLEN=$(XLEN) ARCH="$(ARCH)" ABI=$(ABI) LINKER=$(LINKER) TOOLPREFIX=$(TOOLPREFIX)
225+
XLEN=$(XLEN) ARCH="$(ARCH)" ABI=$(ABI) TOOLPREFIX=$(TOOLPREFIX)
226226
@$(MAKE) run ELFS="$(BRINGUP_TEST_DIR)/work/bringup.elf"
227227

228228
# ---- Coremark flow ---- #

examples/exercises/lynn/tests/act4/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ populate: $(STAMP)
1414
$(STAMP): Makefile
1515
@mkdir -p $(WORK_DIR)
1616
@$(MAKE) -C $(RISCV_ARCH_TEST) \
17-
CONFIG_FILES=$(RISCV_ARCH_TEST)/config/ref/sail-rv32gc/test_config.yaml \
18-
EXTENSIONS=I,Zicntr,Zihpm,Zicsr \
17+
CONFIG_FILES=$(RISCV_ARCH_TEST)/config/sail/sail-RVI20U32/test_config.yaml \
18+
EXTENSIONS=I,Zicntr,Zihpm,Zicsr,Zmmul \
1919
DEBUG=True \
2020
--jobs $$(nproc)
21-
@cp -r $(RISCV_ARCH_TEST)/work/common/elfs/rv32i/I/* $(WORK_DIR)/
21+
@cp -r $(RISCV_ARCH_TEST)/work/sail-RVI20U32/elfs/rv32i/I/* $(WORK_DIR)/
2222
@touch $(STAMP)
2323

2424
.PHONY: list-elfs

examples/exercises/lynn/tests/bringup/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TOOLPREFIX ?= riscv64-unknown-elf-
1111
GCC ?= $(TOOLPREFIX)gcc
1212

1313
# Intentionally undefined unless caller provides it:
14-
LINKER ?=
14+
LINKER ?= $(CURDIR)/link.ld
1515

1616
WORK_DIR ?= $(CURDIR)/work
1717

examples/exercises/lynn/tests/bringup/crt0.S

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,6 @@ finish:
8686
add t0, t0, t0 # 20
8787
add t0, t0, t0 # 21 -> t0 = 0x8000_0000
8888

89-
# t1 = 1 << 12 = 0x1000
90-
add t1, t1, t1 # 1
91-
add t1, t1, t1 # 2
92-
add t1, t1, t1 # 3
93-
add t1, t1, t1 # 4
94-
add t1, t1, t1 # 5
95-
add t1, t1, t1 # 6
96-
add t1, t1, t1 # 7
97-
add t1, t1, t1 # 8
98-
add t1, t1, t1 # 9
99-
add t1, t1, t1 # 10
100-
add t1, t1, t1 # 11
101-
add t1, t1, t1 # 12 -> t1 = 0x0000_1000
102-
103-
add t0, t0, t1 # t0 = 0x8000_1000
104-
10589
sw gp, 0(t0)
10690
sw x0, 4(t0)
10791
1:
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*======================================================================*/
2+
/* Proxy kernel linker script */
3+
/*======================================================================*/
4+
/* This is the linker script used when building the proxy kernel. */
5+
6+
/*----------------------------------------------------------------------*/
7+
/* Setup */
8+
/*----------------------------------------------------------------------*/
9+
10+
/* The OUTPUT_ARCH command specifies the machine architecture where the
11+
argument is one of the names used in the BFD library. More
12+
specifically one of the entries in bfd/cpu-mips.c */
13+
14+
OUTPUT_ARCH( "riscv" )
15+
ENTRY(rvtest_entry_point)
16+
17+
/*----------------------------------------------------------------------*/
18+
/* Sections */
19+
/*----------------------------------------------------------------------*/
20+
21+
SECTIONS
22+
{
23+
. = 0x80000000;
24+
.tohost : { *(.tohost) }
25+
. = ALIGN(0x1000);
26+
27+
/* text: test code section */
28+
.text.init : { *(.text.init) }
29+
30+
.text : { *(.text) *(.text.main) }
31+
32+
. = ALIGN(0x1000);
33+
.rodata : { *(.rodata .rodata.*) *(.srodata .srodata.*) } /* Read-only data in DMEM */
34+
. = ALIGN(16);
35+
36+
/* data segment */
37+
.data : { *(.data) }
38+
.data.string : { *(.data.string)}
39+
40+
.sdata : {
41+
__global_pointer$ = . + 0x800;
42+
*(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata*)
43+
*(.sdata .sdata.* .gnu.linkonce.s.*)
44+
}
45+
46+
/* bss segment */
47+
.sbss : {
48+
*(.sbss .sbss.* .gnu.linkonce.sb.*)
49+
*(.scommon)
50+
}
51+
.bss : { *(.bss) }
52+
53+
/* thread-local data segment */
54+
.tdata :
55+
{
56+
_tls_data = .;
57+
*(.tdata.begin)
58+
*(.tdata)
59+
*(.tdata.end)
60+
}
61+
.tbss :
62+
{
63+
*(.tbss)
64+
*(.tbss.end)
65+
}
66+
67+
. = ALIGN(16);
68+
_stack_bottom = .;
69+
. += 0x1000;
70+
_stack_top = .;
71+
72+
/* End of uninitialized data segment */
73+
_end = .;
74+
}

0 commit comments

Comments
 (0)