forked from Github_Repos/cvw
		
	Remove FlushStage Logic from CacheLRU
For coverage. LRUWriteEn is gated by FlushStage in cache.sv, so removing the signal completely avoids future confusion. Update cache.sv to reflect cacheLRU edit.
This commit is contained in:
		
							parent
							
								
									3fc6bb0c40
								
							
						
					
					
						commit
						6dce58125b
					
				
							
								
								
									
										2
									
								
								src/cache/cache.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/cache/cache.sv
									
									
									
									
										vendored
									
									
								
							@ -122,7 +122,7 @@ module cache #(parameter LINELEN,  NUMLINES,  NUMWAYS, LOGBWPL, WORDLEN, MUXINTE
 | 
			
		||||
  // Select victim way for associative caches
 | 
			
		||||
  if(NUMWAYS > 1) begin:vict
 | 
			
		||||
    cacheLRU #(NUMWAYS, SETLEN, OFFSETLEN, NUMLINES) cacheLRU(
 | 
			
		||||
      .clk, .reset, .CacheEn, .FlushStage, .HitWay, .ValidWay, .VictimWay, .CacheSet, .LRUWriteEn(LRUWriteEn & ~FlushStage),
 | 
			
		||||
      .clk, .reset, .CacheEn, .HitWay, .ValidWay, .VictimWay, .CacheSet, .LRUWriteEn(LRUWriteEn & ~FlushStage),
 | 
			
		||||
      .SetValid, .PAdr(PAdr[SETTOP-1:OFFSETLEN]), .InvalidateCache, .FlushCache);
 | 
			
		||||
  end else 
 | 
			
		||||
    assign VictimWay = 1'b1; // one hot.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								src/cache/cacheLRU.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								src/cache/cacheLRU.sv
									
									
									
									
										vendored
									
									
								
							@ -32,8 +32,7 @@
 | 
			
		||||
module cacheLRU
 | 
			
		||||
  #(parameter NUMWAYS = 4, SETLEN = 9, OFFSETLEN = 5, NUMLINES = 128) (
 | 
			
		||||
  input  logic                clk, 
 | 
			
		||||
  input  logic                reset, 
 | 
			
		||||
  input  logic                FlushStage,      // Pipeline flush of second stage (prevent writes and bus operations)
 | 
			
		||||
  input  logic                reset,
 | 
			
		||||
  input  logic                CacheEn,         // Enable the cache memory arrays.  Disable hold read data constant
 | 
			
		||||
  input  logic [NUMWAYS-1:0]  HitWay,          // Which way is valid and matches PAdr's tag
 | 
			
		||||
  input  logic [NUMWAYS-1:0]  ValidWay,        // Which ways for a particular set are valid, ignores tag
 | 
			
		||||
@ -134,11 +133,9 @@ module cacheLRU
 | 
			
		||||
  always_ff @(posedge clk) begin
 | 
			
		||||
    if (reset) for (int set = 0; set < NUMLINES; set++) LRUMemory[set] <= '0;
 | 
			
		||||
    if(CacheEn) begin
 | 
			
		||||
      // if((InvalidateCache | FlushCache) & ~FlushStage) for (int set = 0; set < NUMLINES; set++) LRUMemory[set] <= '0;
 | 
			
		||||
      if (LRUWriteEn & ~FlushStage) begin 
 | 
			
		||||
      if(LRUWriteEn)
 | 
			
		||||
        LRUMemory[PAdr] <= NextLRU;
 | 
			
		||||
      end
 | 
			
		||||
      if(LRUWriteEn & ~FlushStage & (PAdr == CacheSet))
 | 
			
		||||
      if(LRUWriteEn & (PAdr == CacheSet))
 | 
			
		||||
        CurrLRU <= #1 NextLRU;
 | 
			
		||||
      else 
 | 
			
		||||
        CurrLRU <= #1 LRUMemory[CacheSet];
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user