summaryrefslogtreecommitdiff
path: root/nandgame/cpp/Vcomputer__main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nandgame/cpp/Vcomputer__main.cpp')
-rw-r--r--nandgame/cpp/Vcomputer__main.cpp7
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;