mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Fixed bug.
It was possible for DTLBMissM to prevent a dcache flush.
This commit is contained in:
		
							parent
							
								
									33beaa4593
								
							
						
					
					
						commit
						1c83914662
					
				
							
								
								
									
										2
									
								
								bugs.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								bugs.txt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					1. [X] Cache is suppressing d cache flush if there is a dtlb miss.
 | 
				
			||||||
 | 
					   1. Fixed by disabling mmu's address translation on flush.
 | 
				
			||||||
							
								
								
									
										6
									
								
								pipelined/src/cache/cachefsm.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								pipelined/src/cache/cachefsm.sv
									
									
									
									
										vendored
									
									
								
							@ -113,7 +113,7 @@ module cachefsm
 | 
				
			|||||||
  // using both IgnoreRequestTLB and IgnoreRequestTrapM.  Otherwise we can just use IgnoreRequestTLB.
 | 
					  // using both IgnoreRequestTLB and IgnoreRequestTrapM.  Otherwise we can just use IgnoreRequestTLB.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // need to re organize all of these.  Low priority though.
 | 
					  // need to re organize all of these.  Low priority though.
 | 
				
			||||||
  assign DoFlush = FlushCache & ~IgnoreRequest;
 | 
					  assign DoFlush = FlushCache & ~IgnoreRequestTrapM; // do NOT suppress flush on DTLBMissM. Does not depend on address translation.
 | 
				
			||||||
  assign AMO = Atomic[1] & (&RW);
 | 
					  assign AMO = Atomic[1] & (&RW);
 | 
				
			||||||
  assign DoAMO = AMO & ~IgnoreRequest; 
 | 
					  assign DoAMO = AMO & ~IgnoreRequest; 
 | 
				
			||||||
  assign DoAMOHit = DoAMO & CacheHit;
 | 
					  assign DoAMOHit = DoAMO & CacheHit;
 | 
				
			||||||
@ -224,8 +224,8 @@ module cachefsm
 | 
				
			|||||||
                         (CurrState == STATE_FLUSH_CLEAR_DIRTY & FlushWayFlag & ~FlushAdrFlag);
 | 
					                         (CurrState == STATE_FLUSH_CLEAR_DIRTY & FlushWayFlag & ~FlushAdrFlag);
 | 
				
			||||||
  assign FlushWayCntEn = (CurrState == STATE_FLUSH_CHECK & ~VictimDirty & ~(FlushFlag)) |
 | 
					  assign FlushWayCntEn = (CurrState == STATE_FLUSH_CHECK & ~VictimDirty & ~(FlushFlag)) |
 | 
				
			||||||
                         (CurrState == STATE_FLUSH_CLEAR_DIRTY & ~(FlushFlag));
 | 
					                         (CurrState == STATE_FLUSH_CLEAR_DIRTY & ~(FlushFlag));
 | 
				
			||||||
  assign FlushAdrCntRst = (CurrState == STATE_READY & DoFlush);
 | 
					  assign FlushAdrCntRst = (CurrState == STATE_READY);
 | 
				
			||||||
  assign FlushWayCntRst = (CurrState == STATE_READY & DoFlush) | (CurrState == STATE_FLUSH_INCR);
 | 
					  assign FlushWayCntRst = (CurrState == STATE_READY) | (CurrState == STATE_FLUSH_INCR);
 | 
				
			||||||
  // Bus interface controls
 | 
					  // Bus interface controls
 | 
				
			||||||
  assign CacheFetchLine = (CurrState == STATE_READY & (DoAMOMiss | DoWriteMiss | DoReadMiss));
 | 
					  assign CacheFetchLine = (CurrState == STATE_READY & (DoAMOMiss | DoWriteMiss | DoReadMiss));
 | 
				
			||||||
  assign CacheWriteLine = (CurrState == STATE_MISS_FETCH_DONE & VictimDirty) |
 | 
					  assign CacheWriteLine = (CurrState == STATE_MISS_FETCH_DONE & VictimDirty) |
 | 
				
			||||||
 | 
				
			|||||||
@ -139,7 +139,7 @@ module lsu (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    mmu #(.TLB_ENTRIES(`DTLB_ENTRIES), .IMMU(0))
 | 
					    mmu #(.TLB_ENTRIES(`DTLB_ENTRIES), .IMMU(0))
 | 
				
			||||||
    dmmu(.clk, .reset, .SATP_REGW, .STATUS_MXR, .STATUS_SUM, .STATUS_MPRV, .STATUS_MPP,
 | 
					    dmmu(.clk, .reset, .SATP_REGW, .STATUS_MXR, .STATUS_SUM, .STATUS_MPRV, .STATUS_MPP,
 | 
				
			||||||
      .PrivilegeModeW, .DisableTranslation(SelHPTW),
 | 
					      .PrivilegeModeW, .DisableTranslation(SelHPTW | FlushDCacheM),
 | 
				
			||||||
      .PAdr(PreLSUPAdrM),
 | 
					      .PAdr(PreLSUPAdrM),
 | 
				
			||||||
      .VAdr(IEUAdrM),
 | 
					      .VAdr(IEUAdrM),
 | 
				
			||||||
      .Size(LSUFunct3M[1:0]),
 | 
					      .Size(LSUFunct3M[1:0]),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user