FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python3-eispice/module/ibis.py at master · Narrat/python3-eispice · GitHub
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
Narrat
/
python3-eispice
Public archive
Notifications
You must be signed in to change notification settings
Fork
1
Star
6
Code
Issues
1
Pull requests
0
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Security and quality
Insights
Expand file tree
Breadcrumbs
python3-eispice
/
module
/
ibis.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
114 lines (97 loc) · 3.56 KB
Breadcrumbs
python3-eispice
/
module
/
ibis.py
Copy path
File metadata and controls
114 lines (97 loc) · 3.56 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
# Copyright (C) 2005-2007 Cooper Street Innovations Inc.
# Charles Eidsness <charles@cooper-street.com>
#
# 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 2
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
"""
This module provides support for ibis model defined devices.
Device Classes:
Receiver -- IBIS Receiver Device Model
Driver -- IBIS Driver Device Model
Package -- IBIS Package Device Model
Pin -- IBIS Pin Model (Buffer model plus PCackage Model)
IBIS Classes:
IbisPinData -- IBIS Pin Data
IbisModel_Selector -- IBIS Model Selector Data
IbisVICurve -- IBIS VI Curve Data
IbisPin -- IBIS Pin Data
IbisPackage -- IBIS Package Data
IbisWaveform -- IBIS Waveform Data
IbisRamp -- IBIS Ramp Data
IbisModel_Spec -- IBIS Spec Data
IbisModel -- IBIS Model Data
IbisComponent -- IBIS Component Data
Ibis -- Top Level IBIS Data
Functions:
calcDriverKDoubleWave -- Calculates a TA Table using 2 Waveforms
calcDriverKSingleWave -- Calculates a TA Table using 1 Waveform
calcDriverKRamp -- Calculates a TA Table using Ramp Data
"""
from
ibis_parser
import
*
class
Ibis
(
Ibis_Parser
):
"""IBIS Model
Examples:
>>> import eispice
>>> ibs = eispice.Ibis('test')
1. Double Waveform Defined Model
>>> cct = eispice.Circuit('IBIS Double Waveform Test')
>>> cct.Driver = ibs['2']('vsx')
>>> cct.Vmeas = eispice.V('vsx', 'vs', 0)
>>> cct.Rt = eispice.R('vs', 'vi', '33.2')
>>> cct.Tg = eispice.T('vi', 0, 'vo', 0, 50, '2n')
>>> cct.Receiver = ibs['1']('vo')
>>> cct.tran('0.01n', '15n')
>>> cct.check_v('vo', 2.942970279e-01, '4.7n')
True
>>> cct.check_i('Vmeas', 2.200965422e-02, '7.1n')
True
2. Ramp Waveform Defined Model
>>> cct = eispice.Circuit('IBIS Ramp Test')
>>> cct.Driver = ibs['4']('vsx')
>>> cct.Vmeas = eispice.V('vsx', 'vs', 0)
>>> cct.Rt = eispice.R('vs', 'vi', '33.2')
>>> cct.Tg = eispice.T('vi', 0, 'vo', 0, 50, '2n')
>>> cct.Receiver = ibs['1']('vo')
>>> cct.tran('0.01n', '15n')
>>> cct.check_v('vo', -2.416134420e-01, '1.7n')
True
>>> cct.check_i('Vmeas', 1.521229286e-02, '4.9n')
True
"""
def
__init__
(
self
,
filename
,
device
=
None
):
"""
Arguments:
filename -- IBIS Model to import
device -- (optional) name of default device, default = first device
"""
if
device
!=
None
:
device
=
device
.
lower
()
Ibis_Parser
.
__init__
(
self
,
filename
,
device
)
def
__getitem__
(
self
,
pin
):
"""Returns a device model for the specified pin."""
class
PinBuilder
:
def
__init__
(
self
,
pin
,
ibs
):
self
.
pin
=
pin
self
.
ibs
=
ibs
def
__call__
(
self
,
node
,
speed
=
Typical
,
direction
=
Rising
,
io
=
Output
,
modelName
=
None
):
return
Pin
(
self
.
ibs
,
self
.
pin
,
node
,
speed
,
direction
,
io
,
modelName
)
return
PinBuilder
(
pin
.
lower
(),
self
)
if
__name__
==
'__main__'
:
import
doctest
doctest
.
testmod
(
verbose
=
False
)
print
(
'Testing Complete'
)
Back
|
FazBrowse Home
|
New Git URL