Skip to content

stt: create SteinerTreeBuilder class#862

Merged
eder-matheus merged 56 commits into
The-OpenROAD-Project:masterfrom
eder-matheus:stt_builder
Jul 19, 2021
Merged

stt: create SteinerTreeBuilder class#862
eder-matheus merged 56 commits into
The-OpenROAD-Project:masterfrom
eder-matheus:stt_builder

Conversation

@eder-matheus
Copy link
Copy Markdown
Member

  • Add a central Steiner tree API that controls the use of pdr and flute

Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
@eder-matheus eder-matheus requested a review from maliberty July 15, 2021 19:02
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Comment thread src/stt/include/stt/SteinerTreeBuilder.h Outdated
Comment thread src/stt/src/SteinerTreeBuilder.cpp Outdated
Comment thread src/stt/src/SteinerTreeBuilder.cpp Outdated
Comment thread src/stt/src/SteinerTreeBuilder.i Outdated
Comment thread src/stt/src/SteinerTreeBuilder.tcl Outdated
Comment thread src/stt/src/flt/flute.cpp Outdated
tp->branch[index[ii]].n = index[tt.branch[ii].n];
}
free(tt.branch);
tt.branch.clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

despite what the extremely confused pdrev authors think, clear has nothing to do with free. Since the branch vector is owned by the stack allocated variable tt there is no point in clearing it.

Copy link
Copy Markdown
Contributor

@jjcherry56 jjcherry56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I guess Matt got his way. I would not have bothered with all of this restructuring for 2 callers of a small api. I think there is really no point in switching between flute and pdref, since pdrev with alpha=0 is equivalent (albeit poorer/slower code). The resizer will probably bypass this api at some point and use the pdrev graph instead of the horrible flute data structures.

Comment thread src/TritonRoute/src/gr/FlexGR_topo.cpp Outdated
Comment thread src/stt/src/flt/flute.cpp Outdated
minl = ll;
free(bestt1.branch);
free(bestt2.branch);
bestt1.branch.clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointless clears

Comment thread src/stt/src/flt/flute.cpp Outdated
} else {
free(t1.branch);
free(t2.branch);
t1.branch.clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment thread src/stt/src/flt/flute.cpp Outdated

free(bestt1.branch);
free(bestt2.branch);
bestt1.branch.clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again

Comment thread src/stt/src/SteinerTreeBuilder.cpp Outdated
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
@eder-matheus eder-matheus requested a review from jjcherry56 July 18, 2021 18:20
Comment thread src/rsz/src/MakeResizer.cc Outdated
openroad->getDb(),
openroad->getSta(),
openroad->getGlobalRouter());
openroad->getGlobalRouter(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the global router is no longer needed since you moved the only functions it accessed

Comment thread src/stt/CMakeLists.txt Outdated
Comment thread src/stt/src/flt/flute.cpp
@@ -1487,7 +1494,6 @@ Tree flutes_MD(int d, DTYPE xs[], DTYPE ys[], int s[], int acc)
}

minl = (DTYPE)INT_MAX;
bestt1.branch = bestt2.branch = NULL;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is where you need the clear

Comment thread src/stt/src/flt/flute.cpp Outdated
@maliberty
Copy link
Copy Markdown
Member

Well I guess Matt got his way. I would not have bothered with all of this restructuring for 2 callers of a small api. I think there is really no point in switching between flute and pdref, since pdrev with alpha=0 is equivalent (albeit poorer/slower code). The resizer will probably bypass this api at some point and use the pdrev graph instead of the horrible flute data structures.

There are three callers : grt, rsz, and TR-gr
Why would you bypass the API rather than make it better?
It's about centralizing all the logic, of which I am sure there will be more. Per net alpha would need three implementations. If we add any new feature it will need to be added in all places. If we add a new method (say congestion or blockage aware Steiner trees) all clients will have to be updated. Why would we want to do this in multiple places? To quote you "rule #1: don't copy code. refactor". That's exactly what is happening here.

Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
@eder-matheus eder-matheus requested a review from jjcherry56 July 19, 2021 14:11
@jjcherry56
Copy link
Copy Markdown
Contributor

I would have waited until flute was removed as an alternative.
The only code this change factors is 2 if statements in the resizer and global router.
Otherwise it just moves code around.
I think there are way more important issues, like fixing the 2 outstanding bugs in PD.
It is about priorities and this does not rank as a priority.

Signed-off-by: Eder Monteiro <eder.matheus.monteiro@gmail.com>
@eder-matheus eder-matheus merged commit 6fdb00f into The-OpenROAD-Project:master Jul 19, 2021
@eder-matheus eder-matheus deleted the stt_builder branch July 19, 2021 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants