mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
commit
453f9e47c4
@ -1 +0,0 @@
|
|||||||
/opt/riscv/imperas-riscv-tests/
|
|
@ -4,7 +4,7 @@ $(TARGET).objdump: $(TARGET)
|
|||||||
riscv64-unknown-elf-objdump -S -D $(TARGET) > $(TARGET).objdump
|
riscv64-unknown-elf-objdump -S -D $(TARGET) > $(TARGET).objdump
|
||||||
|
|
||||||
$(TARGET): $(TARGET).c Makefile
|
$(TARGET): $(TARGET).c Makefile
|
||||||
riscv64-unknown-elf-gcc -o $(TARGET) -g -O\
|
riscv64-unknown-elf-gcc -o $(TARGET) -gdwarf-2 -O\
|
||||||
-march=rv64gc -mabi=lp64d -mcmodel=medany \
|
-march=rv64gc -mabi=lp64d -mcmodel=medany \
|
||||||
-nostdlib -static -lm -fno-tree-loop-distribute-patterns \
|
-nostdlib -static -lm -fno-tree-loop-distribute-patterns \
|
||||||
-T../common/test.ld -I../common \
|
-T../common/test.ld -I../common \
|
||||||
|
@ -29,36 +29,36 @@
|
|||||||
`include "wally-config.vh"
|
`include "wally-config.vh"
|
||||||
|
|
||||||
module bpred (
|
module bpred (
|
||||||
input logic clk, reset,
|
input logic clk, reset,
|
||||||
input logic StallF, StallD, StallE, StallM, StallW,
|
input logic StallF, StallD, StallE, StallM, StallW,
|
||||||
input logic FlushD, FlushE, FlushM, FlushW,
|
input logic FlushD, FlushE, FlushM, FlushW,
|
||||||
// Fetch stage
|
// Fetch stage
|
||||||
// the prediction
|
// the prediction
|
||||||
input logic [31:0] InstrD, // Decompressed decode stage instruction. Used to decode instruction class
|
input logic [31:0] InstrD, // Decompressed decode stage instruction. Used to decode instruction class
|
||||||
input logic [`XLEN-1:0] PCNextF, // Next Fetch Address
|
input logic [`XLEN-1:0] PCNextF, // Next Fetch Address
|
||||||
input logic [`XLEN-1:0] PCPlus2or4F, // PCF+2/4
|
input logic [`XLEN-1:0] PCPlus2or4F, // PCF+2/4
|
||||||
output logic [`XLEN-1:0] PCNext1F, // Branch Predictor predicted or corrected fetch address on miss prediction
|
output logic [`XLEN-1:0] PCNext1F, // Branch Predictor predicted or corrected fetch address on miss prediction
|
||||||
output logic [`XLEN-1:0] NextValidPCE, // Address of next valid instruction after the instruction in the Memory stage
|
output logic [`XLEN-1:0] NextValidPCE, // Address of next valid instruction after the instruction in the Memory stage
|
||||||
|
|
||||||
// Update Predictor
|
// Update Predictor
|
||||||
input logic [`XLEN-1:0] PCF, // Fetch stage instruction address
|
input logic [`XLEN-1:0] PCF, // Fetch stage instruction address
|
||||||
input logic [`XLEN-1:0] PCD, // Decode stage instruction address. Also the address the branch predictor took
|
input logic [`XLEN-1:0] PCD, // Decode stage instruction address. Also the address the branch predictor took
|
||||||
input logic [`XLEN-1:0] PCE, // Execution stage instruction address
|
input logic [`XLEN-1:0] PCE, // Execution stage instruction address
|
||||||
input logic [`XLEN-1:0] PCM, // Memory stage instruction address
|
input logic [`XLEN-1:0] PCM, // Memory stage instruction address
|
||||||
|
|
||||||
// Branch and jump outcome
|
// Branch and jump outcome
|
||||||
input logic PCSrcE, // Executation stage branch is taken
|
input logic PCSrcE, // Executation stage branch is taken
|
||||||
input logic [`XLEN-1:0] IEUAdrE, // The branch/jump target address
|
input logic [`XLEN-1:0] IEUAdrE, // The branch/jump target address
|
||||||
input logic [`XLEN-1:0] PCLinkE, // The address following the branch instruction. (AKA Fall through address)
|
input logic [`XLEN-1:0] dPCLinkE, // The address following the branch instruction. (AKA Fall through address)
|
||||||
output logic [3:0] InstrClassM, // The valid instruction class. 1-hot encoded as jalr, ret, jr (not ret), j, br
|
output logic [3:0] InstrClassM, // The valid instruction class. 1-hot encoded as jalr, ret, jr (not ret), j, br
|
||||||
|
|
||||||
// Report branch prediction status
|
// Report branch prediction status
|
||||||
output logic BPPredWrongE, // Prediction is wrong
|
output logic BPPredWrongE, // Prediction is wrong
|
||||||
output logic DirPredictionWrongM, // Prediction direction is wrong
|
output logic DirPredictionWrongM, // Prediction direction is wrong
|
||||||
output logic BTBPredPCWrongM, // Prediction target wrong
|
output logic BTBPredPCWrongM, // Prediction target wrong
|
||||||
output logic RASPredPCWrongM, // RAS prediction is wrong
|
output logic RASPredPCWrongM, // RAS prediction is wrong
|
||||||
output logic PredictionInstrClassWrongM // Class prediction is wrong
|
output logic PredictionInstrClassWrongM // Class prediction is wrong
|
||||||
);
|
);
|
||||||
|
|
||||||
logic BTBValidF;
|
logic BTBValidF;
|
||||||
logic [1:0] DirPredictionF;
|
logic [1:0] DirPredictionF;
|
||||||
|
Loading…
Reference in New Issue
Block a user