Skip to content

Raise illegal instruction exception for HFENCE.VVMA/HFENCE.GVMA when in V=1 mode and rd!=0 - #3554

Open
antonangeloff wants to merge 2 commits into
openhwfoundation:masterfrom
antonangeloff:issue-3462-hfence
Open

antonangeloff wants to merge 2 commits into
openhwfoundation:masterfrom
antonangeloff:issue-3462-hfence

Conversation

@antonangeloff

Copy link
Copy Markdown
Contributor
  • I have searched for similar pull requests
  • I am a human engaging in an interpersonal interaction. During this interaction, my words are my own and are not generated. If relevant, I provide links to my sources.

Summary

As indicated by #3462 - the HFENCE.VVMA/HFENCE.GVMA instructions having non-zero rd bits currently trigger virtual instruction exception (mcause 22) instead of illegal instruction (mcause 2) in V=1 mode.

The changes in this PR make HFENCE.* raise mcause=2 exception in the above case, which is consistent with Spike. The assumption being that non-zero rd bits would cause the instruction to be ill-formed (not HS-qualified).

Well formed HFENCE.* instructions are unaffected and still raise a virtual instruction exception under V=1.

The test can be run via:

export DV_SIMULATORS=veri-testharness,spike
cd verif/sim
source setup-env.sh
python3 cva6.py --testlist=../tests/testlist_issues.yaml --test hfence-rd-non-zero-rv64 --iss_yaml cva6.yaml --target cv64a6_imafdch_sv39 --iss=$DV_SIMULATORS

Related issues

Fixes #3462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] HFENCE.VVMA/HFENCE.GVMA with rd!=0 raise a virtual-instruction exception instead of illegal-instruction when V=1

1 participant