This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
forked from lowRISC/ibex
-
Notifications
You must be signed in to change notification settings - Fork 1
Add TestRIG and Direct Instruction Injection support #1
Draft
ivanmgribeiro-google
wants to merge
23
commits into
AmbiML:ibex_dii
Choose a base branch
from
ivanmgribeiro-google:ibex_dii
base: ibex_dii
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add TestRIG and Direct Instruction Injection support #1
ivanmgribeiro-google
wants to merge
23
commits into
AmbiML:ibex_dii
from
ivanmgribeiro-google:ibex_dii
Commits on Sep 14, 2022
-
This commit adds some barebones files to try to add support for TestRIG as well as its required additions (Direct Instruction Injection). This includes a new simulation file, and also adds SocketPacketUtils from https://github.com/CTSRD-CHERI/SocketPacketUtils (SocketPacketUtils is not vendored in correctly at the moment, this will be changed in a later commit)
Configuration menu - View commit details
-
Copy full SHA for eddacb7 - Browse repository at this point
Copy the full SHA eddacb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 937a1ca - Browse repository at this point
Copy the full SHA 937a1caView commit details -
Configuration menu - View commit details
-
Copy full SHA for ded6e87 - Browse repository at this point
Copy the full SHA ded6e87View commit details -
Instantiate bus and RAM in TestRIG toplevel file
The bus does not currently set the error signal when a request is out of ranges, so this commit adds a very simple error detection in the toplevel. At the moment writes are not cancelled.
Configuration menu - View commit details
-
Copy full SHA for 622cbb8 - Browse repository at this point
Copy the full SHA 622cbb8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5dcd062 - Browse repository at this point
Copy the full SHA 5dcd062View commit details -
Configuration menu - View commit details
-
Copy full SHA for 16a2c27 - Browse repository at this point
Copy the full SHA 16a2c27View commit details -
Configuration menu - View commit details
-
Copy full SHA for be08da0 - Browse repository at this point
Copy the full SHA be08da0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f851c73 - Browse repository at this point
Copy the full SHA f851c73View commit details -
Configuration menu - View commit details
-
Copy full SHA for dcb7a5d - Browse repository at this point
Copy the full SHA dcb7a5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 283db68 - Browse repository at this point
Copy the full SHA 283db68View commit details -
Handle memory in C++, not systemverilog
The SRAM block provided by the shared libraries does not handle reset, so memory is instead implemented in C++ so that it can be reset.
Configuration menu - View commit details
-
Copy full SHA for 981deca - Browse repository at this point
Copy the full SHA 981decaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 417b390 - Browse repository at this point
Copy the full SHA 417b390View commit details -
The in_count and out_count variables might have strange values when we encounter exceptions and jumps, so remove these as a factor when extracting RVFI data.
Configuration menu - View commit details
-
Copy full SHA for c19a0b1 - Browse repository at this point
Copy the full SHA c19a0b1View commit details -
Previously, all our verilator "logic" happened while the clock cycle was low (apart from setting gnt_i signals which happened after it when high). Now, all our logic happens while the clock is high, then we evaluate the core so it can update, and then we set the clock low and evaluate. This commit also makes some tracing dependent on the verbosity - the next commit makes more printing and tracing dependent on verbosity.
Configuration menu - View commit details
-
Copy full SHA for 83fc62f - Browse repository at this point
Copy the full SHA 83fc62fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d7d3d9 - Browse repository at this point
Copy the full SHA 4d7d3d9View commit details -
Insert dummy instructions when needed
If there is no real instruction to insert (ie we have run out of instructions, or for some reason our received, in_count or out_count variables got messed up), then insert NOPs instead. This should prevent the core from locking up if we run out of instructions, and should help in debugging.
Configuration menu - View commit details
-
Copy full SHA for 449e1b0 - Browse repository at this point
Copy the full SHA 449e1b0View commit details -
Handle replaying instrs after jump/exc
When control flow changes occur in the core, the simulation environment needs to replay some instructions (since the instructions that have been inserted were flushed out of the pipeline). This commit adds that logic and also explains it.
Configuration menu - View commit details
-
Copy full SHA for 6cf4110 - Browse repository at this point
Copy the full SHA 6cf4110View commit details -
Add and handle perf_xret_o signal
This is used to track when a MRET or DRET instruction occurs, so that the simulation environment can correctly replay instructions.
Configuration menu - View commit details
-
Copy full SHA for 0d186d7 - Browse repository at this point
Copy the full SHA 0d186d7View commit details -
Set PC WData correctly on xRET/exc
When an xRET or exception is encountered, the controller goes into the FLUSH state. RVFI data is read while the controller is in the FLUSH state, but the PC is only available the next cycle, so for RVFI we need to set the PC WData again once it is available.
Configuration menu - View commit details
-
Copy full SHA for b9b058b - Browse repository at this point
Copy the full SHA b9b058bView commit details -
In typical uses, MTVEC can be set after the core fetches the first instruction and we can use the boot_addr_i signal to set it. However, when using TestRIG it is possible that the first instruction causes an exception, and in this case there is not enough time to set MTVEC before the exception is handled, so the exception vector will be whatever was in boot_addr_i on boot. This is incompatible with TestRIG, so MTVEC is set to 0 on boot rather than using boot_addr_i.
Configuration menu - View commit details
-
Copy full SHA for a073f3f - Browse repository at this point
Copy the full SHA a073f3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f7f39d - Browse repository at this point
Copy the full SHA 9f7f39dView commit details -
With the changes so far, Ibex reports the same results in RVFI as the Sail-RISCV model modulo the caveats mentioned in the README.
Configuration menu - View commit details
-
Copy full SHA for 13362c7 - Browse repository at this point
Copy the full SHA 13362c7View commit details -
Properly vendor in SocketPacketUtils
This was done using the vendor script from the OpenTitan repository. The SocketPacketUtils repository is pinned at the latest commit that successfully built; later commits seem to break compilation.
Configuration menu - View commit details
-
Copy full SHA for 98a85a9 - Browse repository at this point
Copy the full SHA 98a85a9View commit details
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.