mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Coverage improvements in ieu, hazard units
This commit is contained in:
		
							parent
							
								
									ab82bb397c
								
							
						
					
					
						commit
						fd0c9e973d
					
				@ -24,8 +24,12 @@
 | 
				
			|||||||
#// and limitations under the License.
 | 
					#// and limitations under the License.
 | 
				
			||||||
#////////////////////////////////////////////////////////////////////////////////////////////////
 | 
					#////////////////////////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This file should be a last resort.  It's preferable to put 
 | 
				
			||||||
 | 
					# // coverage off 
 | 
				
			||||||
 | 
					# statements inline with the code whenever possible.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# LZA (i<64) statement confuses coverage tool 
 | 
					# LZA (i<64) statement confuses coverage tool 
 | 
				
			||||||
# This is ugly to exlcude the whole file - is there a better option
 | 
					# This is ugly to exlcude the whole file - is there a better option?  // coverage off isn't working
 | 
				
			||||||
coverage exclude -srcfile lzc.sv 
 | 
					coverage exclude -srcfile lzc.sv 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -88,7 +88,9 @@ module hazard (
 | 
				
			|||||||
  assign StallWCause = (IFUStallF & ~FlushDCause) | (LSUStallM & ~FlushWCause);
 | 
					  assign StallWCause = (IFUStallF & ~FlushDCause) | (LSUStallM & ~FlushWCause);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Stall each stage for cause or if the next stage is stalled
 | 
					  // Stall each stage for cause or if the next stage is stalled
 | 
				
			||||||
 | 
					  // coverage off: StallFCause is always 0
 | 
				
			||||||
  assign #1 StallF = StallFCause | StallD;
 | 
					  assign #1 StallF = StallFCause | StallD;
 | 
				
			||||||
 | 
					  // coverage on
 | 
				
			||||||
  assign #1 StallD = StallDCause | StallE;
 | 
					  assign #1 StallD = StallDCause | StallE;
 | 
				
			||||||
  assign #1 StallE = StallECause | StallM;
 | 
					  assign #1 StallE = StallECause | StallM;
 | 
				
			||||||
  assign #1 StallM = StallMCause | StallW;
 | 
					  assign #1 StallM = StallMCause | StallW;
 | 
				
			||||||
 | 
				
			|||||||
@ -101,8 +101,10 @@ module bmuctrl(
 | 
				
			|||||||
                                  BMUControlsD = `BMUCTRLW'b000_10_001_1_1_0_1_0_0_0_0_0;  // sign extend instruction
 | 
					                                  BMUControlsD = `BMUCTRLW'b000_10_001_1_1_0_1_0_0_0_0_0;  // sign extend instruction
 | 
				
			||||||
                                else if ((Rs2D[4:2]==3'b000) & ~(Rs2D[1] & Rs2D[0]))
 | 
					                                else if ((Rs2D[4:2]==3'b000) & ~(Rs2D[1] & Rs2D[0]))
 | 
				
			||||||
                                  BMUControlsD = `BMUCTRLW'b000_10_000_1_1_0_1_0_0_0_0_0;  // count instruction
 | 
					                                  BMUControlsD = `BMUCTRLW'b000_10_000_1_1_0_1_0_0_0_0_0;  // count instruction
 | 
				
			||||||
        17'b0110011_0000100_100: if (`XLEN == 32)
 | 
					//        // coverage off: This case can't occur in RV64
 | 
				
			||||||
                                  BMUControlsD = `BMUCTRLW'b000_10_001_1_1_0_1_0_0_0_0_0;  // zexth (rv32)
 | 
					//        17'b0110011_0000100_100: if (`XLEN == 32)
 | 
				
			||||||
 | 
					//                                  BMUControlsD = `BMUCTRLW'b000_10_001_1_1_0_1_0_0_0_0_0;  // zexth (rv32)
 | 
				
			||||||
 | 
					//        // coverage on
 | 
				
			||||||
        17'b0110011_0100000_111: BMUControlsD = `BMUCTRLW'b111_01_111_1_0_0_1_1_0_0_0_0;  // andn
 | 
					        17'b0110011_0100000_111: BMUControlsD = `BMUCTRLW'b111_01_111_1_0_0_1_1_0_0_0_0;  // andn
 | 
				
			||||||
        17'b0110011_0100000_110: BMUControlsD = `BMUCTRLW'b110_01_111_1_0_0_1_1_0_0_0_0;  // orn
 | 
					        17'b0110011_0100000_110: BMUControlsD = `BMUCTRLW'b110_01_111_1_0_0_1_1_0_0_0_0;  // orn
 | 
				
			||||||
        17'b0110011_0100000_100: BMUControlsD = `BMUCTRLW'b100_01_111_1_0_0_1_1_0_0_0_0;  // xnor
 | 
					        17'b0110011_0100000_100: BMUControlsD = `BMUCTRLW'b100_01_111_1_0_0_1_1_0_0_0_0;  // xnor
 | 
				
			||||||
 | 
				
			|||||||
@ -264,7 +264,9 @@ module controller(
 | 
				
			|||||||
    end else assign sltD = (Funct3D == 3'b010);
 | 
					    end else assign sltD = (Funct3D == 3'b010);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Combine base and bit manipulation signals
 | 
					    // Combine base and bit manipulation signals
 | 
				
			||||||
 | 
					    // coverage off: IllegalERegAdr can't occur in rv64gc; only applicable to E mode
 | 
				
			||||||
    assign IllegalBaseInstrD = (ControlsD[0] & IllegalBitmanipInstrD) | IllegalERegAdrD ;
 | 
					    assign IllegalBaseInstrD = (ControlsD[0] & IllegalBitmanipInstrD) | IllegalERegAdrD ;
 | 
				
			||||||
 | 
					    // coverage on
 | 
				
			||||||
    assign RegWriteD = BaseRegWriteD | BRegWriteD; 
 | 
					    assign RegWriteD = BaseRegWriteD | BRegWriteD; 
 | 
				
			||||||
    assign W64D = BaseW64D | BW64D;
 | 
					    assign W64D = BaseW64D | BW64D;
 | 
				
			||||||
    assign ALUSrcBD = BaseALUSrcBD | BALUSrcBD;
 | 
					    assign ALUSrcBD = BaseALUSrcBD | BALUSrcBD;
 | 
				
			||||||
 | 
				
			|||||||
@ -149,7 +149,7 @@ module lsu (
 | 
				
			|||||||
  // MMU include PMP and is needed if any privileged supported
 | 
					  // MMU include PMP and is needed if any privileged supported
 | 
				
			||||||
  /////////////////////////////////////////////////////////////////////////////////////////////
 | 
					  /////////////////////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(`VIRTMEM_SUPPORTED) begin : VIRTMEM_SUPPORTED
 | 
					  if(`VIRTMEM_SUPPORTED) begin : hptw
 | 
				
			||||||
    hptw hptw(.clk, .reset, .MemRWM, .AtomicM, .ITLBMissF, .ITLBWriteF,
 | 
					    hptw hptw(.clk, .reset, .MemRWM, .AtomicM, .ITLBMissF, .ITLBWriteF,
 | 
				
			||||||
      .DTLBMissM, .DTLBWriteM, .InstrUpdateDAF, .DataUpdateDAM,
 | 
					      .DTLBMissM, .DTLBWriteM, .InstrUpdateDAF, .DataUpdateDAM,
 | 
				
			||||||
      .FlushW, .DCacheStallM, .SATP_REGW, .PCSpillF,
 | 
					      .FlushW, .DCacheStallM, .SATP_REGW, .PCSpillF,
 | 
				
			||||||
 | 
				
			|||||||
@ -202,7 +202,7 @@ module csr #(parameter
 | 
				
			|||||||
  assign NextMtvalM = TrapM ? NextFaultMtvalM : CSRWriteValM;
 | 
					  assign NextMtvalM = TrapM ? NextFaultMtvalM : CSRWriteValM;
 | 
				
			||||||
  assign UngatedCSRMWriteM = CSRWriteM & (PrivilegeModeW == `M_MODE);
 | 
					  assign UngatedCSRMWriteM = CSRWriteM & (PrivilegeModeW == `M_MODE);
 | 
				
			||||||
  assign CSRMWriteM = UngatedCSRMWriteM & InstrValidNotFlushedM;
 | 
					  assign CSRMWriteM = UngatedCSRMWriteM & InstrValidNotFlushedM;
 | 
				
			||||||
  assign CSRSWriteM = CSRWriteM & (|PrivilegeModeW)  & InstrValidNotFlushedM;
 | 
					  assign CSRSWriteM = CSRWriteM & (|PrivilegeModeW) & InstrValidNotFlushedM;
 | 
				
			||||||
  assign CSRUWriteM = CSRWriteM  & InstrValidNotFlushedM;
 | 
					  assign CSRUWriteM = CSRWriteM  & InstrValidNotFlushedM;
 | 
				
			||||||
  assign MTrapM = TrapM & (NextPrivilegeModeM == `M_MODE);
 | 
					  assign MTrapM = TrapM & (NextPrivilegeModeM == `M_MODE);
 | 
				
			||||||
  assign STrapM = TrapM & (NextPrivilegeModeM == `S_MODE) & `S_SUPPORTED;
 | 
					  assign STrapM = TrapM & (NextPrivilegeModeM == `S_MODE) & `S_SUPPORTED;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user