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

RegisterSet ctor which takes register defn JSON #518

Open
colbynyce-mips opened this issue Sep 3, 2024 · 1 comment
Open

RegisterSet ctor which takes register defn JSON #518

colbynyce-mips opened this issue Sep 3, 2024 · 1 comment
Assignees
Labels
component: sparta Issue is related to sparta framework enhancement Enhancement or request

Comments

@colbynyce-mips
Copy link

We have a script which produces JSON files containing various register definitions in them. We would like to be able to give the JSON filenames to a RegisterSet and all the C++ registers will be created automatically.

@colbynyce-mips
Copy link
Author

colbynyce-mips commented Sep 4, 2024

The proposed JSON format looks something like this (array-of-dicts):

{
    "name": "f10",
    "num": 10,
    "desc": "floating point register 10",
    "size": 8,
    "aliases": [
        "fa0"
    ],
    "fields": {
        "sp": {
            "desc": "single precision",
            "low_bit": 0,
            "high_bit": 31,
            "readonly": false
        },
        "dp": {
            "desc": "double precision",
            "low_bit": 0,
            "high_bit": 63,
            "readonly": false
        }
    }
},

Notes:
- The 'fields' are optional and default to {}
- The 'initial_value' is optional and defaults to 0 (and these values are given in hex when not zero)
- The 'enabled' is optional and defaults to True

See the attached JSON files for rv64.
reg_csr.json
reg_fp.json
reg_int.json
reg_vec.json

@klingaard klingaard added enhancement Enhancement or request component: sparta Issue is related to sparta framework labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: sparta Issue is related to sparta framework enhancement Enhancement or request
Projects
None yet
Development

No branches or pull requests

2 participants