zero-day-labs / riscv-iommu

IOMMU IP compliant with the RISC-V IOMMU Specification v1.0
Apache License 2.0
66 stars 12 forks source link

Undefined cause_code when both ptw_error and wrap_error are high simultaneously #20

Closed mhayat-10xe closed 2 days ago

mhayat-10xe commented 2 months ago

The specs say that if the process ID is unsupported, cause_code should be 260 but RTL is giving cause_code == 278 which is wrong (cause_code = 278 is not mentioned in the specs).

Here's a counter-example illustrating a property failure: During the 15th cycle, when a new request arrives, the process ID is unsupported. Consequently, wrap_error is triggered, and wrap_cause_code is set to 260, which is expected. However, simultaneously, ptw_error also goes high, with ptw_cause_code set to 274. This simultaneous occurrence of wrap_error and ptw_error leads to a final cause_code of 278 (an undefined code) from this unique case, which is incorrect.

image

mhayat-10xe commented 2 months ago

By changing this unique to priority the property is not failing. image

malejo97 commented 2 days ago

Fixed in PR #24. Thanks! @mhayat-10xe