diff --git a/verilator/Makefile b/verilator/Makefile index cecb5278..8cca1832 100644 --- a/verilator/Makefile +++ b/verilator/Makefile @@ -7,9 +7,9 @@ RTL=../rtl/pulpino_top.sv TOP=pulpino_top SIM=$(TOP)_sim.elf -CFLAGS=-Iobj_dir -I/usr/share/verilator/include -g3 -VERICSRC=/usr/share/verilator/include/verilated_vcd_c.cpp \ - /usr/share/verilator/include/verilated.cpp +CFLAGS=-Iobj_dir -I/mingw64/share/verilator/include -g3 -std=c++11 +VERICSRC=/mingw64/share/verilator/include/verilated_vcd_c.cpp \ + /mingw64/share/verilator/include/verilated.cpp VFLAGS=-sv \ --trace \ --trace-max-array 8192 \ diff --git a/verilator/main.cpp b/verilator/main.cpp index df5b9e36..12994090 100644 --- a/verilator/main.cpp +++ b/verilator/main.cpp @@ -123,11 +123,6 @@ void run_tick_clk(Vpulpino_top *tb, VerilatedVcdC *tfp) #endif } -typedef struct { - uint32_t addr; - uint32_t data; -} HexData; - void preload_hex(Vpulpino_top *top, VerilatedVcdC *tfp, const char *filepath) { @@ -167,23 +162,23 @@ void raise_gpio(Vpulpino_top *top, VerilatedVcdC *tfp) top->gpio_in &= ~(1 << 16); } -static int raise_interrupt = 0; +/*static int raise_interrupt = 0; void sig_user_handler(int sig) { if (sig == SIGUSR1) { raise_interrupt = 1; } -} +}*/ void run_simulation(Vpulpino_top *top, VerilatedVcdC *tfp) { top->fetch_enable_i = 1; do { run_tick_clk(top, tfp); - if (raise_interrupt == 1) { + /*/if (raise_interrupt == 1) { raise_gpio(top, tfp); raise_interrupt = 0; - } + }*/ } while ((top->gpio_out & (1 << 8)) == 0); } @@ -191,7 +186,7 @@ void read_user_input() { while (1) { getchar(); - kill(0, SIGUSR1); + //kill(0, SIGUSR1); } } @@ -247,15 +242,15 @@ int main(int argc, char **argv) { #endif reset(top, tfp); - preload_hex(top, tfp, "sw/wake.hex"); + preload_hex(top, tfp, "sw/helloworld.hex"); - signal(SIGUSR1, sig_user_handler); - pid_t pid = fork(); - if (pid == 0) { + //signal(SIGUSR1, sig_user_handler); + //pid_t pid = fork(); + /*if (pid == 0) { read_user_input(); - } else { + } else {*/ run_simulation(top, tfp); - } + //} #ifdef VM_TRACE if (tfp) tfp->close();