forked from Github_Repos/cvw
		
	Removed Busybear dependencies
This commit is contained in:
		
							parent
							
								
									98990a294c
								
							
						
					
					
						commit
						02071700d6
					
				@ -73,20 +73,16 @@ module lsuvirtmem(
 | 
			
		||||
 | 
			
		||||
  assign AnyCPUReqM = (|MemRWM) | (|AtomicM);
 | 
			
		||||
 | 
			
		||||
  interlockfsm interlockfsm (.clk, .reset, .AnyCPUReqM, .ITLBMissF, .ITLBWriteF,
 | 
			
		||||
                             .DTLBMissM, .DTLBWriteM, .TrapM, .DCacheStallM,
 | 
			
		||||
                             .InterlockStall, .SelReplayCPURequest, .SelHPTW,
 | 
			
		||||
                             .IgnoreRequest);
 | 
			
		||||
  
 | 
			
		||||
  hptw hptw(.clk, .reset, .SATP_REGW, .PCF, .IEUAdrM,
 | 
			
		||||
            .ITLBMissF(ITLBMissF & ~TrapM),
 | 
			
		||||
            .DTLBMissM(DTLBMissM & ~TrapM),
 | 
			
		||||
            .PTE, .PageType, .ITLBWriteF, .DTLBWriteM,
 | 
			
		||||
            .HPTWReadPTE(ReadDataM),
 | 
			
		||||
            .DCacheStallM, .HPTWAdr, .HPTWRead, .HPTWSize);
 | 
			
		||||
  interlockfsm interlockfsm (
 | 
			
		||||
    .clk, .reset, .AnyCPUReqM, .ITLBMissF, .ITLBWriteF,
 | 
			
		||||
    .DTLBMissM, .DTLBWriteM, .TrapM, .DCacheStallM,
 | 
			
		||||
    .InterlockStall, .SelReplayCPURequest, .SelHPTW, .IgnoreRequest);
 | 
			
		||||
  hptw hptw( // *** remove logic from (), mention this in style guide CH3
 | 
			
		||||
    .clk, .reset, .SATP_REGW, .PCF, .IEUAdrM,
 | 
			
		||||
    .ITLBMissF(ITLBMissF & ~TrapM), .DTLBMissM(DTLBMissM & ~TrapM),
 | 
			
		||||
    .PTE, .PageType, .ITLBWriteF, .DTLBWriteM, .HPTWReadPTE(ReadDataM),
 | 
			
		||||
    .DCacheStallM, .HPTWAdr, .HPTWRead, .HPTWSize);
 | 
			
		||||
 | 
			
		||||
  // arbiter between IEU and hptw
 | 
			
		||||
  
 | 
			
		||||
  // multiplex the outputs to LSU
 | 
			
		||||
  mux2 #(2) rwmux(MemRWM, {HPTWRead, 1'b0}, SelHPTW, PreLSURWM);
 | 
			
		||||
  mux2 #(3) sizemux(Funct3M, HPTWSize, SelHPTW, LSUFunct3M);
 | 
			
		||||
@ -98,5 +94,4 @@ module lsuvirtmem(
 | 
			
		||||
 | 
			
		||||
  // always block interrupts when using the hardware page table walker.
 | 
			
		||||
  assign CPUBusy = StallW & ~SelHPTW;
 | 
			
		||||
 | 
			
		||||
endmodule; // lsuvirtmem
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
@ -145,25 +145,18 @@ module csrm #(parameter
 | 
			
		||||
  assign IllegalCSRMWriteReadonlyM = CSRMWriteM & (CSRAdrM == MVENDORID | CSRAdrM == MARCHID | CSRAdrM == MIMPID | CSRAdrM == MHARTID);
 | 
			
		||||
 | 
			
		||||
  // 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
 | 
			
		||||
    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);
 | 
			
		||||
  end else begin
 | 
			
		||||
    assign MEDELEG_REGW = 0;
 | 
			
		||||
    assign MIDELEG_REGW = 0;
 | 
			
		||||
  end
 | 
			
		||||
  end else assign {MEDELEG_REGW, MIDELEG_REGW} = 0;
 | 
			
		||||
 | 
			
		||||
  flopenr #(`XLEN) MSCRATCHreg(clk, reset, WriteMSCRATCHM, CSRWriteValM, MSCRATCH_REGW);
 | 
			
		||||
  flopenr #(`XLEN) MEPCreg(clk, reset, WriteMEPCM, NextEPCM, MEPC_REGW); 
 | 
			
		||||
  flopenr #(`XLEN) MCAUSEreg(clk, reset, WriteMCAUSEM, NextCauseM, MCAUSE_REGW);
 | 
			
		||||
  if(`QEMU) assign MTVAL_REGW = `XLEN'b0;
 | 
			
		||||
  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: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)   MCOUNTERENreg(clk, reset, WriteMCOUNTERENM, CSRWriteValM[31:0], MCOUNTEREN_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;
 | 
			
		||||
 | 
			
		||||
    // 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) SEPCreg(clk, reset, WriteSEPCM, NextEPCM, SEPC_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);
 | 
			
		||||
    else
 | 
			
		||||
      assign SATP_REGW = 0; // hardwire to zero if virtual memory not supported
 | 
			
		||||
    if (`BUSYBEAR == 1) begin:scounteren
 | 
			
		||||
      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
 | 
			
		||||
    flopens #(32)   SCOUNTERENreg(clk, reset, WriteSCOUNTERENM, CSRWriteValM[31:0], SCOUNTEREN_REGW);
 | 
			
		||||
 | 
			
		||||
    if (`N_SUPPORTED) begin:nregs
 | 
			
		||||
      logic WriteSEDELEGM, WriteSIDELEGM;
 | 
			
		||||
      assign WriteSEDELEGM = CSRSWriteM & (CSRAdrM == SEDELEG);
 | 
			
		||||
 | 
			
		||||
@ -117,7 +117,7 @@ module csrsr (
 | 
			
		||||
      STATUS_MXR_INT <= #1 0;
 | 
			
		||||
      STATUS_SUM_INT <= #1 0;
 | 
			
		||||
      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_SPP <= #1 0; //1'b1;
 | 
			
		||||
      STATUS_MPIE <= #1 0; //1;
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
// Written: nboorstin@g.hmc.edu 2021
 | 
			
		||||
// Modified: 
 | 
			
		||||
//
 | 
			
		||||
// Purpose: Testbench for buildroot or busybear linux
 | 
			
		||||
// Purpose: Testbench for Buildroot Linux
 | 
			
		||||
// 
 | 
			
		||||
// A component of the Wally configurable RISC-V project.
 | 
			
		||||
// 
 | 
			
		||||
@ -186,8 +186,8 @@ module testbench;
 | 
			
		||||
  `define SCAUSE      `CSR_BASE.csrs.csrs.SCAUSEreg.q
 | 
			
		||||
  `define MEPC        `CSR_BASE.csrm.MEPCreg.q
 | 
			
		||||
  `define SEPC        `CSR_BASE.csrs.csrs.SEPCreg.q
 | 
			
		||||
  `define MCOUNTEREN  `CSR_BASE.csrm.counters.MCOUNTERENreg.q
 | 
			
		||||
  `define SCOUNTEREN  `CSR_BASE.csrs.csrs.scounteren.SCOUNTERENreg.q
 | 
			
		||||
  `define MCOUNTEREN  `CSR_BASE.csrm.MCOUNTERENreg.q
 | 
			
		||||
  `define SCOUNTEREN  `CSR_BASE.csrs.csrs.SCOUNTERENreg.q
 | 
			
		||||
  `define MSCRATCH    `CSR_BASE.csrm.MSCRATCHreg.q
 | 
			
		||||
  `define SSCRATCH    `CSR_BASE.csrs.csrs.SSCRATCHreg.q
 | 
			
		||||
  `define MTVEC       `CSR_BASE.csrm.MTVECreg.q
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user