The verilator testbench extended with possibility to dump the memory with all defined words to the hex file. #36
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.
When working with the real hardware, the user defined words are stored in the file which must be later on transmitted via UART (e.g. the swapforth.fs) . That means, that initialization of the J1B may be time consuming.
Unfortunately, it is not possible to add the files with additional words to the list of files compiled by the crossassembler, as their format is different (e.g, they do not contain header definitions).
To allow the user to create the memory image with all currently defined words in a "nuc.hex" compatible format, I have added a virtual IO device to the Verilator testbench.
Each read from the $2345 IO port dumps the current program/data memory to the mem_dump.hex file.
If this file is used instead the original nuc.hex in the synthesis, the J1B in FPGA will have the same word definitions as the simulated J1B had at the moment of memory dumping.
That proces may be used even if the target J1B is equipped with the hardware not simulated in the Verilator testbench (the new words are only defined, not executed, so the lack of the related hardware is not a problem).
Connected with the possibility to define the "cold" word (which is executed immediately after the FPGA is configured and/or J1B exits the reset state), the proposed feature allows to synthesize J1B with embedded procedures for target board initialization. After the "cold" word returns, normal interactive work is resumed.
I have also added two scripts: