mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Imperas found a bug with the Fence.I instruction.
If a fence.i directly followed a store miss, the d$ would release Stall during the cache line write. Then transition to ReadHold. This cause the d$ flush to go high while in ReadHold. The solution is to ensure the cache continues to assert Stall while in WriteLine state. There was a second issue also. The D$ flush asserted FlushD which flushed the I$ invalidate. Finally the third issue was CacheEn from the FSM needs to be asserted on an InvalidateCache.
This commit is contained in:
		
							parent
							
								
									63dbebcb5a
								
							
						
					
					
						commit
						eb19b1b499
					
				
							
								
								
									
										4
									
								
								pipelined/src/cache/cachefsm.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								pipelined/src/cache/cachefsm.sv
									
									
									
									
										vendored
									
									
								
							| @ -142,7 +142,7 @@ module cachefsm ( | ||||
|   assign CacheStall = (CurrState == STATE_READY & (FlushCache | AnyMiss)) |  | ||||
|                       (CurrState == STATE_FETCH) | | ||||
|                       (CurrState == STATE_WRITEBACK) | | ||||
|                       (CurrState == STATE_WRITE_LINE & ~(StoreAMO)) |  // this cycle writes the sram, must keep stalling so the next cycle can read the next hit/miss unless its a write.
 | ||||
|                       (CurrState == STATE_WRITE_LINE) |  // this cycle writes the sram, must keep stalling so the next cycle can read the next hit/miss unless its a write.
 | ||||
|                       (CurrState == STATE_FLUSH) | | ||||
|                       (CurrState == STATE_FLUSH_WRITEBACK); | ||||
|   // write enables internal to cache
 | ||||
| @ -182,6 +182,6 @@ module cachefsm ( | ||||
|                   resetDelay; | ||||
| 
 | ||||
|   assign SelFetchBuffer = CurrState == STATE_WRITE_LINE | CurrState == STATE_READ_HOLD; | ||||
|   assign CacheEn = (~Stall | FlushCache | AnyMiss) | (CurrState != STATE_READY) | reset; | ||||
|   assign CacheEn = (~Stall | FlushCache | AnyMiss) | (CurrState != STATE_READY) | reset | InvalidateCache; | ||||
|                         | ||||
| endmodule // cachefsm
 | ||||
|  | ||||
							
								
								
									
										2
									
								
								pipelined/src/cache/cacheway.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								pipelined/src/cache/cacheway.sv
									
									
									
									
										vendored
									
									
								
							| @ -150,7 +150,7 @@ module cacheway #(parameter NUMLINES=512, LINELEN = 256, TAGLEN = 26, | ||||
|     if (reset) ValidBits        <= #1 '0; | ||||
|     if(CacheEn) begin  | ||||
| 	  ValidWay <= #1 ValidBits[CAdr]; | ||||
| 	  if(InvalidateCache & ~FlushStage)                    ValidBits <= #1 '0; | ||||
| 	  if(InvalidateCache)                    ValidBits <= #1 '0; | ||||
|       else if (SetValidEN | (ClearValidWay & ~FlushStage)) ValidBits[CAdr] <= #1 SetValidWay; | ||||
|     end | ||||
|   end | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user