-
Notifications
You must be signed in to change notification settings - Fork 0
XDC physical constraints with TCL interpreter. #15
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
base: acom/fpga-interchange-rr-graph+constants
Are you sure you want to change the base?
XDC physical constraints with TCL interpreter. #15
Conversation
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 pretty good. I have added some initial comments below.
@@ -976,7 +976,7 @@ struct t_mode { | |||
* input_string: input string verbatim to parse later | |||
* output_string: input string output to parse later | |||
* annotations: Annotations for delay, power, etc | |||
* num_annotations: Total number of annotations | |||
* num_annotations: Total number opb_typef annotations |
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.
probably a typo
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 still needs fix
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.
Not my typo, will fix in another commit.
vpr/src/base/SetupVPR.cpp
Outdated
@@ -97,6 +99,7 @@ void SetupVPR(const t_options* Options, | |||
FileNameOpts->CmosTechFile = Options->CmosTechFile; | |||
FileNameOpts->out_file_prefix = Options->out_file_prefix; | |||
FileNameOpts->read_vpr_constraints_file = Options->read_vpr_constraints_file; | |||
FileNameOpts->read_xdc_constraints_file = Options->XDCFile; |
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'd avoid having an option that is strictly related to XDC, or any other constraint file type.
I think it may be better to use the already present read_vpr_constraints_file
, and maybe rename it to read_constraints_file
and, based on the extension of this file, choose the right way to parse it.
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.
Hmm, I'm not sure about it.
Currently we need BOTH SDC and XDC files, because a separate parser for SDC exists. Ideally both XDC and SDC should use the same backend for reading the files. I mean, we could maybe allow passing both of these files with a single flag, but there would be a hard limit of two files of different format, something I've never seen being done with a CLI interface. Alternatively we can allow reading more XDC files and thus make the flag accept any number of paths. Vivado (and F4PGA) allow reading multiple XDCs, so...
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 problem here is that we'd need to add one option for each kind of different constraint files that we provide. The constraint that we are considering here though is only a placement constraint kind of file. We do not care about the SDC at the moment, as it is parsed differently and does not concern constraining blocks to specific locations.
Just imagine that we'll add support for PCF and other kinds of constraint files. We'd need to invoke VPR with a different option everytime. Having instead a dynamic way of determining what is the type of constraint (for now based on the extension of the constraint file), allows us to avoid having multiple options that in the end are doing the same thing, e.g. telling VPR that there is a constraint file to parse.
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.
For now I'm leaving it at having separate argument. We don't infer architecture format from file extension, so why should we do that for constraints. Additionally, I made it possible to pass multiple XDC constraint files (the flag is now called --xdc_files
).
vpr/src/base/xdc_constraints.cpp
Outdated
/* TODO: this assumes there's only one port, which just happens to be true in case of fpga interchange. | ||
* If we want to handle it better, we should return a list of port ids instead. | ||
*/ |
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 it is ok assume that there is one and only one port. I'd rather add an assert that verifies that the block_ports
returned are actually of size == 1
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.
An assert would be good, but a explaining why it's here and why it's valid should remain imo. The TODO
might be a bit misleading tho, because this isn't going to need any work, unless we end up having more ports per block in the future.
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.
Yeah, sounds good, a brief explanation might be good. The fact is that the get_ports, for our use case at the moment, will only refer to a single PAD.
An improvement to this might be to accept some regex as pin name, which will lead to find more than one port and, for instance, assign the same IOSTANDARD. For now, though, we can keep as a single port only.
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 should be done by the user in TCL. We could replace AtomPortId
returned by get_ports
with a list of AtomPortIds
and make it accept a list of strings instead. This way the user could generate that list using a regexp
or whatever else in TCL.
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 we can proceed by preparing a PR to upstream. I think that these changes do not really require the RR graph PR (which is still pending to be reviewed upstream), therefore we may open a PR with these isolated changes, unless something from the RR graph generation is required.
We can have the discussion about the options to read in the XDC, on whether to have multiple options or one option, with the correct call to be made after analyzing the file extension.
Please, resolve all the conversations you think are solved and fix the remaining ones before opening the PR to upstream.
0ec095a
to
0d13e8a
Compare
e686856
to
f2ae4e5
Compare
07d15e2
to
1cec573
Compare
…ations and bind them to selected ports Signed-off-by: Krzysztof Boronski <[email protected]>
…from XDC command implementation Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
…perty: handle lists of ports. Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
Signed-off-by: Krzysztof Boronski <[email protected]>
1cec573
to
9bee76d
Compare
This PR adds handling of physical constraints expressed via an XDC file.
Supported commands:
get_ports
set_property
PACKAGE_PIN
(for single port)IOSTANDARD
(for any number of ports)Description
Adds an embedded TCL interpreter and a C++ abstraction layer over its C interface, which is used to implement XDC constraints reader. The reader creates
VprConstraints
that reflect the constraints described in XDC and modifiesAtomNetlist
to change block properties accordingly.To read an XDC file, use
--xdc_file <filename>
option.Related Issue
(will add later)
Motivation and Context
The current constrain system doesn't allow constraining IOs without knowing exactly what blocks are the going to be. It is also specific to VPR, while XDC seems to be a much more universal format.
How Has This Been Tested?
Manually constraining testarch IOs for LUT design from fpga-interchange-tests and checking results in GUI.
Types of changes
Checklist: