Skip to content
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

Import preprocessing error #128

Open
itsubaidrehman opened this issue Dec 14, 2024 · 12 comments
Open

Import preprocessing error #128

itsubaidrehman opened this issue Dec 14, 2024 · 12 comments

Comments

@itsubaidrehman
Copy link

I am trying to install RISCoF framework but getting preprocessing error.

File "/home/lpt-10xe/riscof/riscof/cli.py", line 18, in
import riscof.framework.main as framework
File "/home/lpt-10xe/riscof/riscof/framework/main.py", line 11, in
from riscv_isac.isac import preprocessing
ImportError: cannot import name 'preprocessing' from 'riscv_isac.isac' (/home/lpt-10xe/.local/lib/python3.10/site-packages/riscv_isac/isac.py)

@jordancarlin
Copy link
Contributor

This is caused by #122. For now the workaround is to install a newer version of riscv-isac manually. The instructions in that issue are no longer up to date because riscv-isac has been moved to the riscv-arch-test repo. The following command should work:

pip install git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac

@jordancarlin
Copy link
Contributor

@UmerShahidengr It seems like there won't be further packaged pip releases of riscv-isac now that it has been directly incorporated into riscv-arch-test. That leaves the default install of riscof unusable in its current state. Is there a reason not to incorporate riscof into the riscv-arch-test repo as well to avoid these issues?

@itsubaidrehman
Copy link
Author

@jordancarlin @UmerShahidengr
To avoid the preprocessing impor error, Installing RISCoF using pip3 worked for me.
pip3 install riscof

@jordancarlin
Copy link
Contributor

@itsubaidrehman Unfortunately that installs an older version from January 2023. At a minimum I believe that version is missing features needed for testing the privileged architecture.

@itsubaidrehman
Copy link
Author

@jordancarlin I tried to install using
pip install git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac
and now i am getting the same above mentioned pre-processing error. Beside that now pip3 install riscof is also unable to install riscof.

@jordancarlin
Copy link
Contributor

Maybe try uninstalling riscof and riscv-isac first? Maybe also try removing everything from the pip cache? python -m pip cache purge

The following two commands work to install riscv-isac and riscof in a functional state for me.

pip install git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac
pip install git+https://github.com/riscv/riscof

The other option I can think of trying is to replace the current riscv-isac line in the requirements.txt file with riscv-isac @ git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac instead.

@itsubaidrehman
Copy link
Author

@jordancarlin I have checkout to d38859f commit and then installed riscof and it worked. Now i did not get import preprocessing error.

@jordancarlin
Copy link
Contributor

That makes sense. It was commit dddbc52 that introduced the feature that is dependent on the newer version of riscv-isac. Some of those features will be needed for privileged tests, but if it works fine for now without it then I guess maybe that's good enough.

@itsubaidrehman
Copy link
Author

itsubaidrehman commented Dec 15, 2024

@jordancarlin but still, if some one has to use those features, what could be the possible solutions to avoid this error?

@jordancarlin
Copy link
Contributor

The only solutions I'm aware of are the two I listed above. Not sure why neither worked for you.

Ideally the longer term solution would be to merge riscof into riscv-arch-test so that they can't get out of sync and don't have weird dependencies.

@itsubaidrehman
Copy link
Author

@jordancarlin I have installed riscof with these two commands
pip install git+https://github.com/riscv-non-isa/riscv-arch-test/#subdirectory=riscv-isac
pip install git+https://github.com/riscv/riscof

but now coverage command is working fine for M extension but for I extension i am getting these errors

ERROR | Covergroup(s) for ('CHK_M_INTR_PRIORITY',) not found
make: *** [/home/lpt-10xe/WORK/riscof_work/Makefile.Reference-sail_c_simulator:9: TARGET1] Error 1

INFO | Merging Coverage reports
Traceback (most recent call last):
File "/home/lpt-10xe/.local/bin/riscof", line 8, in
sys.exit(cli())
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/riscof/cli.py", line 406, in coverage
report, for_html, test_stats, coverpoints = framework.run_coverage(base, isa_file, platform_file,
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/riscof/framework/main.py", line 129, in run_coverage
'test_size': [str(entry) for entry in find_elf_size(elf)],
File "/home/lpt-10xe/.local/lib/python3.10/site-packages/riscof/framework/main.py", line 61, in find_elf_size
with open(elf, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/lpt-10xe/WORK/riscof_work/src/addi-01.S/ref.elf'

@jordancarlin
Copy link
Contributor

I've spent a while working on installation related issues but am not very familiar with actually using riscof for coverage, so I'm not sure that I can be much help at this point.

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

No branches or pull requests

2 participants