-
Notifications
You must be signed in to change notification settings - Fork 414
EBLIF cell parameter interpretation #1663
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
* **binary word** | ||
Binary words are specified using strings of characters ``0`` and ``1``. No other characters are allowed. Number of characters denotes the word length. | ||
|
||
* **real number** |
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.
What is .param x 2
? A real number or error?
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.
Its an error. For an integer 2 you need 10
, for a real 2 you need 2.0
.
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 think this needs to make clear that 2
is illegal, because it is not a binary word (has a 2) and is not a string (no quotes) and not a real number (no .
).
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.
Added clearer explanation of illegal formats
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.
Looks good. A few wording / variable name tweaks suggested, and one bug to fix (digit 9 would not be considered part of a real right now).
doc/src/vpr/file_formats.rst
Outdated
.param multiplier 0.50 | ||
.param power 001101 | ||
|
||
Would set the parameters ``feedback``, ``multipleir`` and ``power`` of the above ``pll`` ``.subckt`` to ``"internal"``, ``0.50`` and ``001101`` respectively. |
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.
typo: multipleir -> multiplier
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.
Fixed.
doc/src/vpr/file_formats.rst
Outdated
|
||
``.param`` statements propagate to ``<parameter>`` elements in the packed netlist. | ||
|
||
Paramerer values propagate also to post-route Verilog netlist. Strings and real numbers are passed directly while binary words are prepended with the ``<N>'b`` prefix where ``N`` denotes a binary word length. |
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.
slight wording change:
"to the post-route Verilog netlist, if it is generated."
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.
Corrected.
vpr/src/base/read_blif.cpp
Outdated
} | ||
|
||
bool is_real_param(const std::string& param) { | ||
const std::string chars = "012345678."; |
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.
Missing 9 --> need to add it to "chars".
Suggest using a more descriptive name than chars. real_chars would be better.
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.
Right... stupid mistake. Fixed.
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 gave it more thought and made the function use a regular expression.
547c32b
to
3480a0a
Compare
e01ba31
to
e2432ab
Compare
.param test_latch_param "test_latch_param_value" | ||
.param test_latch_param "test_latch_param_str_value" | ||
.param test_latch_param_bin 00110101 | ||
.param test_latch_param_num 2.0 |
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.
You need negative tests here!
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.
Also I recommend reviewing the failure output to make sure it is possible to understand the problem from the error message. Concrete things I'd look for:
- Is the location of the error made clear (e.g. file and line number)
- Is there an explanation of why the input was wrong?
- For example, missing quotes
- A bare integer with no period
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 believe that VPR at this point doesn't support test cases that are meant to fail (however https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/master/vtr_flow/scripts/python_libs/vtr/util.py#L73-L75 allows that but this parameter is not used anywhere in the test framework).
Anyway, I tested the error output and modified it to provide more useful information.
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.
Comments in
doc/src/vpr/file_formats.rst
Outdated
Parameters can have one of the three available types. Type is inferred from the format in which a parameter is provided. | ||
|
||
* **string** | ||
Whenever a parameter value is quoted it is considered to be a string. |
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.
Need to clarify that escaping rules (if any). For example what is .param "\""
? Is that an error? What is it's behavior?
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.
It seems like the external parser is not allowing escaped quote chars. In such case, VPR will throw syntax error there before the flow even gets to the logic responsible for distinguishing between 3 available formats of .param
.
I modified documentation to highlight this.
@mkurc-ant : just prodding on this one. It would be good to address the review comments and get this one in soon. |
@vaughnbetz Right. I'll have some time to look into it in the second part of this week. |
84d502e
to
faebf9d
Compare
Hi, I updated this PR and responded to review comments because those changes will be useful for incoming PR that will deal with #1946. @vaughnbetz can I ask you to take a look at my updates? |
@vaughnbetz Could you please take look at this PR? |
Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Maciej Kurc <[email protected]>
…ession. Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
…in string params Signed-off-by: Pawel Czarnecki <[email protected]>
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.
LGTM, thanks.
A proposed solution to #1662
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: