public class DesignComparator
extends Object
EDIFNetlistComparator
to compare logical netlists
(EDIFNetlist
).Constructor and Description |
---|
DesignComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compareDesigns(Design gold,
Design test)
Compares two designs placement and routing (according to flags, see
DesignComparator.comparePlacement , DesignComparator.comparePIPs , and
DesignComparator.comparePIPFlags ). |
int |
compareNets(Net gold,
Net test)
Compares two nets for differences in routing (PIPs).
|
boolean |
comparePIPFlags()
Gets the comparePIPFlags flag indicating if the routing flags on a design's
PIPs should be compared by DesignComparator.
|
int |
compareSiteInsts(SiteInst gold,
SiteInst test)
Compares two site instances for placement and site routing differences.
|
boolean |
getComparePlacement()
Gets the comparePlacement flag indicating if a design's placement (cells,
sitepips, sitewire to net mappings) should be compared by DesignComparator.
|
int |
getDiffCount()
Gets the total number of differences encountered since the last call of
DesignComparator.compareDesigns(Design, Design) . |
List<DesignDiff> |
getDiffList(DesignDiffType type) |
Map<DesignDiffType,List<DesignDiff>> |
getDiffMap() |
void |
printDiffReport(PrintStream ps)
Prints an exhaustive list of diffs with specific contextual information about
each difference.
|
void |
printDiffReportSummary(PrintStream ps)
Prints a summary total for each difference type found in the recent
comparisons since the last time the diff counter was reset.
|
void |
resetDiffCount() |
void |
setComparePIPFlags(boolean comparePIPFlags)
Sets a flag to tell the design comparator if PIP flags should also be
compared.
|
void |
setComparePIPs(boolean comparePIPs)
Sets a flag to tell the design comparator if PIP should be compared.
|
void |
setComparePIPs(Predicate<Net> predicate)
Set the predicate for the design comparator if PIPs should be compared for the given Net.
|
void |
setComparePlacement(boolean comparePlacement)
Sets the flag to tell the design comparator if placement (cell placements,
sitePIPs, and site wire to net mappings) should be compared.
|
public int compareDesigns(Design gold, Design test)
DesignComparator.comparePlacement
, DesignComparator.comparePIPs
, and
DesignComparator.comparePIPFlags
). It will return the total number of differences
encountered and an optional report can be created by subsequently calling
DesignComparator.printDiffReportSummary(PrintStream)
or
DesignComparator.printDiffReport(PrintStream)
.
Note that the number of differences are stored in the class and can be
retrieved afterward by calling DesignComparator.getDiffCount()
. Calling this method a
second and subsequent times will reset the counter and tracked diffs.gold
- The expected design or reference.test
- The design being compared with the reference.public int getDiffCount()
DesignComparator.compareDesigns(Design, Design)
.public void resetDiffCount()
public boolean comparePIPFlags()
public void setComparePIPFlags(boolean comparePIPFlags)
comparePIPFlags
- Desired flag value (default: false).public void setComparePIPs(boolean comparePIPs)
comparePIPs
- Desired flag value (default: true).public void setComparePIPs(Predicate<Net> predicate)
predicate
- Predicate.public boolean getComparePlacement()
public void setComparePlacement(boolean comparePlacement)
comparePlacement
- Desired flag value (default: true);public Map<DesignDiffType,List<DesignDiff>> getDiffMap()
public List<DesignDiff> getDiffList(DesignDiffType type)
public int compareSiteInsts(SiteInst gold, SiteInst test)
gold
- The expected or reference site instance.test
- The site instance being compared to the reference.public int compareNets(Net gold, Net test)
DesignComparator.setComparePIPs(boolean)
(default: true) and
DesignComparator.setComparePIPFlags(boolean)
(default: false).gold
- The expected or reference net.test
- The net to be compared against the reference net.public void printDiffReportSummary(PrintStream ps)
ps
- The desired print stream ('System.out', e.g. for immediate screen
printing).public void printDiffReport(PrintStream ps)
DesignComparator.printDiffReportSummary(PrintStream)
first.ps
- The desired print stream ('System.out', e.g. for immediate screen
printing).