mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Added comments to some files, added a+b = 0 detector to comparator.sv
This commit is contained in:
		
							parent
							
								
									2d175e2a37
								
							
						
					
					
						commit
						4335895b21
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -104,3 +104,5 @@ pipelined/config/rv64ic_noPriv
 | 
			
		||||
pipelined/config/rv64ic_orig
 | 
			
		||||
synthDC/Summary.csv
 | 
			
		||||
pipelined/srt/exptestgen
 | 
			
		||||
pipelined/srt/testgen
 | 
			
		||||
pipelined/srt/qst2
 | 
			
		||||
 | 
			
		||||
@ -237,6 +237,7 @@ module fpu (
 | 
			
		||||
   // select the result that may be written to the integer register - to IEU
 | 
			
		||||
   mux4  #(`XLEN)  IntResMux(CmpResE[`XLEN-1:0], FSrcXE[`XLEN-1:0], ClassResE[`XLEN-1:0], 
 | 
			
		||||
               CvtResE[`XLEN-1:0], FIntResSelE, FIntResE);
 | 
			
		||||
   // *** DH 5/25/22: CvtRes will move to mem stage.  Premux in execute to save area, then make sure stalls are ok
 | 
			
		||||
 | 
			
		||||
   // E/M pipe registers
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -65,7 +65,7 @@ module hazard(
 | 
			
		||||
  assign StallFCause = CSRWritePendingDEM & ~(TrapM | RetM | BPPredWrongE);
 | 
			
		||||
  // stall in decode if instruction is a load/mul/csr dependent on previous
 | 
			
		||||
  assign StallDCause = (LoadStallD | StoreStallD | MDUStallD | CSRRdStallD | FPUStallD | FStallD) & ~(TrapM | RetM | BPPredWrongE);    
 | 
			
		||||
  assign StallECause = (DivBusyE | FDivBusyE) & ~(TrapM);
 | 
			
		||||
  assign StallECause = (DivBusyE | FDivBusyE) & ~(TrapM);  // *** can we move to decode stage (KP?)
 | 
			
		||||
  // WFI terminates if any enabled interrupt is pending, even if global interrupts are disabled.  It could also terminate with TW trap
 | 
			
		||||
  assign StallMCause = wfiM & (~TrapM & ~IntPendingM);  
 | 
			
		||||
  assign StallWCause = LSUStallM | IFUStallF;
 | 
			
		||||
 | 
			
		||||
@ -30,6 +30,15 @@
 | 
			
		||||
 | 
			
		||||
`include "wally-config.vh"
 | 
			
		||||
 | 
			
		||||
module donedet #(parameter WIDTH=64) (
 | 
			
		||||
  input  logic [WIDTH-1:0] a, b,
 | 
			
		||||
  output logic        eq);
 | 
			
		||||
 | 
			
		||||
  //assign eq = (a+b == 0); // gives good speed but 3x necessary area
 | 
			
		||||
  // See CMOS VLSI Design 4th Ed. p. 463 K = A+B for K = 0
 | 
			
		||||
  assign eq = ((a ^ b) == {a[WIDTH-2:0], 1'b0} | {b[WIDTH-2:0], 1'b0});
 | 
			
		||||
 endmodule
 | 
			
		||||
 | 
			
		||||
module comparator_sub #(parameter WIDTH=64) (
 | 
			
		||||
  input  logic [WIDTH-1:0] a, b,
 | 
			
		||||
  output logic [2:0]       flags);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,10 @@
 | 
			
		||||
all: sqrttestgen testgen
 | 
			
		||||
all: sqrttestgen testgen qst2
 | 
			
		||||
 | 
			
		||||
sqrttestgen: sqrttestgen.c
 | 
			
		||||
	gcc sqrttestgen.c -lm -o sqrttestgen
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
testgen: testgen.c
 | 
			
		||||
	gcc testgen.c -lm -o testgen
 | 
			
		||||
 | 
			
		||||
qst2: qst2.c
 | 
			
		||||
	gcc qst2.c -lm -o qst2
 | 
			
		||||
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user