OpenSTA/dcalc/ArcDcalcWaveforms.cc

86 lines
3.2 KiB
C++
Raw Normal View History

// OpenSTA, Static Timing Analyzer
// Copyright (c) 2025, 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/>.
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// This notice may not be removed or altered from any source distribution.
#include <memory>
ArcDelayCalc api update for multiple drivers commit a78442d7d6672bfcbea5f5007803ab27891b9eab Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 7 13:40:02 2024 -0700 rm OutputWaveforms::currentVoltage Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 074e1c93d4957425c0f2a3afdfce8f0e06ff98a1 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 13 16:49:08 2023 -0700 MultiDrvrNet remove instead of update Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0f6deec2ffcbe85a1c473525b93f6a6514692181 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 13 16:43:24 2023 -0700 MultiDrvrNet remove instead of update Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2f5f48fe09bacd101d1e909f45e087ba8c620561 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Dec 11 09:24:54 2023 -0700 compile errors Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8fc4292e325f7ac10bd8e5d57b5a8111abb05ed Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 18:25:04 2023 -0700 ArcDcalcWaveforms Signed-off-by: James Cherry <cherry@parallaxsw.com> commit be114b10adca194d80ac9529e8635c11ed9c1c32 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 11:34:59 2023 -0700 GraphDelayCalc::findDriverArcDelays Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7b71e137b088c1293e628e594dde6a8223927ee8 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 10:39:30 2023 -0700 GraphDelayCalc::findDriverArcDelays Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b13a791cd57c5b9f9b454b3cf22959fbe3b9667e Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:14:09 2023 -0700 unused arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit abf90ca7c08fd349cfb68554bdeae5a9c3b91a23 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:12:52 2023 -0700 unused arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6bda70448ef133586594503d78b8838421f7a52d Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:10:04 2023 -0700 gateDelay rm pvt arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2f51ed07fa14f039a048c3a146ca1b017fb45f16 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 10:24:57 2023 -0700 dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 362950b9d9aa52f3c331c1007a6ee6a34140812e Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 6 17:00:45 2023 -0700 ArcDcalcResult gateDelay Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 91f1307ac04752e00dfde42b34e84f66fdb60a57 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Dec 4 17:22:40 2023 -0700 ArcDcalcArg/Result Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 74d289e450edf54b1a9215b92c85b1d6a011820d Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 1 17:45:04 2023 -0700 multi drvr init Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c956838aba74c2f27280253f0452e0350bb05c33 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 1 12:10:23 2023 -0800 arc dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5aa2c42833e5f68e901d4ac61d8bef426252e5ab Author: James Cherry <cherry@parallaxsw.com> Date: Thu Nov 30 15:42:43 2023 -0800 dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 434327b7d80fdf8fe3410390c88b299b46e9139b Author: James Cherry <cherry@parallaxsw.com> Date: Thu Nov 30 11:36:21 2023 -0800 arc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 263e1dee49d7133653fbe0bad9b8243ba5259548 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Nov 29 18:48:32 2023 -0800 ArcDelayCalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a9f05513c09564d75cb377a5a89399a250ab5d6b Author: James Cherry <cherry@parallaxsw.com> Date: Mon Nov 27 10:48:59 2023 -0800 ArcDelayCalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2024-01-07 21:44:04 +01:00
#include "ArcDcalcWaveforms.hh"
#include "Report.hh"
#include "Liberty.hh"
#include "Network.hh"
#include "Graph.hh"
#include "ArcDelayCalc.hh"
#include "GraphDelayCalc.hh"
namespace sta {
Waveform
ArcDcalcWaveforms::inputWaveform(ArcDcalcArg &dcalc_arg,
const Scene *scene,
const MinMax *min_max,
const StaState *sta)
ArcDelayCalc api update for multiple drivers commit a78442d7d6672bfcbea5f5007803ab27891b9eab Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 7 13:40:02 2024 -0700 rm OutputWaveforms::currentVoltage Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 074e1c93d4957425c0f2a3afdfce8f0e06ff98a1 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 13 16:49:08 2023 -0700 MultiDrvrNet remove instead of update Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0f6deec2ffcbe85a1c473525b93f6a6514692181 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 13 16:43:24 2023 -0700 MultiDrvrNet remove instead of update Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2f5f48fe09bacd101d1e909f45e087ba8c620561 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Dec 11 09:24:54 2023 -0700 compile errors Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8fc4292e325f7ac10bd8e5d57b5a8111abb05ed Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 18:25:04 2023 -0700 ArcDcalcWaveforms Signed-off-by: James Cherry <cherry@parallaxsw.com> commit be114b10adca194d80ac9529e8635c11ed9c1c32 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 11:34:59 2023 -0700 GraphDelayCalc::findDriverArcDelays Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7b71e137b088c1293e628e594dde6a8223927ee8 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 10:39:30 2023 -0700 GraphDelayCalc::findDriverArcDelays Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b13a791cd57c5b9f9b454b3cf22959fbe3b9667e Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:14:09 2023 -0700 unused arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit abf90ca7c08fd349cfb68554bdeae5a9c3b91a23 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:12:52 2023 -0700 unused arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6bda70448ef133586594503d78b8838421f7a52d Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:10:04 2023 -0700 gateDelay rm pvt arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2f51ed07fa14f039a048c3a146ca1b017fb45f16 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 10:24:57 2023 -0700 dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 362950b9d9aa52f3c331c1007a6ee6a34140812e Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 6 17:00:45 2023 -0700 ArcDcalcResult gateDelay Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 91f1307ac04752e00dfde42b34e84f66fdb60a57 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Dec 4 17:22:40 2023 -0700 ArcDcalcArg/Result Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 74d289e450edf54b1a9215b92c85b1d6a011820d Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 1 17:45:04 2023 -0700 multi drvr init Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c956838aba74c2f27280253f0452e0350bb05c33 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 1 12:10:23 2023 -0800 arc dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5aa2c42833e5f68e901d4ac61d8bef426252e5ab Author: James Cherry <cherry@parallaxsw.com> Date: Thu Nov 30 15:42:43 2023 -0800 dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 434327b7d80fdf8fe3410390c88b299b46e9139b Author: James Cherry <cherry@parallaxsw.com> Date: Thu Nov 30 11:36:21 2023 -0800 arc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 263e1dee49d7133653fbe0bad9b8243ba5259548 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Nov 29 18:48:32 2023 -0800 ArcDelayCalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a9f05513c09564d75cb377a5a89399a250ab5d6b Author: James Cherry <cherry@parallaxsw.com> Date: Mon Nov 27 10:48:59 2023 -0800 ArcDelayCalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2024-01-07 21:44:04 +01:00
{
const Network *network = sta->network();
Graph *graph = sta->graph();
Report *report = sta->report();
const Pin *in_pin = dcalc_arg.inPin();
LibertyPort *port = network->libertyPort(in_pin);
if (port) {
const RiseFall *in_rf = dcalc_arg.inEdge();
DriverWaveform *driver_waveform = port->driverWaveform(in_rf);
if (driver_waveform) {
const Vertex *in_vertex = graph->pinLoadVertex(in_pin);
GraphDelayCalc *graph_dcalc = sta->graphDelayCalc();
Slew in_slew = graph_dcalc->edgeFromSlew(in_vertex, in_rf,
dcalc_arg.arc()->role(),
scene, min_max);
LibertyLibrary *library = port->libertyLibrary();
float vdd;
bool vdd_exists;
library->supplyVoltage("VDD", vdd, vdd_exists);
if (!vdd_exists)
report->error(1751, "VDD not defined in library %s", library->name());
Waveform in_waveform = driver_waveform->waveform(delayAsFloat(in_slew));
// Delay time axis.
FloatSeq time_values;
for (float time : in_waveform.axis1()->values())
time_values.push_back(time + dcalc_arg.inputDelay());
TableAxisPtr time_axis = std::make_shared<TableAxis>(TableAxisVariable::time,
std::move(time_values));
// Scale the waveform from 0:vdd.
FloatSeq *scaled_values = new FloatSeq;
for (float value : *in_waveform.values()) {
float scaled_value = (in_rf == RiseFall::rise())
? value * vdd
: (1.0 - value) * vdd;
scaled_values->push_back(scaled_value);
}
return Waveform(scaled_values, time_axis);
}
}
return Waveform();
ArcDelayCalc api update for multiple drivers commit a78442d7d6672bfcbea5f5007803ab27891b9eab Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 7 13:40:02 2024 -0700 rm OutputWaveforms::currentVoltage Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 074e1c93d4957425c0f2a3afdfce8f0e06ff98a1 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 13 16:49:08 2023 -0700 MultiDrvrNet remove instead of update Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0f6deec2ffcbe85a1c473525b93f6a6514692181 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 13 16:43:24 2023 -0700 MultiDrvrNet remove instead of update Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2f5f48fe09bacd101d1e909f45e087ba8c620561 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Dec 11 09:24:54 2023 -0700 compile errors Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8fc4292e325f7ac10bd8e5d57b5a8111abb05ed Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 18:25:04 2023 -0700 ArcDcalcWaveforms Signed-off-by: James Cherry <cherry@parallaxsw.com> commit be114b10adca194d80ac9529e8635c11ed9c1c32 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 11:34:59 2023 -0700 GraphDelayCalc::findDriverArcDelays Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 7b71e137b088c1293e628e594dde6a8223927ee8 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Dec 9 10:39:30 2023 -0700 GraphDelayCalc::findDriverArcDelays Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b13a791cd57c5b9f9b454b3cf22959fbe3b9667e Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:14:09 2023 -0700 unused arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit abf90ca7c08fd349cfb68554bdeae5a9c3b91a23 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:12:52 2023 -0700 unused arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6bda70448ef133586594503d78b8838421f7a52d Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 13:10:04 2023 -0700 gateDelay rm pvt arg Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2f51ed07fa14f039a048c3a146ca1b017fb45f16 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 8 10:24:57 2023 -0700 dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 362950b9d9aa52f3c331c1007a6ee6a34140812e Author: James Cherry <cherry@parallaxsw.com> Date: Wed Dec 6 17:00:45 2023 -0700 ArcDcalcResult gateDelay Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 91f1307ac04752e00dfde42b34e84f66fdb60a57 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Dec 4 17:22:40 2023 -0700 ArcDcalcArg/Result Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 74d289e450edf54b1a9215b92c85b1d6a011820d Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 1 17:45:04 2023 -0700 multi drvr init Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c956838aba74c2f27280253f0452e0350bb05c33 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Dec 1 12:10:23 2023 -0800 arc dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5aa2c42833e5f68e901d4ac61d8bef426252e5ab Author: James Cherry <cherry@parallaxsw.com> Date: Thu Nov 30 15:42:43 2023 -0800 dcalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 434327b7d80fdf8fe3410390c88b299b46e9139b Author: James Cherry <cherry@parallaxsw.com> Date: Thu Nov 30 11:36:21 2023 -0800 arc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 263e1dee49d7133653fbe0bad9b8243ba5259548 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Nov 29 18:48:32 2023 -0800 ArcDelayCalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a9f05513c09564d75cb377a5a89399a250ab5d6b Author: James Cherry <cherry@parallaxsw.com> Date: Mon Nov 27 10:48:59 2023 -0800 ArcDelayCalc api Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2024-01-07 21:44:04 +01:00
}
} // namespace