get_* do not require liberty resolves #161
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
b0bd2d87a1
commit
a139d6b6ed
|
|
@ -413,8 +413,8 @@ latch_d_to_q_en()
|
|||
{
|
||||
if (self->role() == TimingRole::latchDtoQ()) {
|
||||
Sta *sta = Sta::sta();
|
||||
const Network *network = sta->ensureLinked();
|
||||
const Graph *graph = sta->graph();
|
||||
const Network *network = sta->network();
|
||||
const Graph *graph = sta->ensureGraph();
|
||||
Pin *from_pin = self->from(graph)->pin();
|
||||
Instance *inst = network->instance(from_pin);
|
||||
LibertyCell *lib_cell = network->libertyCell(inst);
|
||||
|
|
|
|||
|
|
@ -1232,8 +1232,10 @@ public:
|
|||
|
||||
void setTclInterp(Tcl_Interp *interp);
|
||||
Tcl_Interp *tclInterp();
|
||||
// Ensure a network has been read, linked and liberty libraries exist.
|
||||
// Ensure a network has been read, and linked.
|
||||
Network *ensureLinked();
|
||||
// Ensure a network has been read, linked and liberty libraries exist.
|
||||
Network *ensureLibLinked();
|
||||
void ensureLevelized();
|
||||
// Ensure that the timing graph has been built.
|
||||
Graph *ensureGraph();
|
||||
|
|
|
|||
|
|
@ -618,13 +618,16 @@ void finish() { delete self; }
|
|||
} // LibraryIterator methods
|
||||
|
||||
%extend Cell {
|
||||
const char *name() { return Sta::sta()->ensureLinked()->name(self); }
|
||||
Library *library() { return Sta::sta()->ensureLinked()->library(self); }
|
||||
LibertyCell *liberty_cell() { return Sta::sta()->ensureLinked()->libertyCell(self); }
|
||||
bool is_leaf() { return Sta::sta()->ensureLinked()->isLeaf(self); }
|
||||
const char *name() { return Sta::sta()->cmdNetwork()->name(self); }
|
||||
Library *library() { return Sta::sta()->cmdNetwork()->library(self); }
|
||||
LibertyCell *liberty_cell() { return Sta::sta()->cmdNetwork()->libertyCell(self); }
|
||||
bool is_leaf() { return Sta::sta()->cmdNetwork()->isLeaf(self); }
|
||||
CellPortIterator *
|
||||
port_iterator() { return Sta::sta()->ensureLinked()->portIterator(self); }
|
||||
string get_attribute(const char *key) { return Sta::sta()->ensureLinked()->getAttribute(self, key); }
|
||||
port_iterator() { return Sta::sta()->cmdNetwork()->portIterator(self); }
|
||||
string get_attribute(const char *key)
|
||||
{
|
||||
return Sta::sta()->cmdNetwork()->getAttribute(self, key);
|
||||
}
|
||||
|
||||
Port *
|
||||
find_port(const char *name)
|
||||
|
|
@ -654,7 +657,7 @@ void finish() { delete self; }
|
|||
%extend Port {
|
||||
const char *bus_name() { return Sta::sta()->ensureLinked()->busName(self); }
|
||||
Cell *cell() { return Sta::sta()->ensureLinked()->cell(self); }
|
||||
LibertyPort *liberty_port() { return Sta::sta()->ensureLinked()->libertyPort(self); }
|
||||
LibertyPort *liberty_port() { return Sta::sta()->ensureLibLinked()->libertyPort(self); }
|
||||
bool is_bus() { return Sta::sta()->ensureLinked()->isBus(self); }
|
||||
PortMemberIterator *
|
||||
member_iterator() { return Sta::sta()->ensureLinked()->memberIterator(self); }
|
||||
|
|
@ -670,7 +673,7 @@ void finish() { delete self; }
|
|||
%extend Instance {
|
||||
Instance *parent() { return Sta::sta()->ensureLinked()->parent(self); }
|
||||
Cell *cell() { return Sta::sta()->ensureLinked()->cell(self); }
|
||||
LibertyCell *liberty_cell() { return Sta::sta()->ensureLinked()->libertyCell(self); }
|
||||
LibertyCell *liberty_cell() { return Sta::sta()->ensureLibLinked()->libertyCell(self); }
|
||||
bool is_leaf() { return Sta::sta()->ensureLinked()->isLeaf(self); }
|
||||
InstanceChildIterator *
|
||||
child_iterator() { return Sta::sta()->ensureLinked()->childIterator(self); }
|
||||
|
|
@ -683,7 +686,10 @@ find_pin(const char *name)
|
|||
{
|
||||
return Sta::sta()->ensureLinked()->findPin(self, name);
|
||||
}
|
||||
string get_attribute(const char *key) { return Sta::sta()->ensureLinked()->getAttribute(self, key); }
|
||||
string get_attribute(const char *key) {
|
||||
return Sta::sta()->ensureLinked()->getAttribute(self, key);
|
||||
}
|
||||
|
||||
} // Instance methods
|
||||
|
||||
%extend InstanceChildIterator {
|
||||
|
|
@ -716,7 +722,7 @@ Instance *instance() { return Sta::sta()->ensureLinked()->instance(self); }
|
|||
Net *net() { return Sta::sta()->ensureLinked()->net(self); }
|
||||
Port *port() { return Sta::sta()->ensureLinked()->port(self); }
|
||||
Term *term() { return Sta::sta()->ensureLinked()->term(self); }
|
||||
LibertyPort *liberty_port() { return Sta::sta()->ensureLinked()->libertyPort(self); }
|
||||
LibertyPort *liberty_port() { return Sta::sta()->ensureLibLinked()->libertyPort(self); }
|
||||
bool is_driver() { return Sta::sta()->ensureLinked()->isDriver(self); }
|
||||
bool is_load() { return Sta::sta()->ensureLinked()->isLoad(self); }
|
||||
bool is_leaf() { return Sta::sta()->ensureLinked()->isLeaf(self); }
|
||||
|
|
@ -768,7 +774,7 @@ capacitance(Corner *corner,
|
|||
const MinMax *min_max)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
float pin_cap, wire_cap;
|
||||
sta->connectedCap(self, corner, min_max, pin_cap, wire_cap);
|
||||
return pin_cap + wire_cap;
|
||||
|
|
@ -779,7 +785,7 @@ pin_capacitance(Corner *corner,
|
|||
const MinMax *min_max)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
float pin_cap, wire_cap;
|
||||
sta->connectedCap(self, corner, min_max, pin_cap, wire_cap);
|
||||
return pin_cap;
|
||||
|
|
@ -790,7 +796,7 @@ wire_capacitance(Corner *corner,
|
|||
const MinMax *min_max)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
float pin_cap, wire_cap;
|
||||
sta->connectedCap(self, corner, min_max, pin_cap, wire_cap);
|
||||
return wire_cap;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ read_vcd_file(const char *filename,
|
|||
const char *scope)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
readVcdActivities(filename, scope, sta);
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ read_saif_file(const char *filename,
|
|||
const char *scope)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
return readSaif(filename, scope, sta);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ read_sdf_file(const char *filename,
|
|||
MinMaxAllNull *cond_use)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
sta->ensureGraph();
|
||||
if (stringEq(path, ""))
|
||||
path = NULL;
|
||||
|
|
@ -72,7 +72,7 @@ report_annotated_delay_cmd(bool report_cells,
|
|||
bool report_constant_arcs)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
sta->ensureGraph();
|
||||
reportAnnotatedDelay(report_cells, report_nets,
|
||||
report_in_ports, report_out_ports,
|
||||
|
|
@ -95,7 +95,7 @@ report_annotated_check_cmd(bool report_setup,
|
|||
bool report_constant_arcs)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
sta->ensureGraph();
|
||||
reportAnnotatedCheck(report_setup, report_hold,
|
||||
report_recovery, report_removal,
|
||||
|
|
@ -116,7 +116,7 @@ write_sdf_cmd(char *filename,
|
|||
bool no_version)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
sta->writeSdf(filename, corner, divider, include_typ, digits, gzip,
|
||||
no_timestamp, no_version);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ getProperty(const Library *lib,
|
|||
const char *property,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->cmdNetwork();
|
||||
if (stringEqual(property, "name")
|
||||
|| stringEqual(property, "full_name"))
|
||||
return PropertyValue(network->name(lib));
|
||||
|
|
@ -711,8 +711,8 @@ getProperty(const LibertyCell *cell,
|
|||
|| stringEqual(property, "base_name"))
|
||||
return PropertyValue(cell->name());
|
||||
else if (stringEqual(property, "full_name")) {
|
||||
Network *network = sta->ensureLinked();
|
||||
auto lib = cell->libertyLibrary();
|
||||
Network *network = sta->cmdNetwork();
|
||||
LibertyLibrary *lib = cell->libertyLibrary();
|
||||
string lib_name = lib->name();
|
||||
string cell_name = cell->name();
|
||||
string full_name = lib_name + network->pathDivider() + cell_name;
|
||||
|
|
@ -741,7 +741,7 @@ getProperty(const Cell *cell,
|
|||
const char *property,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->cmdNetwork();
|
||||
if (stringEqual(property, "name")
|
||||
|| stringEqual(property, "base_name"))
|
||||
return PropertyValue(network->name(cell));
|
||||
|
|
@ -767,7 +767,7 @@ getProperty(const Port *port,
|
|||
const char *property,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->cmdNetwork();
|
||||
if (stringEqual(property, "name")
|
||||
|| stringEqual(property, "full_name"))
|
||||
return PropertyValue(network->name(port));
|
||||
|
|
@ -819,7 +819,7 @@ portSlewProperty(const Port *port,
|
|||
const MinMax *min_max,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->ensureLibLinked();
|
||||
Instance *top_inst = network->topInstance();
|
||||
Pin *pin = network->findPin(top_inst, port);
|
||||
return pinSlewProperty(pin, min_max, sta);
|
||||
|
|
@ -831,7 +831,7 @@ portSlewProperty(const Port *port,
|
|||
const MinMax *min_max,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->ensureLibLinked();
|
||||
Instance *top_inst = network->topInstance();
|
||||
Pin *pin = network->findPin(top_inst, port);
|
||||
return pinSlewProperty(pin, rf, min_max, sta);
|
||||
|
|
@ -842,7 +842,7 @@ portSlackProperty(const Port *port,
|
|||
const MinMax *min_max,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->ensureLibLinked();
|
||||
Instance *top_inst = network->topInstance();
|
||||
Pin *pin = network->findPin(top_inst, port);
|
||||
return pinSlackProperty(pin, min_max, sta);
|
||||
|
|
@ -854,7 +854,7 @@ portSlackProperty(const Port *port,
|
|||
const MinMax *min_max,
|
||||
Sta *sta)
|
||||
{
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->ensureLibLinked();
|
||||
Instance *top_inst = network->topInstance();
|
||||
Pin *pin = network->findPin(top_inst, port);
|
||||
return pinSlackProperty(pin, rf, min_max, sta);
|
||||
|
|
@ -1075,7 +1075,7 @@ pinSlewProperty(const Pin *pin,
|
|||
const MinMax *min_max,
|
||||
Sta *sta)
|
||||
{
|
||||
auto graph = sta->ensureGraph();
|
||||
Graph *graph = sta->ensureGraph();
|
||||
Vertex *vertex, *bidirect_drvr_vertex;
|
||||
graph->pinVertices(pin, vertex, bidirect_drvr_vertex);
|
||||
Slew slew = min_max->initValue();
|
||||
|
|
@ -1098,7 +1098,7 @@ pinSlewProperty(const Pin *pin,
|
|||
const MinMax *min_max,
|
||||
Sta *sta)
|
||||
{
|
||||
auto graph = sta->ensureGraph();
|
||||
Graph *graph = sta->ensureGraph();
|
||||
Vertex *vertex, *bidirect_drvr_vertex;
|
||||
graph->pinVertices(pin, vertex, bidirect_drvr_vertex);
|
||||
Slew slew = min_max->initValue();
|
||||
|
|
@ -1139,7 +1139,7 @@ getProperty(Edge *edge,
|
|||
Sta *sta)
|
||||
{
|
||||
if (stringEqual(property, "full_name")) {
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->cmdNetwork();
|
||||
Graph *graph = sta->ensureGraph();
|
||||
const char *from = edge->from(graph)->name(network);
|
||||
const char *to = edge->to(graph)->name(network);
|
||||
|
|
@ -1177,7 +1177,7 @@ edgeDelayProperty(Edge *edge,
|
|||
for (TimingArc *arc : arc_set->arcs()) {
|
||||
RiseFall *to_rf = arc->toEdge()->asRiseFall();
|
||||
if (to_rf == rf) {
|
||||
for (auto corner : *sta->corners()) {
|
||||
for (const Corner *corner : *sta->corners()) {
|
||||
DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(min_max);
|
||||
ArcDelay arc_delay = sta->arcDelay(edge, arc, dcalc_ap);
|
||||
if (!delay_exists
|
||||
|
|
@ -1204,9 +1204,9 @@ getProperty(TimingArcSet *arc_set,
|
|||
if (arc_set->isWire())
|
||||
return PropertyValue("wire");
|
||||
else {
|
||||
auto from = arc_set->from()->name();
|
||||
auto to = arc_set->to()->name();
|
||||
auto cell_name = arc_set->libertyCell()->name();
|
||||
const char *from = arc_set->from()->name();
|
||||
const char *to = arc_set->to()->name();
|
||||
const char *cell_name = arc_set->libertyCell()->name();
|
||||
string name;
|
||||
stringPrint(name, "%s %s -> %s", cell_name, from, to);
|
||||
return PropertyValue(name);
|
||||
|
|
@ -1264,7 +1264,7 @@ getProperty(PathEnd *end,
|
|||
else if (stringEqual(property, "points")) {
|
||||
PathExpanded expanded(end->path(), sta);
|
||||
PathRefSeq paths;
|
||||
for (auto i = expanded.startIndex(); i < expanded.size(); i++) {
|
||||
for (size_t i = expanded.startIndex(); i < expanded.size(); i++) {
|
||||
const PathRef *path = expanded.path(i);
|
||||
paths.push_back(*path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ vertex_worst_arrival_path(Vertex *vertex,
|
|||
const MinMax *min_max)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
PathRef path = sta->vertexWorstArrivalPath(vertex, min_max);
|
||||
if (!path.isNull())
|
||||
return new PathRef(path);
|
||||
|
|
@ -232,7 +232,7 @@ vertex_worst_arrival_path_rf(Vertex *vertex,
|
|||
MinMax *min_max)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
PathRef path = sta->vertexWorstArrivalPath(vertex, rf, min_max);
|
||||
if (!path.isNull())
|
||||
return new PathRef(path);
|
||||
|
|
@ -245,7 +245,7 @@ vertex_worst_slack_path(Vertex *vertex,
|
|||
const MinMax *min_max)
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
sta->ensureLinked();
|
||||
sta->ensureLibLinked();
|
||||
PathRef path = sta->vertexWorstSlackPath(vertex, min_max);
|
||||
if (!path.isNull())
|
||||
return new PathRef(path);
|
||||
|
|
@ -335,7 +335,7 @@ void
|
|||
report_loops()
|
||||
{
|
||||
Sta *sta = Sta::sta();
|
||||
Network *network = sta->ensureLinked();
|
||||
Network *network = sta->network();
|
||||
Graph *graph = sta->ensureGraph();
|
||||
Report *report = sta->report();
|
||||
for (GraphLoop *loop : *sta->graphLoops()) {
|
||||
|
|
|
|||
|
|
@ -2121,7 +2121,7 @@ Sta::writeSdc(const char *filename,
|
|||
bool gzip,
|
||||
bool no_timestamp)
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
sta::writeSdc(network_->topInstance(), filename, "write_sdc",
|
||||
leaf, native, digits, gzip, no_timestamp, sdc_);
|
||||
}
|
||||
|
|
@ -3324,7 +3324,7 @@ Sta::findDelays(Level level)
|
|||
void
|
||||
Sta::delayCalcPreamble()
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
ensureClkNetwork();
|
||||
}
|
||||
|
||||
|
|
@ -3422,6 +3422,15 @@ Sta::vertexSlew(Vertex *vertex,
|
|||
// Throwing an error means the caller doesn't have to check the result.
|
||||
Network *
|
||||
Sta::ensureLinked()
|
||||
{
|
||||
if (network_ == nullptr || !network_->isLinked())
|
||||
report_->error(1570, "No network has been linked.");
|
||||
// Return cmd/sdc network.
|
||||
return cmd_network_;
|
||||
}
|
||||
|
||||
Network *
|
||||
Sta::ensureLibLinked()
|
||||
{
|
||||
if (network_ == nullptr || !network_->isLinked())
|
||||
report_->error(1570, "No network has been linked.");
|
||||
|
|
@ -3436,7 +3445,7 @@ Sta::ensureLinked()
|
|||
Graph *
|
||||
Sta::ensureGraph()
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
if (graph_ == nullptr && network_) {
|
||||
makeGraph();
|
||||
// Update pointers to graph.
|
||||
|
|
@ -3900,7 +3909,7 @@ Sta::readSpef(const char *filename,
|
|||
float coupling_cap_factor,
|
||||
bool reduce)
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
setParasiticAnalysisPts(corner != nullptr);
|
||||
const MinMax *ap_min_max = (min_max == MinMaxAll::all())
|
||||
? MinMax::max()
|
||||
|
|
@ -3935,7 +3944,7 @@ void
|
|||
Sta::reportParasiticAnnotation(bool report_unannotated,
|
||||
const Corner *corner)
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
ensureGraph();
|
||||
sta::reportParasiticAnnotation(report_unannotated, corner, this);
|
||||
}
|
||||
|
|
@ -4782,7 +4791,7 @@ Sta::findRegisterOutputPins(ClockSet *clks,
|
|||
void
|
||||
Sta::findRegisterPreamble()
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
ensureGraph();
|
||||
ensureGraphSdcAnnotated();
|
||||
sim_->ensureConstantsPropagated();
|
||||
|
|
@ -5639,7 +5648,7 @@ Sta::writeTimingModel(const char *lib_name,
|
|||
const char *filename,
|
||||
const Corner *corner)
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
ensureGraph();
|
||||
LibertyLibrary *library = makeTimingModel(lib_name, cell_name, filename,
|
||||
corner, this);
|
||||
|
|
@ -5651,7 +5660,7 @@ Sta::writeTimingModel(const char *lib_name,
|
|||
void
|
||||
Sta::powerPreamble()
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
// Use arrivals to find clocking info.
|
||||
searchPreamble();
|
||||
search_->findAllArrivals();
|
||||
|
|
@ -5699,7 +5708,7 @@ Sta::writePathSpice(PathRef *path,
|
|||
const char *gnd_name,
|
||||
CircuitSim ckt_sim)
|
||||
{
|
||||
ensureLinked();
|
||||
ensureLibLinked();
|
||||
sta::writePathSpice(path, spice_filename, subckt_filename,
|
||||
lib_subckt_filename, model_filename,
|
||||
power_name, gnd_name, ckt_sim, this);
|
||||
|
|
|
|||
Loading…
Reference in New Issue