wip
This commit is contained in:
parent
cb1b73bc2b
commit
ec4837a744
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
|
verilator -cc ../VexRiscv.v --trace -Wno-WIDTH --exe tester.cpp
|
||||||
|
make -j -C obj_dir/ -f VVexRiscv.mk VVexRiscv
|
|
@ -0,0 +1,38 @@
|
||||||
|
#include "VVexRiscv.h"
|
||||||
|
#include "verilated.h"
|
||||||
|
#include "verilated_vcd_c.h"
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv, char **env) {
|
||||||
|
int i;
|
||||||
|
int clk;
|
||||||
|
Verilated::commandArgs(argc, argv);
|
||||||
|
// init top verilog instance
|
||||||
|
VVexRiscv* top = new VVexRiscv;
|
||||||
|
// init trace dump
|
||||||
|
Verilated::traceEverOn(true);
|
||||||
|
VerilatedVcdC* tfp = new VerilatedVcdC;
|
||||||
|
top->trace (tfp, 99);
|
||||||
|
tfp->open ("sim.vcd");
|
||||||
|
// initialize simulation inputs
|
||||||
|
top->clk = 1;
|
||||||
|
// top->rst = 1;
|
||||||
|
// top->cen = 0;
|
||||||
|
// top->wen = 0;
|
||||||
|
// top->dat = 0x55;
|
||||||
|
// run simulation for 100 clock periods
|
||||||
|
for (i=0; i<20; i++) {
|
||||||
|
// top->rst = (i < 2);
|
||||||
|
// dump variables into VCD file and toggle clock
|
||||||
|
for (clk=0; clk<2; clk++) {
|
||||||
|
tfp->dump (2*i+clk);
|
||||||
|
top->clk = !top->clk;
|
||||||
|
top->eval ();
|
||||||
|
}
|
||||||
|
// top->cen = (i > 5);
|
||||||
|
// top->wen = (i == 10);
|
||||||
|
if (Verilated::gotFinish()) exit(0);
|
||||||
|
}
|
||||||
|
tfp->close();
|
||||||
|
exit(0);
|
||||||
|
}
|
|
@ -275,6 +275,12 @@ class NoPredictionBranchPlugin extends Plugin[VexRiscv]{
|
||||||
BranchCtrlEnum.JALR -> (input(REG1).asUInt + imm.i_sext.asUInt),
|
BranchCtrlEnum.JALR -> (input(REG1).asUInt + imm.i_sext.asUInt),
|
||||||
default -> (input(PC) + imm.b_sext.asUInt) //B
|
default -> (input(PC) + imm.b_sext.asUInt) //B
|
||||||
)
|
)
|
||||||
|
|
||||||
|
when(jumpInterface.valid){
|
||||||
|
prefetch.arbitration.removeIt := True
|
||||||
|
fetch.arbitration.removeIt := True
|
||||||
|
decode.arbitration.removeIt := True
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -809,7 +815,7 @@ class OutputAluResult extends Plugin[VexRiscv]{
|
||||||
|
|
||||||
object TopLevel {
|
object TopLevel {
|
||||||
def main(args: Array[String]) {
|
def main(args: Array[String]) {
|
||||||
SpinalVhdl{
|
SpinalVerilog{
|
||||||
val config = VexRiscvConfig(
|
val config = VexRiscvConfig(
|
||||||
pcWidth = 32
|
pcWidth = 32
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue