From 1b5a036c460120f8b925c8ccbcfff49bde14c469 Mon Sep 17 00:00:00 2001 From: Jonathan Woodruff Date: Fri, 8 Oct 2021 16:35:42 +0000 Subject: [PATCH] Two fixes: do a proper "all bits are the same" function, as well as prepare a capability target to pass back. --- src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv | 2 +- src_Core/RISCY_OOO/procs/lib/TlbTypes.bsv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv b/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv index 2c4d498..b2af746 100644 --- a/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv +++ b/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv @@ -746,7 +746,7 @@ module mkFetchStage(FetchStage); end end else if (!isValid(nextPc)) begin // A Jr will jump; if we don't have a record, we should wait to prevent wasted work. - nextPc = Valid ({2'b01,?}); // Invalid virtual address to prevent progress. + nextPc = Valid (setAddrUnsafe(nullCap,{2'b01,?})); // Invalid virtual address to prevent progress. end end diff --git a/src_Core/RISCY_OOO/procs/lib/TlbTypes.bsv b/src_Core/RISCY_OOO/procs/lib/TlbTypes.bsv index f189852..07f277c 100644 --- a/src_Core/RISCY_OOO/procs/lib/TlbTypes.bsv +++ b/src_Core/RISCY_OOO/procs/lib/TlbTypes.bsv @@ -100,7 +100,7 @@ function Vpn getVpn(Addr addr) = addr[38:12]; function PageOffset getPageOffset(Addr addr) = truncate(addr); // All the upper bits should be equal for a valid SV39 virtual address. -function Bool validVirtualAddress(Addr addr) = ((^addr[63:39]) == 0); +function Bool validVirtualAddress(Addr addr) = ((addr[63:39] ^ {addr[39],addr[63:40]}) == 0); function Addr getPTBaseAddr(Ppn basePpn); PageOffset offset = 0;