mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-24 22:07:12 -04:00
Added comments to some files, added a+b = 0 detector to comparator.sv
This commit is contained in:
parent
d78451e39c
commit
4237bb7abd
6 changed files with 18 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -104,3 +104,5 @@ pipelined/config/rv64ic_noPriv
|
||||||
pipelined/config/rv64ic_orig
|
pipelined/config/rv64ic_orig
|
||||||
synthDC/Summary.csv
|
synthDC/Summary.csv
|
||||||
pipelined/srt/exptestgen
|
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
|
// 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],
|
mux4 #(`XLEN) IntResMux(CmpResE[`XLEN-1:0], FSrcXE[`XLEN-1:0], ClassResE[`XLEN-1:0],
|
||||||
CvtResE[`XLEN-1:0], FIntResSelE, FIntResE);
|
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
|
// E/M pipe registers
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ module hazard(
|
||||||
assign StallFCause = CSRWritePendingDEM & ~(TrapM | RetM | BPPredWrongE);
|
assign StallFCause = CSRWritePendingDEM & ~(TrapM | RetM | BPPredWrongE);
|
||||||
// stall in decode if instruction is a load/mul/csr dependent on previous
|
// 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 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
|
// 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 StallMCause = wfiM & (~TrapM & ~IntPendingM);
|
||||||
assign StallWCause = LSUStallM | IFUStallF;
|
assign StallWCause = LSUStallM | IFUStallF;
|
||||||
|
|
|
@ -30,6 +30,15 @@
|
||||||
|
|
||||||
`include "wally-config.vh"
|
`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) (
|
module comparator_sub #(parameter WIDTH=64) (
|
||||||
input logic [WIDTH-1:0] a, b,
|
input logic [WIDTH-1:0] a, b,
|
||||||
output logic [2:0] flags);
|
output logic [2:0] flags);
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
all: sqrttestgen testgen
|
all: sqrttestgen testgen qst2
|
||||||
|
|
||||||
sqrttestgen: sqrttestgen.c
|
sqrttestgen: sqrttestgen.c
|
||||||
gcc sqrttestgen.c -lm -o sqrttestgen
|
gcc sqrttestgen.c -lm -o sqrttestgen
|
||||||
|
|
||||||
testgen: testgen.c
|
testgen: testgen.c
|
||||||
gcc testgen.c -lm -o testgen
|
gcc testgen.c -lm -o testgen
|
||||||
|
|
||||||
|
qst2: qst2.c
|
||||||
|
gcc qst2.c -lm -o qst2
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue