Fix and Update Constraints
- spydrnet_tmr.f4pga.update_constraints.fix_and_update_constraints(netlist, replicas, new_constraints_file, suffix='TMR')
Symbiflow_synth accepts a constraints file as an optional parameter. This constraints file is read and .param statements are entered into the netlist describing what net to constrain to what port. A problem arises when, in replicating a design, ports are replicated. Constraints on replicated ports causes symbiflow_synth to fail because those ports do not exist yet (the design is yet to be replicated). To fix this, after symbiflow_synth and the design is replicated in SpyDrNet, fix_and_update_constraints uses a simple file detailing what the new constrained ports are and what physical pin they should be tied to. The function cycles through the netlist, finds those ports, and adds/updates .param lines to reflect the proper constraint. Note that only the replicated ports need to be included in this file. Non replicated ports are untouched.
In short, this updates the replicated port parameters to reflect correct constraint values. Otherwise, all three domain ports will be constrained to the same pin and F4PGA will fail.
The following is a line from what an original constraints file will look like:
set_property -dict { PACKAGE_PIN V17 IOSTANDARD LVCMOS33 } [get_ports { sw[0] }];
And, based on the above, here is what should be given to fix_and_update_constraints in the new_constraints_file (assuming sw[0] port is replicated):
sw_TMR_0[0] V17 sw_TMR_1[0] V16 sw_TMR_2[0] W16
- Parameters
netlist – the current netlist
replicas – the replica dictionary generated by apply_nmr()
new_constraints_file – file that contains port:pin pairs
suffix – replication suffix. e.g “TMR”