Skip to content

Commit

Permalink
issue 149, 150, cmdNetwork->Sta::ensureLinked check libs
Browse files Browse the repository at this point in the history
commit 6f3634724fa52fb9d88418c1fa550cc86f8bdf10
Author: James Cherry <[email protected]>
Date:   Thu Dec 19 11:49:15 2024 -0700

    rm cmdLinkedNetwork

    Signed-off-by: James Cherry <[email protected]>

commit 4d5339327d2c373c3628cafed4ecb243718dc769
Author: James Cherry <[email protected]>
Date:   Thu Dec 19 10:13:03 2024 -0700

    Sta::ensureLinked

    Signed-off-by: James Cherry <[email protected]>

commit f17e408fcd10a72f2d8a627cfaf36f22be5c9ef3
Author: James Cherry <[email protected]>
Date:   Wed Dec 18 15:54:34 2024 -0700

    Sta::ensureNetwork()

    Signed-off-by: James Cherry <[email protected]>

Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Dec 19, 2024
1 parent adfafa9 commit a06c4fc
Show file tree
Hide file tree
Showing 19 changed files with 269 additions and 398 deletions.
5 changes: 2 additions & 3 deletions dcalc/DelayCalc.i
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ report_delay_calc_cmd(Edge *edge,
const MinMax *min_max,
int digits)
{
cmdLinkedNetwork();
return Sta::sta()->reportDelayCalc(edge, arc, corner, min_max, digits);
Sta *sta = Sta::sta();
return sta->reportDelayCalc(edge, arc, corner, min_max, digits);
}

void
Expand All @@ -77,7 +77,6 @@ set_prima_reduce_order(size_t order)
void
find_delays()
{
cmdLinkedNetwork();
Sta::sta()->findDelays();
}

Expand Down
21 changes: 6 additions & 15 deletions graph/Graph.i
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@
#include "Search.hh"
#include "Sta.hh"

namespace sta {

Graph *
cmdGraph();

} // namespace

using namespace sta;

%}
Expand Down Expand Up @@ -85,25 +78,26 @@ private:
int
graph_vertex_count()
{
return cmdGraph()->vertexCount();
return Sta::sta()->ensureGraph()->vertexCount();
}

int
graph_edge_count()
{
return cmdGraph()->edgeCount();
return Sta::sta()->ensureGraph()->edgeCount();
}

int
graph_arc_count()
{
return cmdGraph()->arcCount();
return Sta::sta()->ensureGraph()->arcCount();
}

VertexIterator *
vertex_iterator()
{
return new VertexIterator(cmdGraph());
Graph *graph = Sta::sta()->ensureGraph();
return new VertexIterator(graph);
}

void
Expand All @@ -113,7 +107,6 @@ set_arc_delay(Edge *edge,
const MinMaxAll *min_max,
float delay)
{
cmdGraph();
Sta::sta()->setArcDelay(edge, arc, corner, min_max, delay);
}

Expand All @@ -124,15 +117,13 @@ set_annotated_slew(Vertex *vertex,
const RiseFallBoth *rf,
float slew)
{
cmdGraph();
Sta::sta()->setAnnotatedSlew(vertex, corner, min_max, rf, slew);
}

// Remove all delay and slew annotations.
void
remove_delay_slew_annotations()
{
cmdGraph();
Sta::sta()->removeDelaySlewAnnotations();
}

Expand Down Expand Up @@ -422,7 +413,7 @@ latch_d_to_q_en()
{
if (self->role() == TimingRole::latchDtoQ()) {
Sta *sta = Sta::sta();
const Network *network = sta->cmdNetwork();
const Network *network = sta->ensureLinked();
const Graph *graph = sta->graph();
Pin *from_pin = self->from(graph)->pin();
Instance *inst = network->instance(from_pin);
Expand Down
2 changes: 1 addition & 1 deletion include/sta/Network.hh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public:
virtual void readLibertyAfter(LibertyLibrary *library);
// First liberty library read is used to look up defaults.
// This corresponds to a link_path of '*'.
LibertyLibrary *defaultLibertyLibrary() const;
virtual LibertyLibrary *defaultLibertyLibrary() const;
void setDefaultLibertyLibrary(LibertyLibrary *library);
// Check liberty cells used by the network to make sure they exist
// for all the defined corners.
Expand Down
1 change: 1 addition & 0 deletions include/sta/SdcNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public:

const char *name(const Library *library) const override;
ObjectId id(const Library *library) const override;
LibertyLibrary *defaultLibertyLibrary() const override;
LibraryIterator *libraryIterator() const override;
LibertyLibraryIterator *libertyLibraryIterator() const override;
Library *findLibrary(const char *name) override;
Expand Down
31 changes: 12 additions & 19 deletions include/sta/Sta.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ public:
// disconnect_net
virtual void disconnectPin(Pin *pin);
virtual void makePortPin(const char *port_name,
const char *direction);
PortDirection *dir);
// Notify STA of network change.
void networkChanged();
void deleteLeafInstanceBefore(const Instance *inst);
Expand Down Expand Up @@ -1230,6 +1230,8 @@ public:

void setTclInterp(Tcl_Interp *interp);
Tcl_Interp *tclInterp();
// Ensure a network has been read, linked and liberty libraries exist.
Network *ensureLinked();
void ensureLevelized();
// Ensure that the timing graph has been built.
Graph *ensureGraph();
Expand Down Expand Up @@ -1287,24 +1289,6 @@ public:
const Corner *corner);
PwrActivity findClkedActivity(const Pin *pin);

void writeGateSpice(ArcDcalcArgSeq gates,
const char *spice_filename,
const char *subckt_filename,
const char *lib_subckt_filename,
const char *model_filename,
const char *power_name,
const char *gnd_name,
CircuitSim ckt_sim,
const Corner *corner,
const MinMax *min_max);
void writeGateGnuplot(ArcDcalcArgSeq gates,
PinSet plot_pins,
const char *spice_waveform_filename,
const char *csv_filename,
const char *gnuplot_filename,
const Corner *corner,
const MinMax *min_max);

void writeTimingModel(const char *lib_name,
const char *cell_name,
const char *filename,
Expand All @@ -1316,6 +1300,15 @@ public:
LibertyLibrarySeq *map_libs);
LibertyCellSeq *equivCells(LibertyCell *cell);

void writePathSpice(PathRef *path,
const char *spice_filename,
const char *subckt_filename,
const char *lib_subckt_filename,
const char *model_filename,
const char *power_name,
const char *gnd_name,
CircuitSim ckt_sim);

protected:
// Default constructors that are called by makeComponents in the Sta
// constructor. These can be redefined by a derived class to
Expand Down
6 changes: 3 additions & 3 deletions liberty/Liberty.i
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,19 @@ liberty_supply_exists(const char *supply_name)
LibertyLibraryIterator *
liberty_library_iterator()
{
return cmdNetwork()->libertyLibraryIterator();
return Sta::sta()->network()->libertyLibraryIterator();
}

LibertyLibrary *
find_liberty(const char *name)
{
return cmdNetwork()->findLiberty(name);
return Sta::sta()->network()->findLiberty(name);
}

LibertyCell *
find_liberty_cell(const char *name)
{
return cmdNetwork()->findLibertyCell(name);
return Sta::sta()->network()->findLibertyCell(name);
}

bool
Expand Down
Loading

0 comments on commit a06c4fc

Please sign in to comment.