Two fixes: do a proper "all bits are the same" function, as well as

prepare a capability target to pass back.
This commit is contained in:
Jonathan Woodruff
2021-10-08 16:35:42 +00:00
parent 5d5bee3e08
commit 1b5a036c46
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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;