-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simulator report error #2236
Comments
I'm just doing an extremely basic triaging job here. Is the point that if we send a bogus instruction to Ibex then the message that gets reported to the console gives the wrong instruction contents? (That definitely looks wrong, but I want to make sure I've understood the issue properly) |
That said, it might be worth looking at the waves for this run in a simulator. The apparently-incorrect message in the screenshot comes from this code:
(in Can you do a bit of debugging to figure out why this isn't the zero that you see elsewhere? |
Hi @rswarbrick,
Yes, such as
I am not sure whether every illegal instruction will be reported correctly, but
I am a new learner of ibex, I have a lot of things about ibex to learn. Could you mind give me some clue to debug this problem? |
I am not sure whether this is related to the ibex configure, so tested it again, but built simulator by:
This will use opentitan configure to run, not:
This time, co-sim reported error again:
|
Hi @rswarbrick, |
Hmm. Are you sure this is an RTL bug? I think that maybe we should actually be tweaking the Looking at always_ff @(negedge clk_i) begin
// Print warning in case of decoding errors. To help debugging, this reports the instruction
// value using rvfi_insn_id from further up in the hierarchy.
if ((ctrl_fsm_cs == DECODE) && instr_valid_i && !instr_fetch_err_i && illegal_insn_d) begin
$display("%t: Illegal instruction (hart %0x) at PC 0x%h: 0x%h", $time, u_ibex_core.hart_id_i,
pc_id_i, rvfi_insn_id);
end
end |
Hi @rswarbrick,
I tested the code you mentioned and made some changes to be able to compile it with Fusesoc.
This piece of code is placed on line 707~714 of the
Here is the output:
Display ibex_core.sv shows
I am not good at SystemVerilog, if I made mistakes at |
I strongly suspect that the RTL is working correctly here. If I agree that your change will avoid the problem, but I don't think we need to make that change to the hardware, because the existing behaviour of the hardware itself seems sensible. |
Observed Behavior
Test ibex in verilator with cosim, simulator report error illegal instruction.
MTVAL in
ibex_simple_system.log
file is 0x00000000Expected Behavior
The terminal should print right mtval value.
Steps to reproduce the issue
Run
build/lowrisc_ibex_ibex_simple_system_cosim_0/sim-verilator/Vibex_simple_system --meminit=ram,ibex/examples/sw/simple_system/input/test.elf
My Environment
Build verilator to run ibex by co-sim.
EDA tool and version:
None
Operating system:
Ubuntu Linux 18.04
Version of the Ibex source code:
8f4c75c
The text was updated successfully, but these errors were encountered: