@@ -1593,6 +1593,22 @@ void Router::resetGraph(const Tech &tech) {
15931593}
15941594
15951595void Router::assignRouteConstraints (const Tech &tech) {
1596+ vector<int > inTokens, outTokens;
1597+ for (int i = 0 ; i < (int )routeConstraints.size (); i++) {
1598+ if (routeConstraints[i].select >= 0 ) {
1599+ set<int > prop = propagateRouteConstraint (i);
1600+ for (auto j = prop.begin (); j != prop.end (); j++) {
1601+ int from = routeConstraints[*j].select ;
1602+ inTokens.push_back (routeConstraints[*j].wires [from]);
1603+ outTokens.push_back (routeConstraints[*j].wires [1 -from]);
1604+ }
1605+ }
1606+ }
1607+ if (inTokens.size () + outTokens.size () > 0 ) {
1608+ buildPOffsets (tech, inTokens);
1609+ buildNOffsets (tech, outTokens);
1610+ }
1611+
15961612 vector<int > unassigned;
15971613 unassigned.reserve (routeConstraints.size ());
15981614 for (int i = 0 ; i < (int )routeConstraints.size (); i++) {
@@ -1603,7 +1619,8 @@ void Router::assignRouteConstraints(const Tech &tech) {
16031619
16041620 while (unassigned.size () > 0 ) {
16051621 // handle critical constraints, that would create cycles if assigned the wrong direction.
1606- vector<int > inTokens, outTokens;
1622+ inTokens.clear ();
1623+ outTokens.clear ();
16071624 for (int u = (int )unassigned.size ()-1 ; u >= 0 ; u--) {
16081625 if (routeConstraints[unassigned[u]].select >= 0 ) {
16091626 unassigned.erase (unassigned.begin ()+u);
0 commit comments