Skip to content

Creating a Yosys Pass to Append "/* verilator public */" Attributes to Signals #4353

Closed Answered by nakengelhardt
mmxsrup asked this question in Q&A
Discussion options

You must be logged in to vote

Custom attributes can be added with the setattr command, but "verilator public" is not a valid attribute, as attributes are always of the form (* identifier = "value" *) (value is optional on input and defaults to 1 but is always emitted in write_verilog output). /* */ indicates a comment, and the only way to introduce comments in write_verilog is with the -attr2comment that transforms an attribute into a comment (basically just replaces (* *) with /* */). That doesn't work with the format. So the closest solution I could come up with is to use setattr to set the attribute and then run sed on the output to replace (* verilator = "public" *) with /* verilator public */, but looking at the …

Replies: 2 comments 1 reply

Comment options

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

Answer selected by mmxsrup
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
3 participants