diff options
author | Alexander Richardson <alexrichardson@google.com> | 2023-01-25 16:30:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 10:30:04 -0600 |
commit | 9547a30bf84572c458476591b569a95f5232c1c7 (patch) | |
tree | 253ce82fb152669a583128fd733f0dd1784660e9 /model/riscv_insts_end.sail | |
parent | 6d0cc0fac7ad743651e295594c274e9b89ca23f7 (diff) | |
download | sail-riscv-9547a30bf84572c458476591b569a95f5232c1c7.zip sail-riscv-9547a30bf84572c458476591b569a95f5232c1c7.tar.gz sail-riscv-9547a30bf84572c458476591b569a95f5232c1c7.tar.bz2 |
Increase flexibility of the decode hook (and simplify it) (#205)
Previously the decoding hook (`ext_post_decode_hook`) allowed models to
override the decoded `ast`. However, this is not sufficient if model
extension changes interpretation of fields. Additionally, the assembly
printing would always print assembly for the "baseline decode" which
resulted in incorrect trace output in the sail-cheri-riscv model.
With the new hook models can implement ext_decode()/ext_decode_compressed()
to return an `ast` and for encodings that are not adjusted fall back to
the default `encdec`/`encdec_compressed`.
Diffstat (limited to 'model/riscv_insts_end.sail')
-rw-r--r-- | model/riscv_insts_end.sail | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/model/riscv_insts_end.sail b/model/riscv_insts_end.sail index 610508d..267d080 100644 --- a/model/riscv_insts_end.sail +++ b/model/riscv_insts_end.sail @@ -101,9 +101,3 @@ val print_insn : ast -> string function print_insn insn = assembly(insn) overload to_str = {print_insn} - -val decode : bits(32) -> ast effect {rreg} -function decode bv = encdec(bv) - -val decodeCompressed : bits(16) -> ast effect {rreg} -function decodeCompressed bv = encdec_compressed(bv) |