ngscopeclient 0.1-dev+51fbda87c
IBISParser.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
37#ifndef IBISParser_h
38#define IBISParser_h
39
40//Almost all properties are indexed by a corner
41enum IBISCorner
42{
43 CORNER_MIN,
44 CORNER_TYP,
45 CORNER_MAX
46};
47
52{
53public:
54 IVPoint()
55 {}
56
57 IVPoint(float v, float i)
58 : m_voltage(v)
59 , m_current(i)
60 {}
61
62 float m_voltage;
63 float m_current;
64};
65
70{
71public:
72
73 float InterpolateCurrent(float voltage);
74
76 std::vector<IVPoint> m_curve;
77};
78
83{
84public:
85 VTPoint()
86 {}
87
88 VTPoint(float t, float v)
89 : m_time(t)
90 , m_voltage(v)
91 {}
92
93 float m_time;
94 float m_voltage;
95};
96
101{
102public:
103 VTCurves()
104 : m_fixtureResistance(50)
105 , m_fixtureVoltage(0)
106 {}
107
108 float InterpolateVoltage(IBISCorner corner, float time);
109
110 int64_t GetPropagationDelay(IBISCorner corner);
111
112 float m_fixtureResistance;
113 float m_fixtureVoltage;
114
116 std::vector<VTPoint> m_curves[3];
117};
118
125{
126public:
127 IBISModel(const std::string& name)
128 : m_type(TYPE_IO)
129 , m_name(name)
130 , m_vil{0}
131 , m_vih{0}
132 , m_temps{0}
133 , m_voltages{0}
134 , m_dieCapacitance{0}
135 {}
136
137 //Model type
138 enum type_t
139 {
140 TYPE_INPUT,
141 TYPE_IO,
142 TYPE_OPEN_DRAIN,
143 TYPE_OUTPUT,
144 TYPE_SERIES,
145 TYPE_TERMINATOR
146 } m_type;
147
148 //Name of the model
149 std::string m_name;
150
151 //I/V curves for each output buffer
152 IVCurve m_pulldown[3];
153 IVCurve m_pullup[3];
154
155 //V/T curves for each output buffer
156 std::vector<VTCurves> m_rising;
157 std::vector<VTCurves> m_falling;
158
159 //Input thresholds
160 float m_vil[3];
161 float m_vih[3];
162
163 //Temperature and voltage values at each corner
164 float m_temps[3];
165 float m_voltages[3];
166
167 //Component capacitance
168 //TODO: support C_comp_pull* separately
169 float m_dieCapacitance[3];
170
173
176};
177
182{
183public:
184 IBISParser();
185 virtual ~IBISParser();
186
187 void Clear();
188 bool Load(std::string fname);
189
190 std::string m_component;
191 std::string m_manufacturer;
192
193 std::map<std::string, IBISModel*> m_models;
194
195protected:
196 float ParseNumber(const char* str);
197};
198
199#endif
An IBIS model (for a single type of buffer)
Definition: IBISParser.h:125
VTCurves * GetHighestFallingWaveform()
Get the falling-edge waveform terminated to Vcc (or highest available voltage)
Definition: IBISParser.cpp:206
VTCurves * GetHighestRisingWaveform()
Get the rising-edge waveform terminated to Vcc (or lowest available voltage)
Definition: IBISParser.cpp:220
VTCurves * GetLowestFallingWaveform()
Get the falling-edge waveform terminated to ground (or lowest available voltage)
Definition: IBISParser.cpp:178
VTCurves * GetLowestRisingWaveform()
Get the rising-edge waveform terminated to ground (or lowest available voltage)
Definition: IBISParser.cpp:192
IBIS file parser (may contain multiple models)
Definition: IBISParser.h:182
A generic current/voltage curve.
Definition: IBISParser.h:70
std::vector< IVPoint > m_curve
The raw I/V curve data.
Definition: IBISParser.h:76
A single current/voltage point.
Definition: IBISParser.h:52
Base class for all electronic load drivers.
Definition: Load.h:45
Voltage/time curves for a waveform.
Definition: IBISParser.h:101
std::vector< VTPoint > m_curves[3]
The raw V/T curve data.
Definition: IBISParser.h:116
int64_t GetPropagationDelay(IBISCorner corner)
Gets the propagation delay of a V/T curve.
Definition: IBISParser.cpp:159
A single voltage/time point.
Definition: IBISParser.h:83