aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_platform.sail
AgeCommit message (Collapse)AuthorFilesLines
2024-03-24Replace atom with intTim Hutt1-10/+10
This is the newer, less confusing (and documented!) syntax. Fixes #425.
2024-02-08Shorten copyright notice at the top of each fileTim Hutt1-65/+3
This script was used to do the modification: ``` from pathlib import Path import re RE_LINE = r"/\*={50,150}\*/\n" RE_MIDDLE = r"/\*.*\*/\n" NEW_TEXT = """/*=======================================================================================*/ /* This Sail RISC-V architecture model, comprising all files and */ /* directories except where otherwise noted is subject the BSD */ /* two-clause license in the LICENSE file. */ /* */ /* SPDX-License-Identifier: BSD-2-Clause */ /*=======================================================================================*/ """ REPLACEMENT = re.compile(rf"^{RE_LINE}(?:{RE_MIDDLE}){{10,100}}{RE_LINE}") def main(): for file in Path("model").glob("**/*.sail"): text = file.read_text(encoding="utf-8") text = REPLACEMENT.sub(NEW_TEXT, text, 1) file.write_text(text, encoding="utf-8") if __name__ == "__main__": main() ```
2024-02-05Improve PMP supportTim Hutt1-6/+0
This implements a lot of missing functionality for PMPs. * Support 64 PMPs as well as 0 and 16. * Support setting PMP grain * Return correct address bits on read (some read as 0 or 1 depending on the grain and match type) * Unlock PMPs on reset * Implement pmpcfg WARL legalisation Co-authored-by: Ben Fletcher <benjamin.fletcher@codasip.com>
2024-01-31Update bitfield syntaxAlasdair1-13/+13
Use newer bitfield syntax, which has been part of Sail for a while now. Should in theory be more efficient as it removes a level of indirection for bitfield accesses. It's also much more friendly to `sail -fmt`, which has no idea how to handle the old bitfield syntax.
2023-09-12Remove effectsTim Hutt1-6/+6
Since Sail 0.15 (released Nov 2022), effects have had no effect. They now generate a deprecation warning. This commit removes all the effect annotations from the model, thus fixing the compiler warnings.
2023-08-01Rename EXTZ and EXTSAlasdair1-11/+11
Rename EXTZ to zero_extend and EXTS to sign_extend. Two main reasons for doing this - it means that the source more closely follows the descriptions in the documentation with more readable names, and EXTS and EXTZ are visually very close to each other with just the S and Z. They are also following an odd convention where they are ALLCAPS rather than snake_case like other functions in the spec. I think this convention comes from early Power specs in Sail, which influenced Sail MIPS and CHERI-MIPS, but I don't think it's a very good convention we should be keeping in sail-riscv
2023-05-29apply_headers: regenerate copyright headersupdate-copyright-headersPhilipp Tomsich1-1/+3
2023-02-14Revert "added 3 new command line switches (plus functionality): ↵Jessica Clarke1-17/+0
-X/--enable-experimental-extensions, --enable-smepmp, --enable-zicond (#219)" (#220) Reverts #219. Merged without code review and with many issues. This reverts commit 43b81eafc660ab584e1684668995957764a5e684.
2023-02-13added 3 new command line switches (plus functionality): ↵Bill McSpadden1-0/+17
-X/--enable-experimental-extensions, --enable-smepmp, --enable-zicond (#219) * added 3 command-line switches: -X/--enable-experimental-extensions, --enable-Smepmp, --enable-Zicond * example commit * fixed some type warnings/errors (between int/bool)
2021-07-29Use headache to apply copyright header at request of Peter Sewell.Robert Norton1-0/+68
2020-10-15Handle non-atomic but aligned writes to the 64-bit HTIF i/o port on RV32.Prashanth Mundkur1-28/+65
Unaligned writes or writes narrower than 32-bits are not supported. Fixes #69.
2020-04-27Add the mcountinhibit register.Prashanth Mundkur1-1/+3
2019-12-23Generate correct cause for AMO faultsJames Clarke1-10/+22
2019-09-18Squashed commit of various patches from @scottj97:Prashanth Mundkur1-19/+19
Rename var to make it clear it is physical and not virtual. There are a lot of variables in riscv_mem.sail and riscv_platform.sail named addr and it's not always clear if that is physical or virtual address. These changes rename those variables to paddr to reduce ambiguity.
2019-09-04Merge remote-tracking branch 'origin/master' into vmem_ext.vmem_extRobert Norton1-4/+4
2019-08-19RISC-V spec, without implicit castsAlasdair Armstrong1-4/+4
2019-07-22Make a custom exception code available for extensions, and remove the ↵Prashanth Mundkur1-6/+6
E_CHERI code. Enable extensions for PTE checks and PTW errors, and propagate those into exception codes.
2019-07-17Disable mmio devices (clint and htif interfaces) when using RVFI to prevent ↵Robert Norton1-1/+8
divergence when using TestRIG.
2019-07-09Add some missed logging guards.Prashanth Mundkur1-22/+41
2019-07-03Add a maximum memory access size to slightly improve C code geneation.Robert Norton1-8/+8
2019-07-01Predicate another bit of tracing.Robert Norton1-1/+2
2019-06-24Add PMP checks to physical memory accesses.Prashanth Mundkur1-0/+6
- unify AccessType and ReadType since they were essentially redundant, making it easier to implement PMP checks for ReadWrite/atomic accesses. - add command line options to enable PMP in the platform - also fix the matching for the case when all entries are off
2019-05-03Fix inconsistency in accessing PC/nextPC, which also clarifies which ↵Prashanth Mundkur1-1/+1
handlers return nextPC values as opposed to setting them.
2019-04-24Add extended model from cheri-merge.Prashanth Mundkur1-25/+30
2019-04-17Fix a 64-bitism.Prashanth Mundkur1-1/+1
2019-03-14Merge branch 'master' into rmem_interpreterJon French1-31/+85
2019-03-12riscv_platform.sail: use externs for platform values even in interpreterJon French1-18/+10
2019-03-04Add defaults for platform values for use when interpretingJon French1-1/+25
2019-02-26Initial cleanup of the prelude, using standard prelude instead when possible.Prashanth Mundkur1-14/+14
2019-02-21Fix the ocaml platform to respect the architectural width.Prashanth Mundkur1-8/+17
2019-02-11Handle 32-bit accesses to the mmio regions and device registers of the clint ↵Prashanth Mundkur1-23/+68
and htif.
2019-02-11Fix xlen variable name.Prashanth Mundkur1-5/+5
2019-02-11Fix 64-bit constants.Prashanth Mundkur1-3/+3
2019-02-08Start parameterizing definitions by xlen, which is currently still 64.Prashanth Mundkur1-6/+6
2019-01-25Tweaks to reservation handling.Prashanth Mundkur1-1/+1
2019-01-21Remove temporary workaround for Lem generationThomas Bauereiss1-5/+5
Reverts 7df2149
2019-01-14Reorganize directory structure.Prashanth Mundkur1-0/+295