Skip to content

Commit df96903

Browse files
committed
sw: Use custom CSR names
1 parent ebae1b0 commit df96903

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

iis-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export SN_BENDER=bender-0.28.1
1010
export SN_VCS_SEPP=vcs-2024.09
1111
export SN_VERILATOR_SEPP="oseda -2025.03"
1212
export SN_QUESTA_SEPP=questa-2023.4
13-
export SN_LLVM_BINROOT=/usr/scratch2/vulcano/colluca/tools/riscv32-snitch-llvm-almalinux8-15.0.0-snitch-0.2.0/bin
13+
export SN_LLVM_BINROOT=/usr/scratch2/vulcano/colluca/tools/riscv32-snitch-llvm-almalinux8-15.0.0-snitch-0.3.0/bin
1414

1515
# Create Python virtual environment with required packages
1616
/usr/local/anaconda3-2023.07/bin/python -m venv .venv

sw/runtime/src/ssr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ inline void snrt_ssr_enable() {
9696
#ifdef __TOOLCHAIN_LLVM__
9797
__builtin_ssr_enable();
9898
#else
99-
asm volatile("csrsi 0x7C0, 1\n");
99+
asm volatile("csrsi ssr, 1\n");
100100
#endif
101101
}
102102

@@ -107,7 +107,7 @@ inline void snrt_ssr_disable() {
107107
#ifdef __TOOLCHAIN_LLVM__
108108
__builtin_ssr_disable();
109109
#else
110-
asm volatile("csrci 0x7C0, 1\n");
110+
asm volatile("csrci ssr, 1\n");
111111
#endif
112112
}
113113

@@ -117,14 +117,14 @@ inline void snrt_ssr_disable() {
117117
* chaining.
118118
*/
119119
inline void snrt_sc_enable(uint32_t mask) {
120-
asm volatile("csrs 0x7C3, %[mask]\n" : : [ mask ] "r"(mask) :);
120+
asm volatile("csrs sc, %[mask]\n" : : [ mask ] "r"(mask) :);
121121
}
122122

123123
/**
124124
* @brief Disable scalar chaining.
125125
*/
126126
inline void snrt_sc_disable(uint32_t mask) {
127-
asm volatile("csrc 0x7C3, %[mask]\n" : : [ mask ] "r"(mask) :);
127+
asm volatile("csrc sc, %[mask]\n" : : [ mask ] "r"(mask) :);
128128
}
129129

130130
/**

sw/runtime/src/sync.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ inline void snrt_wake_clusters(uint32_t core_mask, snrt_comm_t comm = NULL) {
175175
* this function, or the calling cores will stall indefinitely.
176176
*/
177177
inline void snrt_cluster_hw_barrier() {
178-
asm volatile("csrr x0, 0x7C2" ::: "memory");
178+
asm volatile("csrr x0, barrier" ::: "memory");
179179
}
180180

181181
/**
@@ -414,10 +414,8 @@ inline void snrt_wait_writeback(uint32_t val) {
414414
* @param field Defines the AW user field for the AXI transfer
415415
*/
416416
inline void snrt_set_awuser(uint64_t field) {
417-
uint32_t user_low = (uint32_t)(field);
418-
uint32_t user_high = (uint32_t)(field >> 32);
419-
write_csr(0x7c4, user_low);
420-
write_csr(0x7c5, user_high);
417+
write_csr(user_low, (uint32_t)(field));
418+
write_csr(user_high, (uint32_t)(field >> 32));
421419
}
422420

423421
//================================================================================

util/container/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARG DEBIAN_FRONTEND=noninteractive
1818
FROM ubuntu:${UBUNTU_VERSION} AS tool-builder
1919
ARG BENDER_VERSION=0.28.1
2020
ARG DOXYGEN_VERSION=1.12.0
21-
ARG SNITCH_LLVM_VERSION=15.0.0-snitch-0.2.0
21+
ARG SNITCH_LLVM_VERSION=15.0.0-snitch-0.3.0
2222
ARG UBUNTU_VERSION
2323
ARG DEBIAN_FRONTEND
2424

0 commit comments

Comments
 (0)