-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add command to generate repack design constraints #1889
base: master
Are you sure you want to change the base?
Conversation
@fkosar-ql Great motivation. @Tulong4Dev Please take a look and see if the current spec fits our device. |
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.
@fkosar-ql I have read the code. As you said in the PR notes, we should think carefully about the methodology. Here is my proposal:
- We should probably integrate this command into
repack
. We can add a new option--file_format [pcf|xml]
where we can avoid conflicts from two design constraints. - In your code, you are trying to get the port information from pb_type and then use the pin index to determine the net-to-pin mapping. However, this is not a general purpose way. The net used in your PCF file (which is global port) is not a valid port in VPR's context. They are named by OpenFPGA because global ports have to be treated in a special way.
A general purpose method is to use the FabricGlobalPortInfo
data structure and the tile_annotation
data from openfpga_architecture.
namespace openfpga { | ||
|
||
static inline RepackDesignConstraints gen_repack_constraints(openfpga::PcfData* pcf_data){ | ||
auto& cluster_ctx = g_vpr_ctx.clustering(); |
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.
Avoid to use any more global variables. Pass them through arguments (const reference). We have seen enough troubles by using global variables. Any new codes should be clean at the beginning.
/* begin namespace openfpga */ | ||
namespace openfpga { | ||
|
||
static inline RepackDesignConstraints gen_repack_constraints(openfpga::PcfData* pcf_data){ |
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.
Use constant reference for PcfData (const openfpga::PcfData& pcf_data)
as it is read-only in this function.
@fkosar-ql A detailed example is here. Your pcf may look like
The In the example I give, the
When OpenFPGA models the FPGA fabric, all the global ports are managed by a dedicated data structure OpenFPGA/openfpga/src/fabric/fabric_global_port_info.h Lines 23 to 31 in 01e4905
Their names to appear in the top-level module and functionality are all recorded here, as the only legal source for such information. You can easily validate if your pcf is not doing anything wrong. So you see that combined with the two data structures |
@fkosar-ql Let me know if it makes sense to you. We can schedule a meeting if you are confused. |
This adds a command
gen_repack_constraints
which can take a.pcf
file and generate arepack_design_constraints.xml
file with the clock pin assignments in it. If a.pcf
is not provided it assigns clock nets to the first available pin.There are some points I need to resolve before this is ready for merge:
repack_design_constraints.xml
file and change it instead of generating one from scratch, since the file has more functions outside of clock pin assignment.repack
instead of writing a file and reading it back in.