Added comments to some files, added a+b = 0 detector to comparator.sv

This commit is contained in:
David Harris 2022-05-28 09:41:48 +00:00
parent d78451e39c
commit 4237bb7abd
6 changed files with 18 additions and 3 deletions

2
.gitignore vendored
View file

@ -104,3 +104,5 @@ pipelined/config/rv64ic_noPriv
pipelined/config/rv64ic_orig
synthDC/Summary.csv
pipelined/srt/exptestgen
pipelined/srt/testgen
pipelined/srt/qst2

View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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.