Skip to content

Commit

Permalink
After giving the previous code change some more thought, I
Browse files Browse the repository at this point in the history
decided that it is beneficial to break symmetries by net name;
it's just that net names should not be used before all symmetries
related to pins have been broken.  So I rewrote the compare
routine to take an argument allowing or disallowing net name
matches, and make one call to break symmetries by pin name
followed by another call to break symmetries by net name.  This
still solves the original problem, but does not allow symmetries
to be broken randomly on internal nets if names have been matched
in both netlists.  Otherwise the output may report nets that
appear to be swapped, making the output confusing.
  • Loading branch information
RTimothyEdwards committed Dec 27, 2024
1 parent 2483b74 commit 6d2ef39
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.288
1.5.289
7 changes: 6 additions & 1 deletion base/netcmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6567,11 +6567,16 @@ void PrintAutomorphisms(void)
* separating out those devices that are connected to matching pins
* in each circuit.
*
* If match_nets == TRUE, then also match internal nets by name. Pins
* should always be matched by name without considering nets first;
* once all symmetries related to pins have been broken, then matching
* symmetries by net can keep the output from looking confusing.
*
* Return value is the same as VerifyMatching()
*-------------------------------------------------------------------------
*/

int ResolveAutomorphsByPin()
int ResolveAutomorphsByPin(int match_nets)
{
struct NodeClass *NC;
struct Node *N;
Expand Down
2 changes: 1 addition & 1 deletion base/netcmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern void RegroupDataStructures();
extern void FormatIllegalElementClasses();
extern void FormatIllegalNodeClasses();
extern int ResolveAutomorphsByProperty();
extern int ResolveAutomorphsByPin();
extern int ResolveAutomorphsByPin(int match_nets);
extern void SummarizeElementClasses(struct ElementClass *EC);
extern int remove_group_tags(struct objlist *ob);

Expand Down
8 changes: 7 additions & 1 deletion tcltk/tclnetgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,13 @@ _netcmp_run(ClientData clientData,
if (automorphisms > 0) {
// Next, attempt to resolve automorphisms uniquely by
// using the pin names
automorphisms = ResolveAutomorphsByPin();
automorphisms = ResolveAutomorphsByPin(FALSE);
}
if (automorphisms > 0) {
// Next, attempt to resolve automorphisms uniquely by
// using the net names (should only be done after
// resolving by pin).
automorphisms = ResolveAutomorphsByPin(TRUE);
}
if (automorphisms > 0) {
// Anything left is truly indistinguishable
Expand Down

0 comments on commit 6d2ef39

Please sign in to comment.