Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[topgen] Avoid adding a comma after the last parameter in the list
The previous code added a comma after a parameter unless this was the last parameter of the module and this was the last module in the list. This works fine unless the last module in the list doesn't happen to have any parameters. In that situation, you got something like ... parameter int unsigned RvCoreIbexDmExceptionAddr = tl_main_pkg::ADDR_SPACE_RV_DM__MEM + dm::ExceptionAddress[31:0], parameter bit RvCoreIbexPipeLine = 0, // parameters for mbx0 // parameters for mbx1 // parameters for mbx2 ) ( ... which is a syntax error (the parser sees something like "a, b, )"). Tweak the logic slightly so that we add a comma unless this is the last parameter in the module and this is the last module *with parameters* in the list The diagnosis and main work was done by Robert Schilling. I just tweaked the code to make it a bit easier for me to follow. Signed-off-by: Rupert Swarbrick <[email protected]> Co-authored-by: Robert Schilling <[email protected]>
- Loading branch information