From 4cdc2801beb6b4c9de6348d3b34d8bb20c519c62 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Wed, 22 Feb 2023 15:15:28 -0800 Subject: [PATCH] Override spike's misa in cosim mode Writable bits in MISA is implementation-defined, so we can't follow spike here. --- generators/chipyard/src/main/resources/csrc/cospike.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/generators/chipyard/src/main/resources/csrc/cospike.cc b/generators/chipyard/src/main/resources/csrc/cospike.cc index 084e1b2877..6b1e9c3b05 100644 --- a/generators/chipyard/src/main/resources/csrc/cospike.cc +++ b/generators/chipyard/src/main/resources/csrc/cospike.cc @@ -226,6 +226,7 @@ extern "C" void cospike_cosim(long long int cycle, bool csr_read = (insn & 0x7f) == 0x73; if (csr_read) printf("CSR read %lx\n", csr_addr); if (csr_read && ( + (csr_addr == 0x301) || // misa (csr_addr == 0xf13) || // mimpid (csr_addr == 0xf12) || // marchid (csr_addr == 0xf11) || // mvendorid