2022-06-08 17:29:53 +02:00
|
|
|
// OpenSTA, Static Timing Analyzer
|
|
|
|
|
// Copyright (c) 2022, 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
|
|
|
|
|
|
2022-06-11 01:26:14 +02:00
|
|
|
#include <map>
|
|
|
|
|
|
2022-06-08 17:29:53 +02:00
|
|
|
#include "LibertyClass.hh"
|
2022-06-11 01:26:14 +02:00
|
|
|
#include "SdcClass.hh"
|
2022-06-08 17:29:53 +02:00
|
|
|
#include "SearchClass.hh"
|
|
|
|
|
#include "StaState.hh"
|
2022-06-11 01:26:14 +02:00
|
|
|
#include "RiseFallMinMax.hh"
|
2022-06-08 17:29:53 +02:00
|
|
|
|
|
|
|
|
namespace sta {
|
|
|
|
|
|
|
|
|
|
class Sta;
|
|
|
|
|
class LibertyBuilder;
|
|
|
|
|
|
2022-06-11 01:26:14 +02:00
|
|
|
class OutputDelays
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
OutputDelays();
|
|
|
|
|
TimingSense timingSense() const;
|
|
|
|
|
|
|
|
|
|
RiseFallMinMax delays;
|
2022-06-11 19:48:53 +02:00
|
|
|
// input edge -> output edge path exists for unateness
|
2022-06-11 01:26:14 +02:00
|
|
|
bool rf_path_exists[RiseFall::index_count][RiseFall::index_count];
|
|
|
|
|
};
|
|
|
|
|
|
2022-06-11 01:54:19 +02:00
|
|
|
typedef std::map<ClockEdge*, RiseFallMinMax> ClockEdgeDelays;
|
2022-06-11 01:26:14 +02:00
|
|
|
typedef std::map<const Pin *, OutputDelays> OutputPinDelays;
|
|
|
|
|
|
2022-06-08 17:29:53 +02:00
|
|
|
class MakeTimingModel : public StaState
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
MakeTimingModel(const Corner *corner,
|
|
|
|
|
Sta *sta);
|
|
|
|
|
~MakeTimingModel();
|
2022-08-22 19:55:11 +02:00
|
|
|
LibertyLibrary *makeTimingModel(const char *lib_name,
|
|
|
|
|
const char *cell_name,
|
2022-06-09 03:54:56 +02:00
|
|
|
const char *filename);
|
2022-06-08 17:29:53 +02:00
|
|
|
|
|
|
|
|
private:
|
2022-08-22 19:55:11 +02:00
|
|
|
void makeLibrary(const char *lib_name,
|
2022-06-08 17:29:53 +02:00
|
|
|
const char *filename);
|
|
|
|
|
void makeCell(const char *cell_name,
|
|
|
|
|
const char *filename);
|
|
|
|
|
void makePorts();
|
2022-11-03 01:06:51 +01:00
|
|
|
void checkClock(Clock *clk);
|
2022-06-11 01:26:14 +02:00
|
|
|
void findTimingFromInputs();
|
2022-06-08 17:29:53 +02:00
|
|
|
void findClkedOutputPaths();
|
2022-06-11 01:26:14 +02:00
|
|
|
void findOutputDelays(const RiseFall *input_rf,
|
|
|
|
|
OutputPinDelays &output_pin_delays);
|
|
|
|
|
void makeSetupHoldTimingArcs(const Pin *input_pin,
|
2022-06-11 01:54:19 +02:00
|
|
|
const ClockEdgeDelays &clk_margins);
|
2022-06-11 01:26:14 +02:00
|
|
|
void makeInputOutputTimingArcs(const Pin *input_pin,
|
|
|
|
|
OutputPinDelays &output_pin_delays);
|
2022-06-08 19:03:41 +02:00
|
|
|
TimingModel *makeScalarCheckModel(float value,
|
|
|
|
|
ScaleFactorType scale_factor_type,
|
|
|
|
|
RiseFall *rf);
|
2022-06-12 01:25:21 +02:00
|
|
|
TimingModel *makeGateModelScalar(Delay delay,
|
2022-06-09 03:54:56 +02:00
|
|
|
Slew slew,
|
|
|
|
|
RiseFall *rf);
|
2022-06-12 01:25:21 +02:00
|
|
|
TimingModel *makeGateModelTable(const Pin *output_pin,
|
|
|
|
|
Delay delay,
|
|
|
|
|
RiseFall *rf);
|
2022-06-26 01:31:18 +02:00
|
|
|
TableAxisPtr loadCapacitanceAxis(const TableModel *table);
|
2022-06-11 01:26:14 +02:00
|
|
|
LibertyPort *modelPort(const Pin *pin);
|
2022-06-08 19:03:41 +02:00
|
|
|
|
2022-06-08 17:29:53 +02:00
|
|
|
Sta *sta_;
|
|
|
|
|
LibertyLibrary *library_;
|
|
|
|
|
LibertyCell *cell_;
|
|
|
|
|
const Corner *corner_;
|
|
|
|
|
MinMax *min_max_;
|
|
|
|
|
LibertyBuilder *lib_builder_;
|
2022-06-12 01:25:21 +02:00
|
|
|
int tbl_template_index_;
|
2022-06-08 17:29:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|