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

Changing PMP granulairy in Sail #163

Closed
UmerShahidengr opened this issue Jun 7, 2022 · 10 comments
Closed

Changing PMP granulairy in Sail #163

UmerShahidengr opened this issue Jun 7, 2022 · 10 comments

Comments

@UmerShahidengr
Copy link

What is the standard method to change granulairy of PMP in Sail model?
I tried to change granulaity by writing 8 instead of 4 in this line But it does'nt do anything.

@bilalsakhawat
Copy link
Contributor

sail-riscv does not support granularity > 4. link
And the line you changed is for signature granularity.

@UmerShahidengr
Copy link
Author

When will that support be added in sail-riscv?

@UmerShahidengr
Copy link
Author

@bilalsakhawat can I get the memory map of sail-riscv. I am setting up PMP regions but addressing maps are giving exceptions.

@bilalsakhawat
Copy link
Contributor

The rv_ram_base is 0x80000000. If you try to set up a region below this address you will get exceptions. And rv_ram_size is 0x800000. So, the upper bound is rv_ram_base + rv_ram_size, link.

For better understanding look into issue #73 and pull request #151

@UmerShahidengr
Copy link
Author

Thanks @bilalsakhawat

@UmerShahidengr
Copy link
Author

Dear All,
I have written a basic test of defining a PMP region with no-write access and tried to write data in it. sail-riscv did not give expected output as it allowed the write access to reserved region (spike worked as expected and riscof environment returned fail status). Does PMP need major revision in sail model? Riscof based test (for RV32), sail-signature, and spike-signature is attached for reference.
PMP-protection-test.txt
DUT-Spike-signature.txt
Reference-sail_c_simulator-signature.txt

@bilalsakhawat
Copy link
Contributor

bilalsakhawat commented Jun 7, 2022

Do you enable pmp while running test on sail ? There is a Command Line Argument for enabling the pmp. link

@UmerShahidengr
Copy link
Author

@bilalsakhawat I am running the test on riscof. How can I add additional command line argument in riscof command?

@bilalsakhawat
Copy link
Contributor

@bilalsakhawat I am running the test on riscof. How can I add an additional command-line argument in riscof command?

RISCOF uses riscof-plugins to run a test on the sail-riscv. You can add command-line argument here.

@UmerShahidengr
Copy link
Author

Thanks @bilalsakhawat , I have updated the following line to:
execute += cmd + ' --enable-pmp --test-signature={0} {1} > {2}.log 2>&1;'.format(sig_file, elf, test_name)

Now the tests are passing and PMP of sail-riscv is working fine.

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