-
Notifications
You must be signed in to change notification settings - Fork 562
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
odb/cdl: Handle top-level pins wired to nets of different name #6040
odb/cdl: Handle top-level pins wired to nets of different name #6040
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
f5abb2d
to
5c44c3c
Compare
Please add a unit test that demonstrates this use case. |
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
@maliberty Yes, I changed the input file so that it now triggers the bad behavior. With the new input file and without the code change the resulting CDL would be invalid and not match the |
src/odb/src/cdl/cdl.cpp
Outdated
auto pin_name_match = net2pin.find(net_name); | ||
if (pin_name_match != net2pin.end()) { | ||
return pin_name_match->second; | ||
} |
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.
Rather than build net2pin and lookup, you could just handle the bterm here, eg
dbBTerm* bterm = net->get1stBTerm();
if (bterm) {
return bterm->getName();
}
return net->getName();
ATM the code seem to assume that for each top level pin, the net name is equal to the pin name. That's not always the case and this produces an incorect netlist. To solve that, if a net is connected to a pin, we use the pin name instead of the DB net name. Signed-off-by: Sylvain Munaut <[email protected]>
Without the previous patch fixing CDL output the tests dump_netlists / dump_netlists_withfill and the output CDL is invalid. With the path applied, the internal net name is ignored and the pin name is used instead. Signed-off-by: Sylvain Munaut <[email protected]>
50c8919
to
415f007
Compare
clang-tidy review says "All clean, LGTM! 👍" |
|
ATM the code seem to assume that for each top level pin, the net name is equal to the pin name.
That's not always the case and this produces an incorect netlist.
To solve that, during pin name enumeration when creating the subckt line, we create a mapping from "net name" -> "pin name" for each pin connected to a net of a different name. Then when outputting the connections between sub blocks, we use the pin name instead of the DB net name.