742 Commits

Author SHA1 Message Date
Andrew Waterman
56546ec382 don't depend on matplotlib unless -svg is passed on command line (#376)
* Suppress wrong import position warnings

* don't depend on matplotlib unless -svg is passed on command line

cc @tomaird
2025-10-09 17:32:14 -07:00
Giovanni Santini
c35a8edc37 Correct parse.py example (#375) 2025-10-05 16:40:20 -07:00
Chih-Min Chao
a974baa723 ext: add field mask for svukte (#374)
1. new HSTATUS_HUKTE and SENVCFG_UKTE
  2. reorder fields by ascending order

reference:
  https://github.com/riscv/riscv-isa-manual/pull/1564/files
  https://lists.riscv.org/g/tech-privileged/message/2668

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2025-09-30 21:32:57 -07:00
Chih-Min Chao
44e1a9b7d0 Add new field for ctr extension (#371)
* smctr: add custom fieid mask

Based on 1.0.0 section 2.1 and 2.2

  1. add custom field for mctrctl
  2. add custom field for sctrctl

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>

* smctr: add field mask for data record

Based on 1.0.0 and section 3.1/3.2/3.3

 1. add fields for ctrsource
 2. add fields for ctrtarget
 3. add fields for ctrdata

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>

---------

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2025-09-30 14:39:23 -07:00
Chih-Min Chao
3e072687c9 style: reorder field masks to follow ascending order (#372)
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2025-09-30 14:39:02 -07:00
Chih-Min Chao
815fe50321 ext: add zvfofp4min definition (#373)
reference
    https://riscv.atlassian.net/wiki/spaces/FPXX/pages/552370182/2025-06-02+Ordinary+Meeting+Notes
    e1e20a75c9/isa/zvfofp4min.adoc

Co-authored-by: tsewei-lin <tse-wei.lin@sifive.com>
2025-09-30 14:38:35 -07:00
Chih-Min Chao
e8029bfad1 add rv_zibi draft spec (#370)
reference:
  https://github.com/riscv/zibi/releases/tag/v0.6

Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2025-09-24 13:58:35 -07:00
Andrew Waterman
74c115829a Fix generation of encoding.out.h (#368)
The SVG generation in #364 broke this in a surprising way (though #364
really is not to blame).  The addition of a file in the root directory
that began with `rv` caused the Make rule to glob that file, rather than
passing the string `rv*` through to `parse.py`.
2025-09-03 19:30:49 -07:00
Andrew Waterman
ddba97b829 Fix CI by decoupling extension count from hatch count (#367)
Not sure this is the best fix, but I need to do something to unbreak CI.

cc @christian-herber-nxp
2025-09-03 18:53:30 -07:00
Andrew Waterman
911937fbf1 Add Zvldot/Zvbdot extension families (#366) 2025-09-03 17:55:18 -07:00
Christian Herber
767b74181f Adding support to generate an svg from opcodes (#364)
* Adding support to generate an svg from opcodes

* Attempt to fix linting issues

* Adding matplotlib dependency to precommit hooks

* Update linting changes

* Added typed tuples

* Fixing further linting issue (WiP)

* Resolved all linting issue

Matplotlib types cannot be resolved by the linter.
Matplotlib calles are ignored for type checking

* Adding matplotlib to dependencies and svg to output for coverage
2025-08-08 13:42:05 -07:00
Christian Herber
1d4b38c868 Move Zilsd & Zclsd to ratified extensions directory (#360)
* Move Zilsd & Zclsd to ratified extensions directory

* Zilsd: Fixing difference in encoding to RV64 ld/sd

* Zilsd: Define instructions using pseudo ops
2025-08-04 00:22:57 -07:00
DPY
dc3dfad509 Update csrs.cs: Remove s[ie]deleg (#362)
These two S-mode delegation CSRs are moved to N-extension, which is no longer a standard CSR.

Reference: https://lists.gnu.org/archive/html/qemu-riscv/2022-09/msg00062.html

Signed-off-by: DPY <38260090+asd055189@users.noreply.github.com>
2025-07-28 04:45:04 -07:00
Pengcheng Wang
29f3684036 Generate RVV segment load/store instructions for Go (#361)
We can expand the `nf` field before generating `inst.go`.
2025-07-25 14:29:02 -07:00
Li Xiaogang
ac5c7ac4aa Update Zvkn and Zvks extension according to Crypto Extensions Volume II (#345)
1. remove Zvbc import in Zvkn and Zvks extension
    2. replace Zvbb with Zvkb in Zvkn and Zvks

Co-authored-by: lixiaogang <lixiaogang@masscore.cn>
2025-07-18 09:09:58 -07:00
Andrew Waterman
ddc8b3813f Fix lint errors 2025-07-17 13:45:40 -07:00
Christian Herber
f153a04d58 Adding Zilsd and Zcmlsd extension (#250)
* Adding Zilsd extension

* Renamed Zcmlsd to Zclsd following change from v0.9 to v0.10
2025-07-17 13:30:45 -07:00
Cillié Malan
c2cd58c7e4 Fix #357 Incorrect data for zext.b (#358) 2025-07-07 02:36:55 -07:00
Mr. Jake
b30cec9d8d Added tab as a possible delimeter (#356) 2025-06-22 18:37:56 -07:00
i2h2
9a09c4844f AIA: add IMSIC defines (#354) 2025-06-09 14:03:35 -07:00
Dennis Brakhane
d6b540068a replace deprecated \bf with \bfseries (#352) 2025-05-06 14:17:32 -07:00
Ved Shanbhogue
946eb67387 Fix file name: smdbltrp -> ssctr (#350) 2025-03-24 14:31:27 -07:00
Afonso Oliveira
d0c4b0b4ef Remove zimm from arg_lut given that it was substituted by zimm5. (#348)
Signed-off-by: Afonso Oliveira <Afonso.Oliveira@synopsys.com>
2025-03-19 13:20:20 -07:00
Afonso Oliveira
9bd0acd771 Change zimm variable to zimm5, since they were exactly the same. Fixes #342. (#347)
Signed-off-by: Afonso Oliveira <Afonso.Oliveira@synopsys.com>
2025-03-18 14:15:18 -07:00
Andrew Waterman
11d830713a Add Zvfofp8min draft 2025-03-03 18:57:36 -08:00
Andrew Waterman
8899b32f21 Add encodings for Zvqdotq instrutions (#337) 2025-02-14 17:32:53 -08:00
Jonathan
21dab92c83 Add menvcfg.cde smcdeleg (#336)
Signed-off-by: Jonathan <108932827+JJ-Gaisler@users.noreply.github.com>
2025-02-07 05:01:20 -08:00
Jonathan
9f70bcd37d add hedelegh and mstateen0_priv113 (#333) 2025-01-29 15:46:37 -08:00
Mark Ryan
3c73392134 Add CSR encodings for Go and remove call to Go fmt (#329)
* Don't run go fmt error in go_utils.py

go_utils.py currently runs go fmt to pretty print the generated
inst.go file. Unfortunately, this call to go fmt always fails as
inst.go contains an internal import and go fmt is being run out of
tree. Here we remove the code that attempts to format inst.go
resulting in a clean run of go_utils.py without any errors. The
generated file, inst.go, can be formatted when it's copied into the
Go source tree, prior to its submission to the Golang project.

* Add CSR support to go_utils.py

go_utils.py now generates a Go map that maps CSR numbers to CSR
names. The resulting map is written into inst.go for use by the
Go assembler.
2025-01-09 14:50:24 -08:00
Andrew Waterman
34e1d8194f Use argparse for argument parsing (#331)
This is more maintainable and scalable and gives better errors and a nice `--help` message. The interface is compatible with the previous version.

Co-authored-by: Tim Hutt <timothy.hutt@codasip.com>
2024-12-20 13:35:55 -08:00
Tim Hutt
f4aa35e834 Sort JSON output (#315)
If we're sorting the dictionary anyway we may as well output the JSON sorted.

Also since Python 3.6 we can just use `dict()` since the insertion order is preserved.
2024-12-20 13:25:24 -08:00
Ved Shanbhogue
9226b0d091 Updated extensions to ratified state (#324)
* Update ratified opcodes

* Update ratified opcodes
2024-11-21 15:59:32 -08:00
Andrew Waterman
4d8d26037e Merge pull request #316 from Myrausman/repo_structure
Restructured codebase
2024-11-11 19:27:01 -08:00
Jay Dev Jha
d9e90690e8 Speed up the CI workflows (#318) 2024-11-11 19:14:25 -08:00
Jay Dev Jha
383cbca542 Optimized pseudo logic to Makefile
Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
2024-11-09 13:14:39 +05:30
Jay Dev Jha
2af964acf2 Correct artifact generation section in (#313) 2024-11-08 15:31:31 -08:00
Myrausman
32b9af96de restructured codebase 2024-11-08 20:12:49 +05:00
Myrausman
444ab190b1 restructured codebase
Signed-off-by: Myrausman <maira.usman5703@gmail.com>
2024-11-07 17:57:26 +05:00
Tim Hutt
359a94356d Enable Pylint in CI and fix its errors (#311)
* Remove wildcard imports

Use explicit imports rather than wildcards. This is more maintainable.

* Enable Pylint in CI and fix its errors

The main fixes were:

* Specify encoding for all file opens. By default it depends on environment variables which is bad.
* Use `with` to open files. Otherwise they don't necessarily get closed.

There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
2024-11-05 06:32:12 -08:00
Rafael Sene
6bb00f9056 Update the versions of all GitHub Actions, as the old ones are using Node 12, which is deprecated. (#312) 2024-11-05 04:54:30 -08:00
Maira Usman
8a4483d0e5 [enhc] support for multiple Python versions (#299)
* Refactor GitHub Actions workflow to support multiple Python versions

Signed-off-by: Myrausman <maira.usman5703@gmail.com>

* CI improvements

* MInor update python-app.yml

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

---------

Signed-off-by: Myrausman <maira.usman5703@gmail.com>
Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
Co-authored-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
2024-11-05 03:41:53 -08:00
Aditya Mohan
8c459ce55d Add Unit Tests for shared_utils.py (#309)
* Added test cases for shared_utils

Signed-off-by: Aditya Mohan <coding.traxicon16@gmail.com>

* Added definition for logging an error shared_utils.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* Pre-commit fixes for shared_utils.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* pyright fixes for test.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* Minor changes to shared_utils.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

* Updated test.py

Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>

---------

Signed-off-by: Aditya Mohan <coding.traxicon16@gmail.com>
Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
Co-authored-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
2024-11-03 20:52:15 -08:00
Andrew Waterman
699eb166df Merge pull request #293 from Timmmm/user/timh/types
Add static type hints
2024-10-31 12:52:33 -07:00
Tim Hutt
284a5fa0f7 Add static type hints
This makes the code easier to understand and navigate, and also detected a few of bugs:

1. Missing brackets on e.upper. (Fixed)
2. Not strictly related to types, but a lot of the regexes were not raw strings and therefore contained invalid escape sequences. Python prints a warning about these in recent versions. (Fixed)
3. Expression in `process_pseudo_instructions()` that is always false. (Not fixed)
4. Missing definition of `log_and_exit()`. (Fixed)

This is validated via pre-commit in CI.
2024-10-31 11:42:41 +00:00
Tim Hutt
bd5e598abf Generate JSON instead of YAML
Previously this generate a `instr_dict.yaml` file, however there is no need to use YAML here. The only advantages of YAML over JSON are that it is (debatably) easier for humans to write, making it suitable as human-edited input files. This is a machine-generated output file so JSON is better.

The main advantages are:

1. It removes the dependency on PyYAML, which is the only external dependency of this project. Python external dependencies are quite a pain - PyYAML is a particularly troublesome one - and having no dependencies is very convenient (no need for venv etc.).
2. It means consumers of the file don't need to depend on PyYAML.

Note this could have been done in an 100% backwards compatible way by keeping the file name unchanged (since JSON is valid YAML), however I figured there probably aren't that many users of this file, and since the only thing they need to change is the filename it's probably better to minimise confusion by renaming it. It also makes it clear that it is guaranteed to be JSON.
2024-10-31 11:42:23 +00:00
Andrew Waterman
f73c2a41c8 Merge pull request #306 from Timmmm/unused_imports
Remove unused imports
2024-10-30 15:49:06 -07:00
Jay Dev Jha
14d6674bed Remove commented out import lines
Signed-off-by: Jay Dev Jha <jaydev.neuroscitech@gmail.com>
2024-10-30 14:00:28 +00:00
Tim Hutt
938e6d5b03 Remove unused imports
Remove unused Python import statements.
2024-10-29 21:11:51 +00:00
Andrew Waterman
aa5687996a Merge pull request #305 from Timmmm/bool_simplification
Minor simplification of Python boolean
2024-10-28 14:49:48 -07:00
Andrew Waterman
238c183f04 Merge pull request #307 from foss-for-synopsys-dwc-arc-processors/includePseudo
Added make option to include Pseudo
2024-10-28 14:42:32 -07:00