ibex icon indicating copy to clipboard operation
ibex copied to clipboard

Add support for RISCOF based checks

Open towoe opened this issue 4 years ago • 12 comments

This PR addresses #1233 and provides some basic functionality to run riscv-compliance checks based on RISCOF. RISCOF is still in development and the switch to it in riscv-compliance is only partially completed.

Add a Python model of Ibex to integrate with RISCOF. Add a pseudo model to compare the output of Ibex to reference signatures. Run the check in CI, it is intended not to fail even though some tests will not pass. The same specification is used for different configurations of Ibex, this needs to be extended in the future. (Provide more ibex_*_isa.yaml files.)

towoe avatar Jan 25 '21 12:01 towoe

Anyone know what would be the correct solution to ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.? Uninstall it, use pip --ignore-installed?

towoe avatar Jan 25 '21 13:01 towoe

For the pyYAML problem, I think you probably just want to use the distro version. See PR #1226.

rswarbrick avatar Jan 25 '21 13:01 rswarbrick

Sorry, I should have explained it in more detail. pyYAML is pulled in as a dependency from riscof which I specified. How do I say that the distro version should be used in this case?

towoe avatar Jan 25 '21 13:01 towoe

Oh, I see. I guess --ignore-installed makes sense (but possibly with a comment explaining what's going on?)

rswarbrick avatar Jan 25 '21 13:01 rswarbrick

-I, --ignore-installed
              Ignore  the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with
              a different package manager!

reading the documentation more carefully, maybe the safer bet would be remove the local installation again? But I don't really understand why pyYAML is even needed/updated if it is already available?

towoe avatar Jan 25 '21 13:01 towoe

Okay, I just saw in the log that pyYAML 3.12 is available, that's from 2016. I did not directly find which package requires what, but I would guess somewhere a newer version is required. Soo, remove system installation? Maybe @imphil has an opinion here?

towoe avatar Jan 25 '21 13:01 towoe

Yes, we explicitly installed the distribution's version of pyyaml as the PyPi-distributed version didn't include the libyaml (C) library bindings, but only the pure-Python version, which is significantly slower. Ubuntu 18.04 gives us pyyaml 3.x.

The requirement for a newer pyyaml version comes from riscv-config (https://github.com/riscv/riscv-config/blob/master/setup.py#L38). It's hard to tell where the exact version requirement came from looking at the relevant commit (https://github.com/riscv/riscv-config/commit/4617b312ecd5182ce20e085f27a25cd252ed50f8).

But at the same time I just saw that pyyaml is now installing wheels for Linux which include the libyaml bindings, so we actually don't need to use the distribution package any more.

You can therefore remove the python3-yaml distribution package from the list of packages, and pip should pick up a compatible version from PyPi.

imphil avatar Jan 25 '21 15:01 imphil

Thanks a lot Philipp for your investigation!

towoe avatar Jan 25 '21 16:01 towoe

Should pip install update the packages again? pip install -U or was there another reason why it was removed?

towoe avatar Jan 25 '21 16:01 towoe

The update flag shouldn't be needed, we're happy with any version satisfying the requirements.

imphil avatar Jan 25 '21 16:01 imphil

Hey @towoe , @imphil , @rswarbrick , more than 7 months have passed since the last activity in this PR. Do you know what the status of this PR is? Are there open points to be addressed, things that need to be discussed?

vogelpi avatar Sep 01 '21 08:09 vogelpi

Hi @vogelpi, as far as I can remember the new version of the compliance framework was not ready when I created the PR. This PR shows how the new compliance checks could be realized and should make it easy to rebase or "re-implement" it. I wasn't sure if this PR is wanted, but if there is a need I could at some point revisit this topic.

towoe avatar Sep 02 '21 12:09 towoe