lowRISC / lowRISC/opentitan

[otbn,sim] BN.MULV instructions cannot be the very first instruction

Open Beginner friendly
#31,213 0 comments 0 reactions 0 assignees View on GitHub
IP:otbn
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

The simulator models the predecoding of the shuffling index only whilst executing. This is an issue if the very first instruction of a program happens to be one of the BN.MULV instructions. Then the `self.state.mac_rnd_offset_predec` value of `sim.py` hasn't been set properly. We need to set this in the last cycle of `sim._step_pre_exec()` where we leave the state.

Contributor guide

Open the contributing guide

Research direction

Start in sim.py at sim._step_pre_exec(), focusing on the last cycle where the state is left and on self.state.mac_rnd_offset_predec. Reproduce a program whose first instruction is a BN.MULV instruction, then verify that the simulator initializes the shuffling index before executing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.