mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	File name change for cachereplacement policy to cacheLRU
This commit is contained in:
		
							parent
							
								
									4e926ba4cf
								
							
						
					
					
						commit
						e1dbe58632
					
				
							
								
								
									
										2
									
								
								pipelined/src/cache/cache.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								pipelined/src/cache/cache.sv
									
									
									
									
										vendored
									
									
								
							@ -131,7 +131,7 @@ module cache #(parameter LINELEN,  NUMLINES,  NUMWAYS, LOGBWPL, WORDLEN, MUXINTE
 | 
			
		||||
    .FlushWay, .SelFlush, .ReadDataLineWay, .HitWay, .VictimDirtyWay, .VictimTagWay, .FlushStage,
 | 
			
		||||
    .Invalidate(InvalidateCache));
 | 
			
		||||
  if(NUMWAYS > 1) begin:vict
 | 
			
		||||
    cachereplacementpolicy #(NUMWAYS, SETLEN, OFFSETLEN, NUMLINES) cachereplacementpolicy(
 | 
			
		||||
    cacheLRU #(NUMWAYS, SETLEN, OFFSETLEN, NUMLINES) cacheLRU(
 | 
			
		||||
      .clk, .reset, .ce(SRAMEnable), .HitWay, .VictimWay, .RAdr, .LRUWriteEn(LRUWriteEn & ~FlushStage), .SetValid);
 | 
			
		||||
  end else assign VictimWay = 1'b1; // one hot.
 | 
			
		||||
  assign CacheHit = | HitWay;
 | 
			
		||||
 | 
			
		||||
@ -30,7 +30,7 @@
 | 
			
		||||
 | 
			
		||||
`include "wally-config.vh"
 | 
			
		||||
 | 
			
		||||
module cachereplacementpolicy
 | 
			
		||||
module cacheLRU
 | 
			
		||||
  #(parameter NUMWAYS = 4, SETLEN = 9, OFFSETLEN = 5, NUMLINES = 128)(
 | 
			
		||||
   input logic                clk, reset, ce,
 | 
			
		||||
   input logic [NUMWAYS-1:0]  HitWay,
 | 
			
		||||
@ -61,8 +61,7 @@ module cachereplacementpolicy
 | 
			
		||||
    return log2;
 | 
			
		||||
  endfunction // log2
 | 
			
		||||
 | 
			
		||||
  // proposed generic solution
 | 
			
		||||
  // mux between HitWay on a hit and victimway on a miss.
 | 
			
		||||
  // On a miss we need to ignore HitWay and derive the new replacement bits with the VictimWay.
 | 
			
		||||
  mux2 #(NUMWAYS) WayMux(HitWay, VictimWay, SetValid, Way);
 | 
			
		||||
  binencoder #(NUMWAYS) encoder(Way, WayEncoded);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user