Skip to content

Dynamically assign property values outside of an addrmap scope? #97

Answered by amykyta3
greedysquid asked this question in Q&A
Discussion options

You must be logged in to vote

That wont work since my_addrmap is not an instance. However, you could use RDL parameters:

addrmap my_addrmap #(longint MY_RESET = 0) {
    reg my_reg {
        field {
            reset = MY_RESET;
        } my_field;
    };
};

You can override the parameter's value during elaboration: https://systemrdl-compiler.readthedocs.io/en/latest/api/compiler.html#systemrdl.RDLCompiler.elaborate
For example:

rdlc = RDLCompiler()
rdlc.compile_file('my_file.rdl')
root = rdlc.elaborate(parameters={'MY_RESET': 1})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@greedysquid
Comment options

Answer selected by greedysquid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants