Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngspice variable count #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ sphinx-rtd-theme==0.4.3

ipython==7.9.0

matplotlib==3.0.3
matplotlib==3.3.4
numpy==1.18.1
tabulate==0.8.7
24 changes: 24 additions & 0 deletions requirements-dev_35.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pip==20.1.1
bump2version==0.5.11
wheel==0.33.6
watchdog==0.9.0
flake8==3.7.8
tox==3.14.0
coverage==4.5.4
Sphinx==1.8.5
twine==1.14.0

pytest==4.6.5
pytest-runner==5.1

pylint==2.5.2
yapf==0.30.0
rope==0.17.0
rstcheck==3.3.1
sphinx-rtd-theme==0.4.3

ipython==7.9.0

matplotlib==3.0.3
numpy==1.18.1
tabulate==0.8.7
24 changes: 18 additions & 6 deletions spyci/spyci.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,25 @@ def load_raw(rawfile):
ret = copy.deepcopy(m.groupdict())
ret.pop('values')

# vars
vars = m.groupdict()['vars']
pattern = (r"\s*(?P<idx>\d+)\s+" r"(?P<name>\S+)\s+" r"(?P<type>.*)\s*")
m_vars = re.finditer(pattern, vars)
# Determine variables in raw file, and generate dictionary describing them

# Break variables section into lines
vars = m.groupdict()['vars'].splitlines()
ret['vars'] = []
for i in m_vars:
ret['vars'].append(i.groupdict())

# Per line, variable data is seperated by tab. Split up and form
# dictionary. First line is empty so skip it
for index, line in enumerate(vars[1:]):
content = line.split('\t')

# Should be 4 entries per line. First is empty. Save the other 3
if (len(content) == 4):
ret['vars'].append({'idx': content[1], 'name': content[2],
'type': content[3]})
else:
print("Badly described variable at line "+str(index))
ret['vars'].append({'idx': "UNKNOWN", 'name': "UNKNOWN",
'type': "UNKNOWN"})

# values
values = m.groupdict()['values']
Expand Down
181 changes: 181 additions & 0 deletions tests/result_skywater_char_values.txt

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions tests/result_skywater_char_variables.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Variables:

idx name type
----- ------------------------------------------ --------------
1 voltage
10 i(@m.xm2.msky130_fd_pr__nfet_01v8[is]) current dims=0
11 i(@m.xm3.msky130_fd_pr__nfet_01v8_lvt[ib]) current dims=0
12 i(@m.xm3.msky130_fd_pr__nfet_01v8_lvt[id]) current
13 i(@m.xm3.msky130_fd_pr__nfet_01v8_lvt[ig]) current dims=0
14 i(@m.xm3.msky130_fd_pr__nfet_01v8_lvt[is]) current dims=0
15 i(@m.xm4.msky130_fd_pr__nfet_01v8[ib]) current dims=0
16 i(@m.xm4.msky130_fd_pr__nfet_01v8[id]) current
17 i(@m.xm4.msky130_fd_pr__nfet_01v8[ig]) current dims=0
18 i(@m.xm4.msky130_fd_pr__nfet_01v8[is]) current dims=0
19 b voltage
2 @include[current] capacitance
20 d1v8 voltage
21 g1v8 voltage
22 m.xm1.msky130_fd_pr__nfet_01v8_lvt#body voltage
23 m.xm1.msky130_fd_pr__nfet_01v8_lvt#dbody voltage
24 m.xm1.msky130_fd_pr__nfet_01v8_lvt#sbody voltage
25 m.xm2.msky130_fd_pr__nfet_01v8#body voltage
26 m.xm2.msky130_fd_pr__nfet_01v8#dbody voltage
27 m.xm2.msky130_fd_pr__nfet_01v8#sbody voltage
28 m.xm3.msky130_fd_pr__nfet_01v8_lvt#body voltage
29 m.xm3.msky130_fd_pr__nfet_01v8_lvt#dbody voltage
3 i(@m.xm1.msky130_fd_pr__nfet_01v8_lvt[ib]) current dims=0
30 m.xm3.msky130_fd_pr__nfet_01v8_lvt#sbody voltage
31 m.xm4.msky130_fd_pr__nfet_01v8#body voltage
32 m.xm4.msky130_fd_pr__nfet_01v8#dbody voltage
33 m.xm4.msky130_fd_pr__nfet_01v8#sbody voltage
34 net1 voltage
35 net2 voltage
36 net3 voltage
37 net4 voltage
38 s voltage
39 sky130_fd_pr__esd_nfet_05v0_nvt.pm3 voltage
4 i(@m.xm1.msky130_fd_pr__nfet_01v8_lvt[id]) current
40 i(vb) current
41 i(vd) current
42 i(vg) current
43 i(vn_long) current
44 i(vn_lvt_long) current
45 i(vn_lvt_short) current
46 i(vn_short) current
47 i(vs) current
5 i(@m.xm1.msky130_fd_pr__nfet_01v8_lvt[ig]) current dims=0
6 i(@m.xm1.msky130_fd_pr__nfet_01v8_lvt[is]) current dims=0
7 i(@m.xm2.msky130_fd_pr__nfet_01v8[ib]) current dims=0
8 i(@m.xm2.msky130_fd_pr__nfet_01v8[id]) current
9 i(@m.xm2.msky130_fd_pr__nfet_01v8[ig]) current dims=0
Loading