Skip to content

how to create loop in RDL where the LIMIT is set regfile parameter #203

Closed Answered by amykyta3
assadk-g asked this question in Q&A
Discussion options

You must be logged in to vote

By definition, the Perl preprocessor is a text-transformation step that happens before RDL lexing and parsing, so parameters are not accessible to it in the way you are attempting. Parameters are elaborated at the last step after compilation during elaboration - well after the preprocessor.

Why not use an array instead?

regfile block_regfile#(
    longint unsigned LIMIT = 10
){
    reg {
        field {
            sw = rw; hw = rw; } value[31:0] = 32'h0;
        } csr_register[LIMIT];
    };
};

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by amykyta3
Comment options

You must be logged in to vote
0 replies
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