mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-09-05 17:05:11 +02:00
commit 87130be63ddbf1a7fb65986b02839eb4c0b13168 Author: James Cherry <[email protected]> Date: Tue Feb 27 09:49:02 2024 -0700 ccs ceff delay calc Signed-off-by: James Cherry <[email protected]> commit de0dd38dabda2f7ef51b49c196c2787a0d3c5784 Author: James Cherry <[email protected]> Date: Tue Feb 27 07:40:11 2024 -0700 dcalc public funcs Signed-off-by: James Cherry <[email protected]> commit dd7fcb12f929b9b0a391653cad42e617f9cbdd3b Author: James Cherry <[email protected]> Date: Mon Feb 26 09:08:37 2024 -0700 mv CircuitSim.hh to include Signed-off-by: James Cherry <[email protected]> commit 9663e46d28ece544ee1453f229990c9db9e0efec Author: James Cherry <[email protected]> Date: Sun Feb 25 17:58:57 2024 -0700 ArcDcalcArg Signed-off-by: James Cherry <[email protected]> commit 76b0588034faaefd2302c865c441975f76386d3f Author: James Cherry <[email protected]> Date: Sun Feb 25 15:36:46 2024 -0700 ensureVoltageWaveforms Signed-off-by: James Cherry <[email protected]> commit f88e67b861c56752e5b36efe2b552ba0077a7180 Author: James Cherry <[email protected]> Date: Sun Feb 25 15:00:02 2024 -0700 const Signed-off-by: James Cherry <[email protected]> commit 8f32cc571dcadee0185b08f951a1f79d46e7984d Author: James Cherry <[email protected]> Date: Sun Feb 25 14:57:51 2024 -0700 Graph::gateEdgeArc Signed-off-by: James Cherry <[email protected]> commit ac3cb35cb6732d7ecbf0532d7351a3ff2a917fc9 Author: James Cherry <[email protected]> Date: Sun Feb 25 14:31:30 2024 -0700 ConcreteParasiticSubNodeMap, ConcreteParasiticPinNodeMap use id cmp Signed-off-by: James Cherry <[email protected]> commit cbfe4eac463036c26a64701239d7651d91a09778 Author: James Cherry <[email protected]> Date: Sun Feb 25 14:08:41 2024 -0700 WriteSpice Signed-off-by: James Cherry <[email protected]> commit 8b5d30f1a8b1ccb8c9cbd9d7ba93418907c41b2a Author: James Cherry <[email protected]> Date: Sat Feb 24 09:45:46 2024 -0700 emplace_push Signed-off-by: James Cherry <[email protected]> commit 5335a2eaaf737ed7c7a8cff30654a68c4ac4c8e4 Author: James Cherry <[email protected]> Date: Fri Feb 23 16:19:30 2024 -0700 Parasitics::findParasiticNode Signed-off-by: James Cherry <[email protected]> commit ce92f3caf28afb0e0384799f08166cfb0aecfea0 Author: James Cherry <[email protected]> Date: Fri Feb 23 15:53:28 2024 -0700 Parasitics::findParasiticNode Signed-off-by: James Cherry <[email protected]> commit 0c591430c725a3ebd50d2892673dca76e023dc32 Author: James Cherry <[email protected]> Date: Fri Feb 23 09:03:18 2024 -0700 Parsitics::name(node) const Signed-off-by: James Cherry <[email protected]> commit 499c297e64d1487388f549843ff9ea05e8555cfc Author: James Cherry <[email protected]> Date: Fri Feb 23 09:03:07 2024 -0700 write_spice umr Signed-off-by: James Cherry <[email protected]> commit 6984c398dbce9e6266fab8377a844bc518481d9d Author: James Cherry <[email protected]> Date: Thu Feb 22 18:42:34 2024 -0700 gcc warning Signed-off-by: James Cherry <[email protected]> commit edec16519806013623194d8201e804dec81a51dd Author: James Cherry <[email protected]> Date: Thu Feb 22 17:54:11 2024 -0700 no cuddification Signed-off-by: James Cherry <[email protected]> commit 4a0e1070c179b2f8615b604c362359ce4b3a0e2e Author: James Cherry <[email protected]> Date: Thu Feb 22 17:29:46 2024 -0700 sim const Signed-off-by: James Cherry <[email protected]> commit 2e941fafa631f6b9bc0f82784b9146de2449e9c5 Author: James Cherry <[email protected]> Date: Thu Feb 22 17:29:39 2024 -0700 sdc comment Signed-off-by: James Cherry <[email protected]> commit 1c12f56aee7115fcb06807b5b6c626d1a419ccdc Author: James Cherry <[email protected]> Date: Wed Feb 21 13:13:29 2024 -0700 Sim use Bdd class Signed-off-by: James Cherry <[email protected]> commit b70c41d5caec56c3001b834141b6dab89bb933ed Author: James Cherry <[email protected]> Date: Tue Feb 20 12:18:27 2024 -0700 write_spice coupling caps Signed-off-by: James Cherry <[email protected]> commit 614d2cd41a1a9cf850dbe480954a5f58ee0dc21e Author: James Cherry <[email protected]> Date: Mon Feb 19 14:37:30 2024 -0700 write_spice time offset Signed-off-by: James Cherry <[email protected]> commit f0ba1fca0dfca384e6fb0be302bba9ced71ee41c Author: James Cherry <[email protected]> Date: Mon Feb 19 10:59:18 2024 -0700 class Bdd for cudd Signed-off-by: James Cherry <[email protected]> commit 24c94756334fce5e70e97ce0ee31375ae4e59b84 Author: James Cherry <[email protected]> Date: Sun Feb 18 08:58:30 2024 -0700 WriteSpice Signed-off-by: James Cherry <[email protected]> commit 47a4505d88bdfe4a85056895f8b7d842e07dce8d Author: James Cherry <[email protected]> Date: Fri Feb 16 21:34:23 2024 -0700 default sim ngspice Signed-off-by: James Cherry <[email protected]> commit 06e279555a076e218f0a9c308e8937a6fc8fdea4 Author: James Cherry <[email protected]> Date: Fri Feb 16 21:34:01 2024 -0700 WriteSpice refactor Signed-off-by: James Cherry <[email protected]> commit 06e3f0734edbbbd69ad063e97d1d8cca92a83aea Author: James Cherry <[email protected]> Date: Thu Feb 15 15:18:35 2024 -0700 mv report_dcalc to DelayCalc.tcl Signed-off-by: James Cherry <[email protected]> commit 922056471a6d380699bbd0623f95637401d23eff Author: James Cherry <[email protected]> Date: Thu Feb 15 14:27:31 2024 -0700 WriteSpice::cell_spice_port_names_ Signed-off-by: James Cherry <[email protected]> commit 732922ead68097e3f7da268ecc5ae2ca2daa4492 Author: James Cherry <[email protected]> Date: Thu Feb 15 13:35:13 2024 -0700 WritePathSpice.hh Signed-off-by: James Cherry <[email protected]> commit 8cd6e2ffc6ad66e831630273b5eacd192259191e Author: James Cherry <[email protected]> Date: Thu Feb 15 10:11:39 2024 -0700 small Signed-off-by: James Cherry <[email protected]> commit f7f6bfb49f43ddc3e45c294f89c8814d60df5220 Author: James Cherry <[email protected]> Date: Thu Feb 15 09:48:09 2024 -0700 refactor WritePathSpice Signed-off-by: James Cherry <[email protected]> commit f74db730c3e8c67a24d531266510e4376db463d3 Author: James Cherry <[email protected]> Date: Wed Feb 14 09:22:01 2024 -0700 Sta.hh Signed-off-by: James Cherry <[email protected]> commit 051532deef203cae97e32e8af7a2348bfd8912cc Author: James Cherry <[email protected]> Date: Wed Feb 14 08:14:44 2024 -0700 PowerClass.hh Signed-off-by: James Cherry <[email protected]> commit bfb8357d1093e5d3da14e708acd21fc21ba3b0dd Author: James Cherry <[email protected]> Date: Wed Feb 14 08:08:56 2024 -0700 doc Signed-off-by: James Cherry <[email protected]> commit 8fe28ec91b234d9d8210019aa46a2e8107aa497a Author: James Cherry <[email protected]> Date: Wed Feb 14 07:32:34 2024 -0700 ClkSkew use seq instead of set Signed-off-by: James Cherry <[email protected]> commit c4e3a3a0315ab4f6160a707e838423bb734f5363 Author: James Cherry <[email protected]> Date: Tue Feb 13 19:26:45 2024 -0700 report_clock_latency Signed-off-by: James Cherry <[email protected]> commit 51fb6657d9706c7443e1c269cfe63cf080b05d50 Author: James Cherry <[email protected]> Date: Tue Feb 13 11:10:11 2024 -0700 report_clock_latency Signed-off-by: James Cherry <[email protected]> commit e639ee129d13e1c11b34bca0762b8136b18563f3 Author: James Cherry <[email protected]> Date: Mon Feb 12 11:19:06 2024 -0700 ClkSkew use map Signed-off-by: James Cherry <[email protected]> commit e91d3ea8142a73b7b607dfdf53b3fce8e2f16984 Author: James Cherry <[email protected]> Date: Mon Feb 12 10:18:27 2024 -0700 report_clock_skew report format Signed-off-by: James Cherry <[email protected]> commit c650b7ec63b83382ba9cec7d187ffee8a031c2ce Author: James Cherry <[email protected]> Date: Mon Feb 12 09:22:29 2024 -0700 report_clock_skew include macro clock_tree_path_delay Signed-off-by: James Cherry <[email protected]> commit cf14b230a9944b95ba43ef7c09e553d9014990eb Author: James Cherry <[email protected]> Date: Sun Feb 11 11:03:29 2024 -0700 clk skew range iter Signed-off-by: James Cherry <[email protected]> commit e7e0342e063ac876d00d03fd1ff0eab1715cfde4 Author: James Cherry <[email protected]> Date: Sun Feb 11 08:11:29 2024 -0700 write_spice sensitize and3 Signed-off-by: James Cherry <[email protected]> commit 743ceb676c763ac5bcbf05e630a4da1b507c537d Author: James Cherry <[email protected]> Date: Sat Feb 10 18:07:04 2024 -0700 write spice Signed-off-by: James Cherry <[email protected]> Signed-off-by: James Cherry <[email protected]>
206 lines
6.2 KiB
C++
206 lines
6.2 KiB
C++
// OpenSTA, Static Timing Analyzer
|
|
// Copyright (c) 2024, Parallax Software, Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
#pragma once
|
|
|
|
#include <queue>
|
|
#include <mutex>
|
|
|
|
#include "StaConfig.hh" // CUDD
|
|
#include "Map.hh"
|
|
#include "NetworkClass.hh"
|
|
#include "GraphClass.hh"
|
|
#include "SdcClass.hh"
|
|
#include "StaState.hh"
|
|
#include "Bdd.hh"
|
|
|
|
namespace sta {
|
|
|
|
class SimObserver;
|
|
|
|
typedef Map<const Pin*, LogicValue> PinValueMap;
|
|
typedef std::queue<const Instance*> EvalQueue;
|
|
|
|
// Propagate constants from constraints and netlist tie high/low
|
|
// connections thru gates.
|
|
class Sim : public StaState
|
|
{
|
|
public:
|
|
explicit Sim(StaState *sta);
|
|
virtual ~Sim();
|
|
void clear();
|
|
// Set the observer for simulation value changes.
|
|
void setObserver(SimObserver *observer);
|
|
void ensureConstantsPropagated();
|
|
void constantsInvalid();
|
|
LogicValue evalExpr(const FuncExpr *expr,
|
|
const Instance *inst);
|
|
LogicValue logicValue(const Pin *pin) const;
|
|
bool logicZeroOne(const Pin *pin) const;
|
|
bool logicZeroOne(const Vertex *vertex) const;
|
|
// Timing sense for the function between from_pin and to_pin
|
|
// after simplifying the function based constants on the pins.
|
|
virtual TimingSense functionSense(const Instance *inst,
|
|
const Pin *from_pin,
|
|
const Pin *to_pin);
|
|
void findLogicConstants();
|
|
|
|
// Network edits.
|
|
void deleteInstanceBefore(const Instance *inst);
|
|
void makePinAfter(const Pin *pin);
|
|
void deletePinBefore(const Pin *pin);
|
|
void connectPinAfter(const Pin *pin);
|
|
void disconnectPinBefore(const Pin *pin);
|
|
void pinSetFuncAfter(const Pin *pin);
|
|
|
|
protected:
|
|
void ensureConstantFuncPins();
|
|
void recordConstPinFunc(const Pin *pin);
|
|
virtual void seedConstants();
|
|
void seedInvalidConstants();
|
|
void propagateConstants(bool thru_sequentials);
|
|
void setConstraintConstPins(LogicValueMap &pin_value_map);
|
|
void setConstFuncPins();
|
|
LogicValue pinConstFuncValue(const Pin *pin);
|
|
void enqueueConstantPinInputs();
|
|
virtual void setPinValue(const Pin *pin,
|
|
LogicValue value);
|
|
void enqueue(const Instance *inst);
|
|
void evalInstance(const Instance *inst,
|
|
bool thru_sequentials);
|
|
LogicValue clockGateOutValue(const Instance *inst);
|
|
TimingSense functionSense(const FuncExpr *expr,
|
|
const Pin *input_pin,
|
|
const Instance *inst);
|
|
void functionSense(const FuncExpr *expr,
|
|
const Pin *input_pin,
|
|
const Instance *inst,
|
|
// return values
|
|
TimingSense &sense,
|
|
LogicValue &value) const;
|
|
void clearSimValues();
|
|
virtual void clearInstSimValues(const Instance *inst);
|
|
void annotateGraphEdges();
|
|
void annotateVertexEdges(const Instance *inst,
|
|
const Pin *pin,
|
|
Vertex *vertex,
|
|
bool annotate);
|
|
void annotateVertexEdges(const Instance *inst,
|
|
bool annotate);
|
|
void removePropagatedValue(const Pin *pin);
|
|
void propagateFromInvalidDrvrsToLoads();
|
|
void propagateToInvalidLoads();
|
|
void propagateDrvrToLoad(const Pin *drvr_pin,
|
|
const Pin *load_pin);
|
|
void setSimValue(Vertex *vertex,
|
|
LogicValue value);
|
|
DdNode *funcBddSim(const FuncExpr *expr,
|
|
const Instance *inst);
|
|
|
|
SimObserver *observer_;
|
|
bool valid_;
|
|
bool incremental_;
|
|
// Cache of pins that have constant functions (tie high and tie low
|
|
// cell instances).
|
|
PinSet const_func_pins_;
|
|
bool const_func_pins_valid_;
|
|
// Instances that require incremental constant propagation.
|
|
InstanceSet invalid_insts_;
|
|
// Driver pins waiting to propagate constant to loads.
|
|
PinSet invalid_drvr_pins_;
|
|
// Load pins that waiting for the driver constant to propagate.
|
|
PinSet invalid_load_pins_;
|
|
EvalQueue eval_queue_;
|
|
// Instances with constant pin values for annotateVertexEdges.
|
|
InstanceSet instances_with_const_pins_;
|
|
InstanceSet instances_to_annotate_;
|
|
Bdd bdd_;
|
|
mutable std::mutex bdd_lock_;
|
|
};
|
|
|
|
// Abstract base class for Sim value change observer.
|
|
class SimObserver
|
|
{
|
|
public:
|
|
SimObserver() {}
|
|
virtual ~SimObserver() {}
|
|
virtual void valueChangeAfter(Vertex *vertex) = 0;
|
|
virtual void faninEdgesChangeAfter(Vertex *vertex) = 0;
|
|
virtual void fanoutEdgesChangeAfter(Vertex *vertex) = 0;
|
|
};
|
|
|
|
bool
|
|
logicValueZeroOne(LogicValue value);
|
|
|
|
// Edge cond (liberty "when") function is disabled (evals to zero).
|
|
bool
|
|
isCondDisabled(Edge *edge,
|
|
const Instance *inst,
|
|
const Pin *from_pin,
|
|
const Pin *to_pin,
|
|
const Network *network,
|
|
Sim *sim);
|
|
|
|
// isCondDisabled but also return the cond expression that causes
|
|
// the disable. This can differ from the edge cond expression
|
|
// when the default timing edge is disabled by another edge between
|
|
// the same pins that is enabled.
|
|
void
|
|
isCondDisabled(Edge *edge,
|
|
const Instance *inst,
|
|
const Pin *from_pin,
|
|
const Pin *to_pin,
|
|
const Network *network,
|
|
Sim *sim,
|
|
bool &is_disabled,
|
|
FuncExpr *&disable_cond);
|
|
|
|
|
|
// Edge mode function is disabled (evals to zero).
|
|
bool
|
|
isModeDisabled(Edge *edge,
|
|
const Instance *inst,
|
|
const Network *network,
|
|
Sim *sim);
|
|
void
|
|
isModeDisabled(Edge *edge,
|
|
const Instance *inst,
|
|
const Network *network,
|
|
Sim *sim,
|
|
bool &is_disabled,
|
|
FuncExpr *&disable_cond);
|
|
|
|
// Edge is disabled because by test scan enable.
|
|
// from scan_data_in and scan_enable=1
|
|
// from scan_in and scan_enable=0
|
|
bool
|
|
isTestDisabled(const Instance *inst,
|
|
const Pin *from_pin,
|
|
const Pin *to_pin,
|
|
const Network *network,
|
|
const Sim *sim);
|
|
|
|
void
|
|
isTestDisabled(const Instance *inst,
|
|
const Pin *from_pin,
|
|
const Pin *to_pin,
|
|
const Network *network,
|
|
const Sim *sim,
|
|
bool &is_disabled,
|
|
Pin *&scan_enable);
|
|
|
|
} // namespace
|