Merge branch 'master' into RVFI_DII

This commit is contained in:
Jonathan Woodruff
2019-12-09 16:33:51 +00:00
4 changed files with 86 additions and 51 deletions

View File

@@ -39,9 +39,10 @@ interface NextAddrPred;
endinterface
// Local BTB Typedefs
typedef 1 PcLsbsIgnore;
typedef 256 BtbEntries; // 4KB BTB
typedef Bit#(TLog#(BtbEntries)) BtbIndex;
typedef Bit#(TSub#(TSub#(AddrSz, TLog#(BtbEntries)), 2)) BtbTag;
typedef Bit#(TSub#(TSub#(AddrSz, TLog#(BtbEntries)), PcLsbsIgnore)) BtbTag;
typedef struct {
Addr pc;
@@ -65,7 +66,7 @@ module mkBtb(NextAddrPred);
Bool flushDone = True;
`endif
function BtbIndex getIndex(Addr pc) = truncate(pc >> 2);
function BtbIndex getIndex(Addr pc) = truncate(pc >> valueof(PcLsbsIgnore));
function BtbTag getTag(Addr pc) = truncateLSB(pc);
// no flush, accept update

View File

@@ -77,13 +77,15 @@ module mkMMIOInst(MMIOInst);
method InstFetchTarget getFetchTarget(Addr phyPc);
let addr = getDataAlignedAddr(phyPc);
if(addr >= mainMemBaseAddr && (addr < mainMemBoundAddr) &&
addr != toHostAddr && addr != fromHostAddr)
begin
return MainMem;
end
if (soc_map.m_is_IO_addr (phyPc)) begin
return IODevice;
end
else if(addr >= mainMemBaseAddr && (addr < mainMemBoundAddr) &&
addr != toHostAddr && addr != fromHostAddr) begin
return MainMem;
end
else begin
return IODevice;
return Fault;
end
endmethod