8bitworkshop
8bitworkshop copied to clipboard
Auto Play + endless loops = bad
Auto Play has locked me out of a small project because of an endless loop in a Verilog file leaving the tab locked. I can force enter other platforms by modifying the url fine, but whenever i enter that platform again the project runs and the tab locks up, making it inaccessible.
It happened again :( Im not sure if its directly Auto Play, since im sure i pressed pause before editing yet another Verilog for loop. Ah well, now im locked out of both Verilog platforms... It was fun while it lasted lol.
You can hack the URL in the address bar to choose any other file, or a brand new file, and get back into Verilog.
BTW what's the Verilog code that caused the lock-up?
Thanks, that worked :) At least i can continue using it now, although the project i changed and any files part of it still causes it to lock up.
Both times i was in the process of changing a for loop.
First one, from going forwards to backwards, i changed the INIT, then TEST, then it locked up.
from for( integer i = 0; i < 32; i = i + 1)
to for( integer i = 32 - 1; i >= 0; i = i + 1)
Second one i was again messing with a for loop, but this time i renamed the loop variable and accidentally ended up with this:
for( integer i = 0; i < 32; i = i + 1) i = ~i;
Another endless loop.
edit: Both times was inside an initial block btw.
Annoying for sure.. but thats what you get with instant feedback lol
Maybe add some top-level tick counter that the frontend can check now and then to see if its running correctly. Thats what i did when this prompted me to roll my own crappy desktop version of a vga verilator display haha.
Verilator compiles directly to JS, so there's not a good way to detect when the code has stalled. Moving the simulation to a Worker would be one option -- big architecture change though. Another is to (somehow?) detect the JS hanging on a previous run and set a flag that disables auto-start. Or just always disable auto-start, but that's no fun :)
Probably be good to have an "autostart=0" flag just so you can delete/edit the existing file, in any case.