1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #include "verilated_vcd_c.h" #include "VNon_restoring_Divider.h" vluint64_t main_time = 0; VNon_restoring_Divider *top = new VNon_restoring_Divider("top"); double sc_time_stamp() { return main_time; }
int main(int argc, char **argv) { Verilated::commandArgs(argc, argv); Verilated::traceEverOn(true); VerilatedVcdC* tfp = new VerilatedVcdC; top->trace(tfp, 0); tfp->open("wave2.vcd"); while (sc_time_stamp() < 5 && !Verilated::gotFinish()) { top->dividend_i = 15 + sc_time_stamp(); top->divisor_i = 3; top->eval(); printf("Quotient:%d Remainder:%d\n", top->quotient_o, top->remainder_o); tfp->dump(main_time); main_time++; } top->final(); tfp->close(); delete top; return 0; }
|