mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Coverage improvements
This commit is contained in:
		
							parent
							
								
									5d8d82414b
								
							
						
					
					
						commit
						66c1c71a56
					
				| @ -58,7 +58,7 @@ coverage exclude -scope /dut/core/fpu/fpu/postprocess/flags -linerange [GetLineN | ||||
| # This is cleaner than trying to set an I$-specific pragma in cachefsm.sv (which would exclude it for the D$ instance too) | ||||
| # Also exclude the write line to ready transition for the I$ since we can't get a flush during this operation. | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -fstate CurrState STATE_FLUSH STATE_FLUSH_WRITEBACK STATE_FLUSH_WRITEBACK STATE_WRITEBACK | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -ftrans CurrState STATE_WRITE_LINE->STATE_READY | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -ftrans CurrState STATE_WRITE_LINE->STATE_READY STATE_FETCH->STATE_READY | ||||
| # exclude unused transitions from case statement. Unfortunately the whole branch needs to be excluded I think. Expression coverage should still work. | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -linerange [GetLineNum ../src/cache/cachefsm.sv "exclusion-tag: icache state-case"] -item b 1 | ||||
| # exclude branch/condition coverage: LineDirty if statement | ||||
| @ -84,6 +84,7 @@ coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -linerange [Get | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -linerange [GetLineNum ../src/cache/cachefsm.sv "exclusion-tag: icache SelAdrCauses"] -item e 1 -fecexprrow 4 10 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -linerange [GetLineNum ../src/cache/cachefsm.sv "exclusion-tag: icache SelAdrTag"] -item e 1 -fecexprrow 8  | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/cachefsm -linerange [GetLineNum ../src/cache/cachefsm.sv "exclusion-tag: icache CacheBusRCauses"] -item e 1 -fecexprrow 1-2 12 | ||||
| 
 | ||||
| # cache.sv AdrSelMuxData and AdrSelMuxTag and CacheBusAdrMux, excluding unhit Flush branch | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/AdrSelMuxData -linerange [GetLineNum ../src/generic/mux.sv "exclusion-tag: mux3"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/icache/AdrSelMuxTag -linerange [GetLineNum ../src/generic/mux.sv "exclusion-tag: mux3"] -item b 1 | ||||
| @ -104,25 +105,24 @@ for {set i 0} {$i < $numcacheways} {incr i} { | ||||
| } | ||||
| # I$ buscachefsm does not perform atomics or write/writeback; HREADY is always 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicReadData"] | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm Atomic"] | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicElse"] -item s 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicPhase"] | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicWait"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicWait"] -item bs 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm FetchWriteback"] -item b 2 | ||||
| #coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm FetchWait"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm FetchWriteback"] -item s 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm WritebackWriteback"]  | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm WritebackWriteback2"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY1"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY4"] -item b 1 | ||||
| #coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY5"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY6"] -item b 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY1"] -item c 1 -feccondrow 1,2,4 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm WritebackWriteback2"] -item bs 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY4"] -item bs 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY6"] -item bs 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADYread"] -item c 1 -feccondrow 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm FetchWriteback"] -item c 1 -feccondrow 1,2,3,4,6 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY4"] -item c 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY6"] -item c 1 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "assign HTRANS"] -item c 1 -feccondrow 5 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "assign BeatCntEn"] -item e 1 -fecexprrow 4 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "assign CacheAccess"] -item e 1 -fecexprrow 4 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "assign BusStall"] -item e 1 -fecexprrow 10,12,18 | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "assign CacheBusAck"] -item e 1 -fecexprrow 3 | ||||
| 
 | ||||
| ## D$ Exclusions. | ||||
| # InvalidateCache is I$ only: | ||||
| @ -143,7 +143,7 @@ for {set i 0} {$i < $numcacheways} {incr i} { | ||||
| # Not right; other ways can get flushed and dirtied simultaneously    coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/CacheWays[$i] -linerange [GetLineNum ../src/cache/cacheway.sv "exclusion-tag: cache UpdateDirty"] -item c 1 -feccondrow 6 | ||||
| } | ||||
| # D$ writeback, flush, write_line, or flush_writeback states can't be cancelled by a flush | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/cachefsm -ftrans CurrState STATE_WRITEBACK->STATE_READY STATE_FLUSH->STATE_READY STATE_WRITE_LINE->STATE_READY STATE_FLUSH_WRITEBACK->STATE_READY | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/dcache/cachefsm -ftrans CurrState STATE_WRITEBACK->STATE_READY STATE_FLUSH->STATE_READY STATE_WRITE_LINE->STATE_READY STATE_FLUSH_WRITEBACK->STATE_READY  | ||||
| 
 | ||||
| #################### | ||||
| # Unused / illegal peripheral accesses | ||||
| @ -193,22 +193,15 @@ set line [GetLineNum ../src/mmu/adrdec.sv "& SizeValid"] | ||||
| coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/uncoreramdec -linerange $line-$line -item e 1 -fecexprrow 5 | ||||
| 
 | ||||
| # set line [GetLineNum ../src/mmu/adrdec.sv "& Supported"] | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/dtimdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/iromdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/ddr4dec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/gpiodec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/uartdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/plicdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/sdcdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/ifu/immu/immu/pmachecker/adrdecs/dtimdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/ifu/immu/immu/pmachecker/adrdecs/iromdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/ifu/immu/immu/pmachecker/adrdecs/ddr4dec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| # coverage exclude -scope /dut/core/ifu/immu/immu/pmachecker/adrdecs/sdcdec -linerange $line-$line -item e 1 -fecexprrow 3 | ||||
| coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/dtimdec | ||||
| coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/iromdec | ||||
| coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/ddr4dec | ||||
| coverage exclude -scope /dut/core/lsu/dmmu/dmmu/pmachecker/adrdecs/sdcdec | ||||
| 
 | ||||
| # No DTIM or IROM | ||||
| coverage exclude -scope /dut/core/ifu/bus/icache/UnCachedDataMux -linerange [GetLineNum ../src/generic/mux.sv "exclusion-tag: mux3"] -item b 1 | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/UnCachedDataMux -linerange [GetLineNum ../src/generic/mux.sv "exclusion-tag: mux3"] -item b 1 | ||||
| 
 | ||||
| #################### | ||||
| # Unused access types due to sharing IFU and LSU logic | ||||
| #################### | ||||
| @ -347,7 +340,7 @@ coverage exclude -scope /dut/core/ebu/ebu/ebufsmarb -linerange $line-$line -item | ||||
| set line [GetLineNum ../src/ebu/ebufsmarb.sv "FinalBeatReg\\("] | ||||
| coverage exclude -scope /dut/core/ebu/ebu/ebufsmarb -linerange $line-$line -item e 1 -fecexprrow 1 | ||||
| 
 | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm Atomic"] | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicElse"] | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line  -item bc 1 | ||||
| 
 | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicWait"] | ||||
| @ -365,15 +358,15 @@ coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefs | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm FetchWait"] | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item bc 1 | ||||
| 
 | ||||
| # all of these HEADY exclusions occur because HREADY is always 1.  The ram_ahb module never stalls. | ||||
| # all of these HREADY exclusions occur because HREADY is always 1.  The ram_ahb module never stalls. | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY0"] | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 1 | ||||
| 
 | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY1"] | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 1 | ||||
| #set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY1"] | ||||
| #coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 1 | ||||
| 
 | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY2"] | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 1 | ||||
| #set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY2"] | ||||
| #coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 1 | ||||
| 
 | ||||
| set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREADY3"] | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 4 | ||||
| @ -389,6 +382,14 @@ set line [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm HREAD | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 1 | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange $line-$line -item c 1 -feccondrow 5 | ||||
| 
 | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "assign CacheBusAck"] -item e 1 -fecexprrow 5 | ||||
| 
 | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicElse"] -item s 1 | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -linerange [GetLineNum ../src/ebu/buscachefsm.sv "exclusion-tag: buscachefsm AtomicWait"] -item s 1 | ||||
| 
 | ||||
| # these transitions will not happen | ||||
| coverage exclude -scope /dut/core/lsu/bus/dcache/ahbcacheinterface/AHBBuscachefsm -ftrans CurrState DATA_PHASE->ADR_PHASE ATOMIC_READ_DATA_PHASE->ADR_PHASE ATOMIC_PHASE->ADR_PHASE | ||||
| 
 | ||||
| # TLB not recently used never has all RU bits = 1 because it will then clear all to 0 | ||||
| # This is a blunt instrument; perhaps there is a more graceful exclusion | ||||
| coverage exclude -srcfile priorityonehot.sv  | ||||
|  | ||||
							
								
								
									
										2
									
								
								src/cache/cacheLRU.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/cache/cacheLRU.sv
									
									
									
									
										vendored
									
									
								
							| @ -143,7 +143,7 @@ module cacheLRU | ||||
|   // This is a two port memory.
 | ||||
|   // Every cycle must read from CacheSetData and each load/store must write the new LRU.
 | ||||
|   always_ff @(posedge clk) begin | ||||
|     if (reset | (InvalidateCache & ~FlushStage)) for (int set = 0; set < NUMLINES; set++) LRUMemory[set] = '0; | ||||
|     if (reset) for (int set = 0; set < NUMLINES; set++) LRUMemory[set] = '0; // exclusion-tag: initialize
 | ||||
|     if(CacheEn) begin | ||||
|       if(ClearValid & ~FlushStage) | ||||
|         LRUMemory[PAdr] <= '0; | ||||
|  | ||||
							
								
								
									
										5
									
								
								src/cache/cachefsm.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								src/cache/cachefsm.sv
									
									
									
									
										vendored
									
									
								
							| @ -119,7 +119,7 @@ module cachefsm import cvw::*; #(parameter cvw_t P, | ||||
|       STATE_READY:           if(InvalidateCache)                               NextState = STATE_READY;     // exclusion-tag: dcache InvalidateCheck
 | ||||
|                              else if(FlushCache & ~READ_ONLY_CACHE)            NextState = STATE_FLUSH;     // exclusion-tag: icache FLUSHStatement
 | ||||
|                              else if(AnyMiss & (READ_ONLY_CACHE | ~LineDirty)) NextState = STATE_FETCH;     // exclusion-tag: icache FETCHStatement
 | ||||
|                              else if(AnyMiss | CMOWriteback)                   NextState = STATE_WRITEBACK; // exclusion-tag: icache WRITEBACKStatement
 | ||||
|                              else if((AnyMiss | CMOWriteback) & ~READ_ONLY_CACHE) NextState = STATE_WRITEBACK; // exclusion-tag: icache WRITEBACKStatement
 | ||||
|                              else                                              NextState = STATE_READY; | ||||
|       STATE_FETCH:           if(CacheBusAck)                                   NextState = STATE_WRITE_LINE; | ||||
|                              else                                              NextState = STATE_FETCH; | ||||
| @ -157,7 +157,6 @@ module cachefsm import cvw::*; #(parameter cvw_t P, | ||||
|                     (CurrState == STATE_WRITEBACK & CacheBusAck & CMOpM[3]);  | ||||
|   assign ClearValid = (CurrState == STATE_READY & CMOpM[0]) | | ||||
|                       (CurrState == STATE_WRITEBACK & CMOpM[2] & CacheBusAck); | ||||
|   // coverage off -item e 1 -fecexprrow 8
 | ||||
|   assign LRUWriteEn = (((CurrState == STATE_READY & (AnyHit | CMOZeroNoEviction)) | | ||||
|                        (CurrState == STATE_WRITE_LINE)) & ~FlushStage) | | ||||
|                       (CurrState == STATE_WRITEBACK & CMOpM[3] & CacheBusAck); | ||||
| @ -189,8 +188,6 @@ module cachefsm import cvw::*; #(parameter cvw_t P, | ||||
|                          (CurrState == STATE_WRITEBACK & CacheBusAck & ~(|CMOpM)); | ||||
| 
 | ||||
|   logic LoadMiss; | ||||
|    | ||||
|   //assign StoreMiss = (CacheRW[0]) & ~CacheHit & ~InvalidateCache; // exclusion-tag: cache AnyMiss
 | ||||
|   assign LoadMiss = (CacheRW[1]) & ~CacheHit & ~InvalidateCache; // exclusion-tag: cache AnyMiss
 | ||||
| 
 | ||||
|   assign CacheBusRW[0] = (CurrState == STATE_READY & LoadMiss & LineDirty) | // exclusion-tag: icache CacheBusW
 | ||||
|  | ||||
							
								
								
									
										2
									
								
								src/cache/cacheway.sv
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/cache/cacheway.sv
									
									
									
									
										vendored
									
									
								
							| @ -53,7 +53,7 @@ module cacheway import cvw::*; #(parameter cvw_t P, | ||||
|   output logic [LINELEN-1:0]          ReadDataLineWay,// This way's read data if valid
 | ||||
|   output logic                        HitWay,         // This way hits
 | ||||
|   output logic                        ValidWay,       // This way is valid
 | ||||
|   output logic                        HitDirtyWay, // The hit way is dirty
 | ||||
|   output logic                        HitDirtyWay,    // The hit way is dirty
 | ||||
|   output logic                        DirtyWay   ,    // The selected way is dirty
 | ||||
|   output logic [TAGLEN-1:0]           TagWay);        // This way's tag if valid
 | ||||
| 
 | ||||
|  | ||||
| @ -79,7 +79,7 @@ module buscachefsm #( | ||||
|   logic                   CacheAccess; | ||||
|   logic                   BusWrite; | ||||
| 
 | ||||
|   assign BusWrite = CacheBusRW[0] | BusCMOZero; | ||||
|   assign BusWrite = (CacheBusRW[0] | BusCMOZero) & ~READ_ONLY_CACHE; | ||||
|    | ||||
|   always_ff @(posedge HCLK) | ||||
|     if (~HRESETn | Flush) CurrState <= #1 ADR_PHASE; | ||||
| @ -88,14 +88,14 @@ module buscachefsm #( | ||||
|   always_comb begin | ||||
|       case(CurrState) | ||||
|         ADR_PHASE: if (HREADY & |BusRW)                               NextState = DATA_PHASE;             // exclusion-tag: buscachefsm HREADY0
 | ||||
|                    else if (HREADY & BusWrite)                        NextState = CACHE_WRITEBACK;        // exclusion-tag: buscachefsm HREADY1
 | ||||
|                    else if (HREADY & BusWrite & ~READ_ONLY_CACHE)     NextState = CACHE_WRITEBACK;        // exclusion-tag: buscachefsm HREADY1
 | ||||
|                    else if (HREADY & CacheBusRW[1])                   NextState = CACHE_FETCH;            // exclusion-tag: buscachefsm HREADYread
 | ||||
|                    else                                               NextState = ADR_PHASE; | ||||
|         DATA_PHASE:  if(HREADY & BusAtomic)                           NextState = ATOMIC_READ_DATA_PHASE; // exclusion-tag: buscachefsm HREADY2
 | ||||
|         DATA_PHASE:  if(HREADY & BusAtomic & ~READ_ONLY_CACHE)        NextState = ATOMIC_READ_DATA_PHASE; // exclusion-tag: buscachefsm HREADY2
 | ||||
|                      else if(HREADY & ~BusAtomic)                     NextState = MEM3; // exclusion-tag: buscachefsm HREADY3
 | ||||
|                      else                                             NextState = DATA_PHASE; | ||||
|         ATOMIC_READ_DATA_PHASE: if(HREADY)                            NextState = ATOMIC_PHASE;           // exclusion-tag: buscachefsm AtomicReadData
 | ||||
|                     else                                              NextState = ATOMIC_READ_DATA_PHASE; // exclusion-tag: buscachefsm Atomic
 | ||||
|                     else                                              NextState = ATOMIC_READ_DATA_PHASE; // exclusion-tag: buscachefsm AtomicElse
 | ||||
|         ATOMIC_PHASE: if(HREADY)                                      NextState = MEM3;                   // exclusion-tag: buscachefsm AtomicPhase
 | ||||
|                       else                                            NextState = ATOMIC_PHASE;           // exclusion-tag: buscachefsm AtomicWait
 | ||||
|         MEM3:        if(Stall)                                        NextState = MEM3; | ||||
| @ -104,7 +104,7 @@ module buscachefsm #( | ||||
|                      else if(HREADY & FinalBeatCount & CacheBusRW[1]) NextState = CACHE_FETCH;      // exclusion-tag: buscachefsm FetchWait
 | ||||
|                      else if(HREADY & FinalBeatCount & ~|CacheBusRW)  NextState = ADR_PHASE; | ||||
|                      else                                             NextState = CACHE_FETCH; | ||||
|         CACHE_WRITEBACK: if(HREADY & FinalBeatCount & CacheBusRW[0])  NextState = CACHE_WRITEBACK; // exclusion-tag: buscachefsm WritebackWriteback
 | ||||
|         CACHE_WRITEBACK:  if(HREADY & FinalBeatCount & CacheBusRW[0]) NextState = CACHE_WRITEBACK; // exclusion-tag: buscachefsm WritebackWriteback
 | ||||
|                      else if(HREADY & FinalBeatCount & CacheBusRW[1]) NextState = CACHE_FETCH;     // exclusion-tag: buscachefsm HREADY4
 | ||||
|                      else if(HREADY & FinalBeatCount & BusCMOZero)    NextState = MEM3;            // exclusion-tag: buscachefsm HREADY5
 | ||||
|                      else if(HREADY & FinalBeatCount & ~|CacheBusRW)  NextState = ADR_PHASE;       // exclusion-tag: buscachefsm HREADY6
 | ||||
| @ -139,12 +139,12 @@ module buscachefsm #( | ||||
| 
 | ||||
|   // AHB bus interface
 | ||||
|   assign HTRANS = (CurrState == ADR_PHASE & HREADY & ((|BusRW) | (|CacheBusRW) | BusCMOZero) & ~Flush) | | ||||
|                   (CurrState == ATOMIC_READ_DATA_PHASE & BusAtomic) |  | ||||
|                   (CurrState == ATOMIC_READ_DATA_PHASE) |  | ||||
|                   (CacheAccess & FinalBeatCount & |CacheBusRW & HREADY & ~Flush) ? AHB_NONSEQ : // if we have a pipelined request
 | ||||
|                   (CacheAccess & |BeatCount) ? (BURST_EN ? AHB_SEQ : AHB_NONSEQ) : AHB_IDLE; | ||||
| 
 | ||||
|   assign HWRITE = ((BusRW[0] & ~BusAtomic) | BusWrite & ~Flush) | (CurrState == ATOMIC_READ_DATA_PHASE & BusAtomic) |  | ||||
|                   (CurrState == CACHE_WRITEBACK & |BeatCount); | ||||
|   assign HWRITE = (((BusRW[0] & ~BusAtomic) | BusWrite & ~Flush) | (CurrState == ATOMIC_READ_DATA_PHASE & BusAtomic) |  | ||||
|                   (CurrState == CACHE_WRITEBACK & |BeatCount)) & ~READ_ONLY_CACHE; | ||||
|   assign HBURST = BURST_EN & ((|CacheBusRW & ~Flush) | (CacheAccess & |BeatCount)) ? LocalBurstType : 3'b0;   | ||||
|    | ||||
|   always_comb begin | ||||
|  | ||||
| @ -180,7 +180,7 @@ module testbench; | ||||
|     end | ||||
|     if (tests.size() == 0) begin | ||||
|       $display("TEST %s not supported in this configuration", TEST); | ||||
|       $stop; | ||||
|       $finish; | ||||
|     end | ||||
|   end // initial begin
 | ||||
| 
 | ||||
| @ -300,7 +300,7 @@ module testbench; | ||||
|     if (TEST == "coremark") | ||||
|       if (dut.core.priv.priv.EcallFaultM) begin | ||||
|         $display("Benchmark: coremark is done."); | ||||
|         $stop; | ||||
|         $finish; | ||||
|       end | ||||
|     if(Validate) begin | ||||
|       if (TEST == "embench") begin | ||||
| @ -337,7 +337,7 @@ module testbench; | ||||
|       if (test == tests.size()) begin | ||||
|         if (totalerrors == 0) $display("SUCCESS! All tests ran without failures."); | ||||
|         else $display("FAIL: %d test programs had errors", totalerrors); | ||||
|         $stop; | ||||
|         $finish; | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| @ -601,7 +601,7 @@ module testbench; | ||||
|         errors = errors+1; | ||||
|         $display("  Error on test %s result %d: adr = %h sim (D$) %h sim (DTIM_SUPPORTED) = %h, signature = %h",  | ||||
| 			     TestName, i, (testadr+i)*(P.XLEN/8), testbench.DCacheFlushFSM.ShadowRAM[testadr+i], sig, signature[i]); | ||||
|         $stop; | ||||
|         $finish; | ||||
|       end | ||||
|     end | ||||
|     if (errors) $display("%s failed with %d errors. :(", TestName, errors); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user