mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Removed Busybear dependencies
This commit is contained in:
parent
98990a294c
commit
02071700d6
@ -73,19 +73,15 @@ module lsuvirtmem(
|
|||||||
|
|
||||||
assign AnyCPUReqM = (|MemRWM) | (|AtomicM);
|
assign AnyCPUReqM = (|MemRWM) | (|AtomicM);
|
||||||
|
|
||||||
interlockfsm interlockfsm (.clk, .reset, .AnyCPUReqM, .ITLBMissF, .ITLBWriteF,
|
interlockfsm interlockfsm (
|
||||||
.DTLBMissM, .DTLBWriteM, .TrapM, .DCacheStallM,
|
.clk, .reset, .AnyCPUReqM, .ITLBMissF, .ITLBWriteF,
|
||||||
.InterlockStall, .SelReplayCPURequest, .SelHPTW,
|
.DTLBMissM, .DTLBWriteM, .TrapM, .DCacheStallM,
|
||||||
.IgnoreRequest);
|
.InterlockStall, .SelReplayCPURequest, .SelHPTW, .IgnoreRequest);
|
||||||
|
hptw hptw( // *** remove logic from (), mention this in style guide CH3
|
||||||
hptw hptw(.clk, .reset, .SATP_REGW, .PCF, .IEUAdrM,
|
.clk, .reset, .SATP_REGW, .PCF, .IEUAdrM,
|
||||||
.ITLBMissF(ITLBMissF & ~TrapM),
|
.ITLBMissF(ITLBMissF & ~TrapM), .DTLBMissM(DTLBMissM & ~TrapM),
|
||||||
.DTLBMissM(DTLBMissM & ~TrapM),
|
.PTE, .PageType, .ITLBWriteF, .DTLBWriteM, .HPTWReadPTE(ReadDataM),
|
||||||
.PTE, .PageType, .ITLBWriteF, .DTLBWriteM,
|
.DCacheStallM, .HPTWAdr, .HPTWRead, .HPTWSize);
|
||||||
.HPTWReadPTE(ReadDataM),
|
|
||||||
.DCacheStallM, .HPTWAdr, .HPTWRead, .HPTWSize);
|
|
||||||
|
|
||||||
// arbiter between IEU and hptw
|
|
||||||
|
|
||||||
// multiplex the outputs to LSU
|
// multiplex the outputs to LSU
|
||||||
mux2 #(2) rwmux(MemRWM, {HPTWRead, 1'b0}, SelHPTW, PreLSURWM);
|
mux2 #(2) rwmux(MemRWM, {HPTWRead, 1'b0}, SelHPTW, PreLSURWM);
|
||||||
@ -98,5 +94,4 @@ module lsuvirtmem(
|
|||||||
|
|
||||||
// always block interrupts when using the hardware page table walker.
|
// always block interrupts when using the hardware page table walker.
|
||||||
assign CPUBusy = StallW & ~SelHPTW;
|
assign CPUBusy = StallW & ~SelHPTW;
|
||||||
|
endmodule
|
||||||
endmodule; // lsuvirtmem
|
|
||||||
|
@ -145,25 +145,18 @@ module csrm #(parameter
|
|||||||
assign IllegalCSRMWriteReadonlyM = CSRMWriteM & (CSRAdrM == MVENDORID | CSRAdrM == MARCHID | CSRAdrM == MIMPID | CSRAdrM == MHARTID);
|
assign IllegalCSRMWriteReadonlyM = CSRMWriteM & (CSRAdrM == MVENDORID | CSRAdrM == MARCHID | CSRAdrM == MIMPID | CSRAdrM == MHARTID);
|
||||||
|
|
||||||
// CSRs
|
// CSRs
|
||||||
flopenr #(`XLEN) MTVECreg(clk, reset, WriteMTVECM, {CSRWriteValM[`XLEN-1:2], 1'b0, CSRWriteValM[0]}, MTVEC_REGW); //busybear: changed reset value to 0
|
flopenr #(`XLEN) MTVECreg(clk, reset, WriteMTVECM, {CSRWriteValM[`XLEN-1:2], 1'b0, CSRWriteValM[0]}, MTVEC_REGW);
|
||||||
if (`S_SUPPORTED | (`U_SUPPORTED & `N_SUPPORTED)) begin:deleg // DELEG registers should exist
|
if (`S_SUPPORTED | (`U_SUPPORTED & `N_SUPPORTED)) begin:deleg // DELEG registers should exist
|
||||||
flopenr #(`XLEN) MEDELEGreg(clk, reset, WriteMEDELEGM, CSRWriteValM & MEDELEG_MASK /*12'h7FF*/, MEDELEG_REGW);
|
flopenr #(`XLEN) MEDELEGreg(clk, reset, WriteMEDELEGM, CSRWriteValM & MEDELEG_MASK /*12'h7FF*/, MEDELEG_REGW);
|
||||||
flopenr #(`XLEN) MIDELEGreg(clk, reset, WriteMIDELEGM, CSRWriteValM & MIDELEG_MASK /*12'h222*/, MIDELEG_REGW);
|
flopenr #(`XLEN) MIDELEGreg(clk, reset, WriteMIDELEGM, CSRWriteValM & MIDELEG_MASK /*12'h222*/, MIDELEG_REGW);
|
||||||
end else begin
|
end else assign {MEDELEG_REGW, MIDELEG_REGW} = 0;
|
||||||
assign MEDELEG_REGW = 0;
|
|
||||||
assign MIDELEG_REGW = 0;
|
|
||||||
end
|
|
||||||
|
|
||||||
flopenr #(`XLEN) MSCRATCHreg(clk, reset, WriteMSCRATCHM, CSRWriteValM, MSCRATCH_REGW);
|
flopenr #(`XLEN) MSCRATCHreg(clk, reset, WriteMSCRATCHM, CSRWriteValM, MSCRATCH_REGW);
|
||||||
flopenr #(`XLEN) MEPCreg(clk, reset, WriteMEPCM, NextEPCM, MEPC_REGW);
|
flopenr #(`XLEN) MEPCreg(clk, reset, WriteMEPCM, NextEPCM, MEPC_REGW);
|
||||||
flopenr #(`XLEN) MCAUSEreg(clk, reset, WriteMCAUSEM, NextCauseM, MCAUSE_REGW);
|
flopenr #(`XLEN) MCAUSEreg(clk, reset, WriteMCAUSEM, NextCauseM, MCAUSE_REGW);
|
||||||
if(`QEMU) assign MTVAL_REGW = `XLEN'b0;
|
if(`QEMU) assign MTVAL_REGW = `XLEN'b0;
|
||||||
else flopenr #(`XLEN) MTVALreg(clk, reset, WriteMTVALM, NextMtvalM, MTVAL_REGW);
|
else flopenr #(`XLEN) MTVALreg(clk, reset, WriteMTVALM, NextMtvalM, MTVAL_REGW);
|
||||||
if (`BUSYBEAR == 1) begin:counters // counter 1 (TIME) enable tied to 0 to match simulator***
|
flopenr #(32) MCOUNTERENreg(clk, reset, WriteMCOUNTERENM, CSRWriteValM[31:0], MCOUNTEREN_REGW);
|
||||||
flopenr #(32) MCOUNTERENreg(clk, reset, WriteMCOUNTERENM, {CSRWriteValM[31:2],1'b0,CSRWriteValM[0]}, MCOUNTEREN_REGW);
|
|
||||||
end else begin:counters
|
|
||||||
flopenr #(32) MCOUNTERENreg(clk, reset, WriteMCOUNTERENM, CSRWriteValM[31:0], MCOUNTEREN_REGW);
|
|
||||||
end
|
|
||||||
flopenr #(32) MCOUNTINHIBITreg(clk, reset, WriteMCOUNTINHIBITM, CSRWriteValM[31:0], MCOUNTINHIBIT_REGW);
|
flopenr #(32) MCOUNTINHIBITreg(clk, reset, WriteMCOUNTINHIBITM, CSRWriteValM[31:0], MCOUNTINHIBIT_REGW);
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ module csrs #(parameter
|
|||||||
assign WriteSCOUNTERENM = CSRSWriteM & (CSRAdrM == SCOUNTEREN) & InstrValidNotFlushedM;
|
assign WriteSCOUNTERENM = CSRSWriteM & (CSRAdrM == SCOUNTEREN) & InstrValidNotFlushedM;
|
||||||
|
|
||||||
// CSRs
|
// CSRs
|
||||||
flopenr #(`XLEN) STVECreg(clk, reset, WriteSTVECM, {CSRWriteValM[`XLEN-1:2], 1'b0, CSRWriteValM[0]}, STVEC_REGW); //busybear: change reset to 0
|
flopenr #(`XLEN) STVECreg(clk, reset, WriteSTVECM, {CSRWriteValM[`XLEN-1:2], 1'b0, CSRWriteValM[0]}, STVEC_REGW);
|
||||||
flopenr #(`XLEN) SSCRATCHreg(clk, reset, WriteSSCRATCHM, CSRWriteValM, SSCRATCH_REGW);
|
flopenr #(`XLEN) SSCRATCHreg(clk, reset, WriteSSCRATCHM, CSRWriteValM, SSCRATCH_REGW);
|
||||||
flopenr #(`XLEN) SEPCreg(clk, reset, WriteSEPCM, NextEPCM, SEPC_REGW);
|
flopenr #(`XLEN) SEPCreg(clk, reset, WriteSEPCM, NextEPCM, SEPC_REGW);
|
||||||
flopenr #(`XLEN) SCAUSEreg(clk, reset, WriteSCAUSEM, NextCauseM, SCAUSE_REGW);
|
flopenr #(`XLEN) SCAUSEreg(clk, reset, WriteSCAUSEM, NextCauseM, SCAUSE_REGW);
|
||||||
@ -100,13 +100,8 @@ module csrs #(parameter
|
|||||||
flopenr #(`XLEN) SATPreg(clk, reset, WriteSATPM, CSRWriteValM, SATP_REGW);
|
flopenr #(`XLEN) SATPreg(clk, reset, WriteSATPM, CSRWriteValM, SATP_REGW);
|
||||||
else
|
else
|
||||||
assign SATP_REGW = 0; // hardwire to zero if virtual memory not supported
|
assign SATP_REGW = 0; // hardwire to zero if virtual memory not supported
|
||||||
if (`BUSYBEAR == 1) begin:scounteren
|
flopens #(32) SCOUNTERENreg(clk, reset, WriteSCOUNTERENM, CSRWriteValM[31:0], SCOUNTEREN_REGW);
|
||||||
flopenr #(32) SCOUNTERENreg(clk, reset, WriteSCOUNTERENM, {CSRWriteValM[31:2],1'b0,CSRWriteValM[0]}, SCOUNTEREN_REGW);
|
|
||||||
end else if (`BUILDROOT == 1) begin:scounteren
|
|
||||||
flopenr #(32) SCOUNTERENreg(clk, reset, WriteSCOUNTERENM, CSRWriteValM[31:0], SCOUNTEREN_REGW);
|
|
||||||
end else begin:scounteren
|
|
||||||
flopens #(32) SCOUNTERENreg(clk, reset, WriteSCOUNTERENM, CSRWriteValM[31:0], SCOUNTEREN_REGW);
|
|
||||||
end
|
|
||||||
if (`N_SUPPORTED) begin:nregs
|
if (`N_SUPPORTED) begin:nregs
|
||||||
logic WriteSEDELEGM, WriteSIDELEGM;
|
logic WriteSEDELEGM, WriteSIDELEGM;
|
||||||
assign WriteSEDELEGM = CSRSWriteM & (CSRAdrM == SEDELEG);
|
assign WriteSEDELEGM = CSRSWriteM & (CSRAdrM == SEDELEG);
|
||||||
|
@ -117,7 +117,7 @@ module csrsr (
|
|||||||
STATUS_MXR_INT <= #1 0;
|
STATUS_MXR_INT <= #1 0;
|
||||||
STATUS_SUM_INT <= #1 0;
|
STATUS_SUM_INT <= #1 0;
|
||||||
STATUS_MPRV_INT <= #1 0; // Per Priv 3.3
|
STATUS_MPRV_INT <= #1 0; // Per Priv 3.3
|
||||||
STATUS_FS_INT <= #1 0; //2'b01; // busybear: change all these reset values to 0
|
STATUS_FS_INT <= #1 0;
|
||||||
STATUS_MPP <= #1 0; //`M_MODE;
|
STATUS_MPP <= #1 0; //`M_MODE;
|
||||||
STATUS_SPP <= #1 0; //1'b1;
|
STATUS_SPP <= #1 0; //1'b1;
|
||||||
STATUS_MPIE <= #1 0; //1;
|
STATUS_MPIE <= #1 0; //1;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Written: nboorstin@g.hmc.edu 2021
|
// Written: nboorstin@g.hmc.edu 2021
|
||||||
// Modified:
|
// Modified:
|
||||||
//
|
//
|
||||||
// Purpose: Testbench for buildroot or busybear linux
|
// Purpose: Testbench for Buildroot Linux
|
||||||
//
|
//
|
||||||
// A component of the Wally configurable RISC-V project.
|
// A component of the Wally configurable RISC-V project.
|
||||||
//
|
//
|
||||||
@ -186,8 +186,8 @@ module testbench;
|
|||||||
`define SCAUSE `CSR_BASE.csrs.csrs.SCAUSEreg.q
|
`define SCAUSE `CSR_BASE.csrs.csrs.SCAUSEreg.q
|
||||||
`define MEPC `CSR_BASE.csrm.MEPCreg.q
|
`define MEPC `CSR_BASE.csrm.MEPCreg.q
|
||||||
`define SEPC `CSR_BASE.csrs.csrs.SEPCreg.q
|
`define SEPC `CSR_BASE.csrs.csrs.SEPCreg.q
|
||||||
`define MCOUNTEREN `CSR_BASE.csrm.counters.MCOUNTERENreg.q
|
`define MCOUNTEREN `CSR_BASE.csrm.MCOUNTERENreg.q
|
||||||
`define SCOUNTEREN `CSR_BASE.csrs.csrs.scounteren.SCOUNTERENreg.q
|
`define SCOUNTEREN `CSR_BASE.csrs.csrs.SCOUNTERENreg.q
|
||||||
`define MSCRATCH `CSR_BASE.csrm.MSCRATCHreg.q
|
`define MSCRATCH `CSR_BASE.csrm.MSCRATCHreg.q
|
||||||
`define SSCRATCH `CSR_BASE.csrs.csrs.SSCRATCHreg.q
|
`define SSCRATCH `CSR_BASE.csrs.csrs.SSCRATCHreg.q
|
||||||
`define MTVEC `CSR_BASE.csrm.MTVECreg.q
|
`define MTVEC `CSR_BASE.csrm.MTVECreg.q
|
||||||
|
Loading…
Reference in New Issue
Block a user