-
Notifications
You must be signed in to change notification settings - Fork 415
Add raw setup slack analysis to placement quench #1501
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
Changes from 16 commits
f4ea4a1
c024603
cb6e9a6
63db2e1
aa7b233
e8f73c6
d80de58
831df44
d329911
225870e
9056301
0e01ed7
2e212dc
96e65ba
112bde5
29b55a3
f641b66
d88a38d
df9db48
9b01e1f
e0b70c4
cd79ff5
dd2cfe2
270d1ef
23e8782
f6e809e
e3d7d65
06c9cf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,9 +63,9 @@ class PlacerCriticalities { | |
pin_range pins_with_modified_criticality() const; | ||
|
||
public: //Modifiers | ||
//Incrementally updates criticalities based on the atom netlist criticalitites provied by | ||
//Updates criticalities based on the atom netlist criticalitites provided by | ||
//timing_info and the provided criticality_exponent. | ||
void update_criticalities(const SetupTimingInfo* timing_info, float criticality_exponent); | ||
void update_criticalities(const SetupTimingInfo* timing_info, float criticality_exponent, bool recompute); | ||
|
||
//Override the criticality of a particular connection | ||
void set_criticality(ClusterNetId net, int ipin, float val); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd change val to crit_val, and ipin to inet_pin_index (or add a comment on what ipin is -- I think it is an index on that net from 0 to fanout). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added assertion level 3 check with error message for ipin in |
||
|
@@ -81,6 +81,70 @@ class PlacerCriticalities { | |
|
||
//Set of pins with criticaltites modified by last call to update_criticalities() | ||
vtr::vec_id_set<ClusterPinId> cluster_pins_with_modified_criticality_; | ||
|
||
//Updates criticalities: incremental V.S. from scratch | ||
void incr_update_criticalities(const SetupTimingInfo* timing_info); | ||
void recompute_criticalities(); | ||
}; | ||
|
||
/* Usage | ||
* ===== | ||
* PlacerSetupSlacks returns the clustered netlist connection setup slack used by | ||
* the placer. This also serves to map atom netlist level slack (i.e. on AtomPinIds) | ||
* to the clustered netlist (i.e. ClusterPinIds) used during placement. | ||
* | ||
* Setup slacks are calculated by calling update_setup_slacks(), which will | ||
* update setup slacks based on the atom netlist connection setup slacks provided by | ||
* the passed in SetupTimingInfo. This is done incrementally, based on the modified | ||
* connections/AtomPinIds returned by SetupTimingInfo. | ||
* | ||
* The setup slacks of individual connections can then be queried by calling the | ||
* setup_slack() member function. | ||
* | ||
* It also supports iterating via pins_with_modified_setup_slack() through the | ||
* clustered netlist pins/connections which have had their setup slacks modified by | ||
* the last call to update_setup_slacks(). | ||
*/ | ||
class PlacerSetupSlacks { | ||
public: //Types | ||
typedef vtr::vec_id_set<ClusterPinId>::iterator pin_iterator; | ||
typedef vtr::vec_id_set<ClusterNetId>::iterator net_iterator; | ||
|
||
typedef vtr::Range<pin_iterator> pin_range; | ||
typedef vtr::Range<net_iterator> net_range; | ||
|
||
public: //Lifetime | ||
PlacerSetupSlacks(const ClusteredNetlist& clb_nlist, const ClusteredPinAtomPinsLookup& netlist_pin_lookup); | ||
PlacerSetupSlacks(const PlacerSetupSlacks& clb_nlist) = delete; | ||
PlacerSetupSlacks& operator=(const PlacerSetupSlacks& clb_nlist) = delete; | ||
|
||
public: //Accessors | ||
//Returns the setup slack of the specified connection | ||
float setup_slack(ClusterNetId net, int ipin) const { return timing_place_setup_slacks_[net][ipin]; } | ||
|
||
//Returns the range of clustered netlist pins (i.e. ClusterPinIds) which were modified | ||
//by the last call to update_setup_slacks() | ||
pin_range pins_with_modified_setup_slack() const; | ||
|
||
public: //Modifiers | ||
//Updates setup slacks based on the atom netlist setup slacks provided by timing_info | ||
void update_setup_slacks(const SetupTimingInfo* timing_info, bool recompute); | ||
|
||
//Override the setup slack of a particular connection | ||
void set_setup_slack(ClusterNetId net, int ipin, float val); | ||
|
||
private: //Data | ||
const ClusteredNetlist& clb_nlist_; | ||
const ClusteredPinAtomPinsLookup& pin_lookup_; | ||
|
||
ClbNetPinsMatrix<float> timing_place_setup_slacks_; /* [0..cluster_ctx.clb_nlist.nets().size()-1][1..num_pins-1] */ | ||
|
||
//Set of pins with criticaltites modified by last call to update_criticalities() | ||
vtr::vec_id_set<ClusterPinId> cluster_pins_with_modified_setup_slack_; | ||
|
||
//Updates setup slacks: incremental V.S. from scratch | ||
void incr_update_setup_slacks(const SetupTimingInfo* timing_info); | ||
void recompute_setup_slacks(); | ||
}; | ||
|
||
/* Usage | ||
|
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.
This code and the code to find the pins_with_modified_setup_slack is almost the same, except one uses the timing_info->pins_with_modified_setup_criticality() and the other uses timing_info->pins_with_modified_setup_slack().
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.
If we can just use the bigger of pins_with_modified_criticality_ or pins_with_modified_setup_slack, some data members and some duplicated code can be removed.
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 don't recommend doing this since they are pre-computed (in
slack_evaluation.cpp
) and are not necessarily the same. The efforts that go into merging these two sets are not worth it in my opinion, and it might make the code less readable. I agree with your feeling that a lot of codes are duplicated, but I don't have a good way of resolving the issue without sacrificing code readability.