Conversation
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
kulp
force-pushed
the
verilator
branch
2 times, most recently
from
July 7, 2026 01:12
af3d1e5 to
c02c591
Compare
kulp
force-pushed
the
verilator
branch
3 times, most recently
from
August 15, 2026 19:36
08dc350 to
e88bd15
Compare
This belongs with commit f1517c0.
Add the `-DVERILATOR` option (disabled by default) and wire the Verilator simulator into the CMake build conditionally.
Introduce the Verilator-based simulator that runs tenyr code through the Verilog implementation. The simulator: - provides serial text output via simserial.v - supports -v verbosity levels matching tsim (0-4) - shares disassembly and register dump code with tsim via asm.c - loads .texe (obj) binary format The main simulation loop includes proper halt detection: - Checks for $finish instruction (0xffffffff) at the S0 state boundary using a two-phase finish_pending flag, letting the instruction execute through S3 so its data memory access is traced before halting - Checks the core halt signal (err_i | rty_i) at every cycle - Updates prev_state after halt checks so the S6->S0 transition is detected correctly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running on Verilator may or may not give tenyr an obvous immediate advantage, but given how quickly its generated C++ code can run, it seems a reasonable way to introduce a cycle-accurate simulator alternative to the (time-agnostic) functional simulator that is
tsim.With a long-running Fibonacci (argument 30), the Verilated
vsimas of 981425b is about 7x slower thantsim.