-
Notifications
You must be signed in to change notification settings - Fork 415
vpr: interchange: add interchange netlist reading support #1924
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
vpr: interchange: add interchange netlist reading support #1924
Conversation
e5099b8
to
93ad78a
Compare
93ad78a
to
2b7a37c
Compare
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.
@acomodi Some clean-up and additional comments may be required. See they make sense to you.
@@ -0,0 +1,33 @@ | |||
#include "catch2/catch_test_macros.hpp" |
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.
Is this test deployed to CI? If so, can you remind the workflow/job name?
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.
Yes, this is under the C++ Unit Test
workflow: https://github.com/verilog-to-routing/vtr-verilog-to-routing/runs/4354489589?check_suite_focus=true
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.
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.
There might be an option to increase verbosity which I may add, but the tests are run under vpr_tests
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.
No worries. Thanks for clarification. If we have the verbosity option, it will be helpful.
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.
So, I have checked a bit the options and unfortunately there is no straightforward way of having a bit more verbose output (e.g. with the single test cases names), we may enable full verbosity (which is way too much) or keep the following, which I think is the best option.
The current setting will output the full log in case of failure though.
std::string gnd_cell; | ||
std::string vcc_cell; | ||
|
||
std::string gnd_net = "$__gnd_net"; |
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.
When reading the vpr/src/base/read_interchange_netlist.cpp
, I notice that the net names are used to identify GND and VCC signals in interchangeable files.
So the question is should we put it in the architecture data structure
?
- If this is universal for all the FPGA architectures and netlists, it is reasonable.
- If not, should we consider put the constant strings
gnd_net
andvcc_net
in thevpr/src/base/read_interchange_netlist.cpp
?
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.
So, in general, the name of the GND and VCC nets do come from the interchange device description, but they might be absent from the schema, as they are optional. For instance, the Xilinx device have the constant nets specified as GLOBAL_LOGIC_0
and GLOBAL_LOGIC_1
.
Given that these net names are variable from arch to arch, they need to be parased from the device file, and this would need to happen in the libarchfpga
library.
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.
Make sense. Would you mind giving more insights about what client functions require these data?
Currently I see it is used by netlist readers. I am sure it will be used by netlist writers.
When adding the information to the architecture database, we expect they may be used by packer, placer, router as well.
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.
Indeed, for now I only expect the constant nets to be used in the front-end and back-end only, but it is not excluded that they might come in handy in core algorithms, especially in the packer.
The main reason it is added to the architecture database is because of accessibility of the information stored in the interchange device database and needs to be read in the netlist reader.
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 see. Maybe it is better to add additional comments to the source file, so that developers know what these variables are.
It is important to clarify
- if the
vcc_cell
andgnd_cell
physically exist in an FPGA fabric/architecture or that they are just virtual. I understand that in commerical FPGAs, there are dedicated circuitry to generate these constant signals. - if the
vcc_net
andgnd_net
are the required net names for input netlists (.blif, .eblif etc.) to representvcc
andgnd
signal. And just briefly explain why they should be in the architecture database and their relationship with thevcc_cell
andgnd_cell
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.
All right, I have added some extra comments around that, hopefully those help clarify a bit more on this.
1cd2fb0
to
ea906c9
Compare
Signed-off-by: Alessandro Comodi <[email protected]>
Signed-off-by: Alessandro Comodi <[email protected]>
ea906c9
to
b01a053
Compare
@tangxifan I believe this is ready to be merged, or do we want to wait for the fix in the strong sanitized tests? |
@acomodi I am fine to merge. The issue about the strong sanitized tests has been logged in #1934 |
I'm OK with waiving that. Not sure if there are any interchange format tests in the strong tests that get run through Sanitized Strong CI anyway. @acomodi: it would be good to add some basic interchange format tests to the strong run when the interchange code is stable enough (which might be now). We don't have to gate this PR on that though. |
Actually we might need to wait for the sanitizers tests to pass. I'll see if I can update the GCC version for kokoro directly in this PR. @vaughnbetz, regarding the strong interchange test we'll need to wait to land some other PRs before we can start having integration testing to run all the way through the router. The code is actually ready, it just needs cleaning and some review passes. |
aa03b7a
to
42a868c
Compare
This commit also reorders the list of installed packages for readability Signed-off-by: Alessandro Comodi <[email protected]>
42a868c
to
e568124
Compare
Signed-off-by: Alessandro Comodi <[email protected]>
@acomodi Thanks for the help on sanitized tests! CI is going green. I will approve once CI is finished. |
@tangxifan No problem, I managed to update compiler to GCC 9, as kokoro is running ubuntu 16.04, and for some reason I couldn't get the latest even though I added the ubuntu-latest repository to get the latest packages. Anyhow, all CI tests went green. |
Signed-off-by: Alessandro Comodi [email protected]
Description
This PR adds the FPGA Interchange netlist reading and parsing support.
Motivation and Context
With the ongoing development to add support for the netlist interchange, the additional reader for the interchange netlist format is an essential part, thanks to which we can import the circuit according to the format specification.
This is the next relevant addition to the current early support.
How Has This Been Tested?
There is a unit test that contains a simple circuit targetting the interchange test architecture, implemented using the catch2 framework.
Types of changes
Checklist: