-
Notifications
You must be signed in to change notification settings - Fork 19
Verilog: add attributes into parse tree #644
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
Conversation
6396c6c
to
bc61679
Compare
// | attribute_instance_brace udp_instantiation | ||
// { add_attributes($2, $1); $$=$2; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this always commented out (and still is)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax is indistinguishable from the instantiation of normal modules unless a separate token type is used for the identifiers of UDP modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can document this in source via a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// attribute_instance_brace class_property | ||
// { add_attributes($2, $1); $$=$2; } | ||
// | attribute_instance_brace class_method | ||
// { add_attributes($2, $1); $$=$2; } | ||
// | attribute_instance_brace class_constraint | ||
// { add_attributes($2, $1); $$=$2; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was/is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes are simply not done yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/* | ||
module_or_generate_item | ||
| attribute_instance_brace parameter_declaration { $$=$2; } | ||
// | attribute_instance_brace local_parameter_declaration { $$=$2; } | ||
| attribute_instance_brace parameter_declaration | ||
// { add_attributes($2, $1); $$=$2; } | ||
// | attribute_instance_brace local_parameter_declaration | ||
// { add_attributes($2, $1); $$=$2; } | ||
; | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was/is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not in the 1800-2017 grammar -- will clean out.
PRECONDITION(stack_expr(attributes).id() == ID_verilog_attributes); | ||
if(!stack_expr(attributes).get_sub().empty()) | ||
addswap(dest, ID_verilog_attributes, attributes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it perhaps be better to use ID_C_verilog_attributes
? They seem to be ignored during type checking at this point, so I am guessing they don't affect the semantics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe anything with attributes ever gets compared for equality, so it wouldn't make any difference.
The attributes seem to be entirely tool-specific, so there may well be some that have/alter semantics.
I am planning to use them to configure reasoning engines per assertion, but it's not obvious that this is the best mechanism.
Verilog allows attributes (key-value pairs) in various parts of the grammar. These are now added to the generated parse tree.
bc61679
to
9f744af
Compare
Verilog: add attributes into parse tree
Verilog allows attributes (key-value pairs) in various parts of the grammar. These are now added to the generated parse tree.