mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Cleanup spill logic.
This commit is contained in:
		
							parent
							
								
									fdd7b68501
								
							
						
					
					
						commit
						a538d4316f
					
				@ -52,7 +52,7 @@ module spillsupport #(parameter CACHE_ENABLED)
 | 
				
			|||||||
  localparam integer   SPILLTHRESHOLD = CACHE_ENABLED ? `ICACHE_LINELENINBITS/32 : 1;
 | 
					  localparam integer   SPILLTHRESHOLD = CACHE_ENABLED ? `ICACHE_LINELENINBITS/32 : 1;
 | 
				
			||||||
  logic [`XLEN-1:0]    PCPlus2F;
 | 
					  logic [`XLEN-1:0]    PCPlus2F;
 | 
				
			||||||
  logic                TakeSpillF;
 | 
					  logic                TakeSpillF;
 | 
				
			||||||
  logic                SpillF, PossibleSpillF, FirstHalfCompressedF;
 | 
					  logic                FirstHalfCompressedF;
 | 
				
			||||||
  logic                SelSpillF, SpillSaveF;
 | 
					  logic                SelSpillF, SpillSaveF;
 | 
				
			||||||
  logic [15:0]         InstrFirstHalfF;
 | 
					  logic [15:0]         InstrFirstHalfF;
 | 
				
			||||||
  typedef enum logic [1:0]     {STATE_READY, STATE_SPILL} statetype;
 | 
					  typedef enum logic [1:0]     {STATE_READY, STATE_SPILL} statetype;
 | 
				
			||||||
@ -65,9 +65,7 @@ module spillsupport #(parameter CACHE_ENABLED)
 | 
				
			|||||||
  // select between PCF and PCF+2
 | 
					  // select between PCF and PCF+2
 | 
				
			||||||
  mux2 #(`XLEN) pcspillmux(.d0(PCF), .d1(PCPlus2F), .s(SelSpillF), .y(PCFSpill));
 | 
					  mux2 #(`XLEN) pcspillmux(.d0(PCF), .d1(PCPlus2F), .s(SelSpillF), .y(PCFSpill));
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  assign PossibleSpillF = &PCF[$clog2(SPILLTHRESHOLD)+1:1];
 | 
					  assign TakeSpillF = &PCF[$clog2(SPILLTHRESHOLD)+1:1] & ~FirstHalfCompressedF & ~IFUCacheBusStallD & ~ITLBMissF;
 | 
				
			||||||
  assign SpillF = PossibleSpillF & ~FirstHalfCompressedF & ~IFUCacheBusStallD;
 | 
					 | 
				
			||||||
  assign TakeSpillF = SpillF & ~ITLBMissF;
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  always_ff @(posedge clk)
 | 
					  always_ff @(posedge clk)
 | 
				
			||||||
    if (reset | Flush)    CurrState <= #1 STATE_READY;
 | 
					    if (reset | Flush)    CurrState <= #1 STATE_READY;
 | 
				
			||||||
@ -88,11 +86,7 @@ module spillsupport #(parameter CACHE_ENABLED)
 | 
				
			|||||||
                         (CurrState == STATE_SPILL & IFUCacheBusStallD);
 | 
					                         (CurrState == STATE_SPILL & IFUCacheBusStallD);
 | 
				
			||||||
  assign SpillSaveF = (CurrState == STATE_READY) & TakeSpillF;
 | 
					  assign SpillSaveF = (CurrState == STATE_READY) & TakeSpillF;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  flopenr #(16) SpillInstrReg(.clk(clk),
 | 
					  flopenrc #(16) SpillInstrReg(clk, reset, Flush, SpillSaveF, InstrRawF[15:0], InstrFirstHalfF);
 | 
				
			||||||
                              .en(SpillSaveF  & ~Flush),
 | 
					 | 
				
			||||||
                              .reset(reset),
 | 
					 | 
				
			||||||
                              .d(InstrRawF[15:0]),
 | 
					 | 
				
			||||||
                              .q(InstrFirstHalfF));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  mux2 #(32) postspillmux(.d0(InstrRawF), .d1({InstrRawF[15:0], InstrFirstHalfF}), .s(SelSpillF),
 | 
					  mux2 #(32) postspillmux(.d0(InstrRawF), .d1({InstrRawF[15:0], InstrFirstHalfF}), .s(SelSpillF),
 | 
				
			||||||
    .y(PostSpillInstrRawF));
 | 
					    .y(PostSpillInstrRawF));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user