diff --git a/.github/workflows/ci-compile.yml b/.github/workflows/ci-compile.yml index b053839..97c9fe6 100644 --- a/.github/workflows/ci-compile.yml +++ b/.github/workflows/ci-compile.yml @@ -31,6 +31,12 @@ jobs: - name: Update submodules run: git submodule update --init --recursive + + - name: Cache Conan + uses: actions/cache@v4 + with: + path: ~/.conan2 + key: conan-${{ runner.os }}-unit-cpp${{ matrix.cpp_std }}-${{ hashFiles('conanfile.py') }} - name: Install dependencies run: | diff --git a/src/iss/arch/mstatus.h b/src/iss/arch/mstatus.h index 0a67596..2ea36d3 100644 --- a/src/iss/arch/mstatus.h +++ b/src/iss/arch/mstatus.h @@ -73,6 +73,8 @@ template struct status(v); }; // machine previous privilege static inline unsigned MPP(T v) { return bit_sub<11, 2>(v); }; + // vector unit status Off/Initial/Clean/Dirty + static inline unsigned VS(T v) { return bit_sub<9, 2>(v); }; // supervisor previous privilege static inline unsigned SPP(T v) { return bit_sub<8, 1>(v); }; // previous machine interrupt-enable @@ -121,6 +123,8 @@ template struct status(v); }; // machine previous privilege static inline unsigned MPP(T v) { return bit_sub<11, 2>(v); }; + // vector unit status Off/Initial/Clean/Dirty + static inline unsigned VS(T v) { return bit_sub<9, 2>(v); }; // supervisor previous privilege static inline unsigned SPP(T v) { return bit_sub<8, 1>(v); }; // previous machine interrupt-enable @@ -165,6 +169,8 @@ template class hart_state class hart_state class hart_state riscv_hart_msu_vp::riscv_hart_msu_vp() : mmu(base::get_priv_if()) , default_mem(base::get_priv_if()) { + if constexpr(sizeof(reg_t) == 8) + // set UXL and SXL to indicate 64 bits + // FIXME: this value is not preserved in resets + this->state.mstatus.backing.val |= 0x500000000; // common regs const std::array rwaddrs{ {mepc, mtvec, mscratch, mcause, mtval, sepc, stvec, sscratch, scause, stval, sscratch, uepc, utvec, uscratch, ucause, utval}};