mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Cacheway Exclude FlushStage=1 when SetValidWay=1
We determined that this case is not hit even for i$, so this case is also excluded separately for i$. It could be a better idea to remove the ~FlushStage check completely (if we're sure). My reasoning for this one is written as a comment in the exclusion script: since a pipeline stall is asserted by the cache in the fetch stage (which happens before going into the WRITE_LINE state and asserting SetValidWay), there seems to be no way to trigger a FlushStage (FlushW for D$) while the stallM is active.
This commit is contained in:
		
							parent
							
								
									857956ac1e
								
							
						
					
					
						commit
						5612f30029
					
				@ -77,7 +77,7 @@ for {set i 0} {$i < $numcacheways} {incr i} {
 | 
			
		||||
    coverage exclude -scope /dut/core/ifu/bus/icache/icache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: icache SetDirtyWay"] -item e 1
 | 
			
		||||
    coverage exclude -scope /dut/core/ifu/bus/icache/icache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: icache SelectedWiteWordEn"] -item e 1 -fecexprrow 4 6
 | 
			
		||||
    # below: flushD can't go high during an icache write b/c of pipeline stall
 | 
			
		||||
    coverage exclude -scope /dut/core/ifu/bus/icache/icache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: icache SetValidEN"] -item e 1 -fecexprrow 4
 | 
			
		||||
    coverage exclude -scope /dut/core/ifu/bus/icache/icache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: cache SetValidEN"] -item e 1 -fecexprrow 4
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
## D$ Exclusions.
 | 
			
		||||
@ -89,6 +89,10 @@ coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/cachefsm -linerange [Get
 | 
			
		||||
set numcacheways 4
 | 
			
		||||
for {set i 0} {$i < $numcacheways} {incr i} {
 | 
			
		||||
    coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: dcache invalidateway"] -item bes 1 -fecexprrow 4
 | 
			
		||||
 | 
			
		||||
    # FlushStage=1 will never happen when SetValidWay=1 since a pipeline stall is asserted by the cache in the fetch stage, which happens before
 | 
			
		||||
    # going into the WRITE_LINE state (and asserting SetValidWay). No TrapM can fire and since StallW is high, a stallM caused by WFIStallM would not cause a flushW.
 | 
			
		||||
    coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: cache SetValidEN"] -item e 1 -fecexprrow 4
 | 
			
		||||
}
 | 
			
		||||
# D$ writeback, flush, write_line, or flush_writeback states can't be cancelled by a flush
 | 
			
		||||
coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/cachefsm -ftrans CurrState STATE_WRITEBACK->STATE_READY STATE_FLUSH->STATE_READY STATE_WRITE_LINE->STATE_READY STATE_FLUSH_WRITEBACK->STATE_READY
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								src/cache/cacheway.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/cache/cacheway.sv
									
									
									
									
										vendored
									
									
								
							@ -102,7 +102,7 @@ module cacheway #(parameter NUMLINES=512, LINELEN = 256, TAGLEN = 26,
 | 
			
		||||
  assign SetDirtyWay = SetDirty & SelData;                                 // exclusion-tag: icache SetDirtyWay
 | 
			
		||||
  assign ClearDirtyWay = ClearDirty & SelData;
 | 
			
		||||
  assign SelectedWriteWordEn = (SetValidWay | SetDirtyWay) & ~FlushStage;  // exclusion-tag: icache SelectedWiteWordEn
 | 
			
		||||
  assign SetValidEN = SetValidWay & ~FlushStage;                           // exclusion-tag: icache SetValidEN
 | 
			
		||||
  assign SetValidEN = SetValidWay & ~FlushStage;                           // exclusion-tag: cache SetValidEN
 | 
			
		||||
 | 
			
		||||
  // If writing the whole line set all write enables to 1, else only set the correct word.
 | 
			
		||||
  assign FinalByteMask = SetValidWay ? '1 : LineByteMask; // OR
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user