diff options
| author | uvok | 2026-01-11 11:55:39 +0100 |
|---|---|---|
| committer | uvok | 2026-01-11 11:59:20 +0100 |
| commit | f0af08d011935cce4191687fdecacdfef0cbe756 (patch) | |
| tree | 5ca945db14f9b921507daa8e2a79f0287a4d5946 /nandgame/cpp/Vcomputer__main.cpp | |
| parent | 68408d588444ae65e50e7e6e2c0af1bdbcd7a925 (diff) | |
computer: get rid of i
Diffstat (limited to 'nandgame/cpp/Vcomputer__main.cpp')
| -rw-r--r-- | nandgame/cpp/Vcomputer__main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nandgame/cpp/Vcomputer__main.cpp b/nandgame/cpp/Vcomputer__main.cpp index cc0f7c0..6908377 100644 --- a/nandgame/cpp/Vcomputer__main.cpp +++ b/nandgame/cpp/Vcomputer__main.cpp @@ -31,7 +31,7 @@ int main(int argc, char **argv, char **) { fprintf(stderr, "Usage: %.20s [filename]\n\n", argv[0]); exit(-1); } - int i = 0; + puts("Start simulation."); // topp->computer->clk_in = 0; topp->clk_in = 0; @@ -53,9 +53,8 @@ int main(int argc, char **argv, char **) { simpc_ui_init(); - while (VL_LIKELY(!contextp->gotFinish()) && i < 500) { - // doesn't work. - // topp->computer->clk_in = ~topp->computer->clk_in; + while (VL_LIKELY(!contextp->gotFinish()) && contextp->time() < 500) { + auto i = contextp->time(); if (i != 0 && (i % TICKS_PER_INS) == 0) { topp->clk_in = !topp->clk_in; |
