Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4642eae
Start refactoring
mkosunen Apr 15, 2025
8518652
Fix _bin2int
mkosunen Apr 15, 2025
173f2f6
Actually use self.big_endian
mkosunen Apr 15, 2025
7bdb878
Fix crashes when only sample type outputs are defined
Aug 8, 2025
b9847fc
Add support for Spectre X.
vlahtin Aug 15, 2025
218734f
Merge pull request #24 from TheSystemDevelopmentKit/spectrex_support
sporrasm Aug 15, 2025
1538f98
Add option to use psf for file reading
Aug 15, 2025
da34a25
Check which simutype it is and name the file correctly
vlahtin Aug 18, 2025
6f888b3
use libpsf to read transient
Aug 18, 2025
6e05fbd
Merge
Aug 18, 2025
8c0a9b3
Fix AC
Aug 18, 2025
947f350
Output file reading for event, sample and time outputs is now simulat…
Aug 19, 2025
c923ce1
Allow reading from multiple files
Aug 19, 2025
38f6bfc
Multiple output files supported, at least in theory
Aug 19, 2025
db5c25e
Move strobing related stuff under spectre
Aug 19, 2025
9ca8277
iofile reading is now done inside iofile, as it should be
Aug 19, 2025
c4b400d
Fixup
Aug 19, 2025
37df58b
Extract powers only in transient
Aug 19, 2025
5f115da
fixing pac and pss
MiikkaMaki Aug 19, 2025
1b9b267
Merge branch 'iofile-refactor' of github.com:TheSystemDevelopmentKit/…
MiikkaMaki Aug 19, 2025
a782939
iofile read operation is now simulator agnostic
Aug 20, 2025
2d293e1
Remove breakpoint
Aug 20, 2025
1a39f53
Fixup noise simulation
Aug 20, 2025
b3394ca
Fix spectre X preset names
vlahtin Aug 26, 2025
50f7ce6
Fixup?
Sep 5, 2025
8f73a28
Add option to use psf with psf utils and libpsf for transient. For ot…
vlahtin Sep 8, 2025
0d8ac3b
Merge branch 'iofile-refactor' of github.com:TheSystemDevelopmentKit/…
vlahtin Sep 8, 2025
b3f3d31
Force print file generation if not use_psf
vlahtin Sep 8, 2025
a00c79d
Use black to format code
Sep 8, 2025
29cc1ff
Fix bug which crashes if rawfmt is not in spiceoptions
vlahtin Sep 10, 2025
808f589
Noise must have psfbin type rawfmt
vlahtin Sep 10, 2025
25186c2
Fix PAC
vlahtin Sep 10, 2025
3fa8429
Fix PSS data parsing
vlahtin Sep 10, 2025
22551b7
Explicitly import from abc
vlahtin Nov 17, 2025
e7bf928
Dont add the brackets if the sample IO is for one IO instead of a bus
vlahtin Nov 28, 2025
54e22cd
fix interactive with no other flags
MiikkaMaki Dec 1, 2025
4765113
Merge pull request #29 from TheSystemDevelopmentKit/sample_ioname_fix
vlahtin Dec 1, 2025
d588510
Merge branch 'v1.14_RC' into iofile-refactor
vlahtin Dec 1, 2025
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
1,007 changes: 607 additions & 400 deletions spice/__init__.py

Large diffs are not rendered by default.

361 changes: 222 additions & 139 deletions spice/eldo/eldo.py

Large diffs are not rendered by default.

449 changes: 316 additions & 133 deletions spice/eldo/eldo_testbench.py

Large diffs are not rendered by default.

573 changes: 436 additions & 137 deletions spice/ngspice/ngspice.py

Large diffs are not rendered by default.

629 changes: 427 additions & 202 deletions spice/ngspice/ngspice_testbench.py

Large diffs are not rendered by default.

1,606 changes: 1,229 additions & 377 deletions spice/spectre/spectre.py

Large diffs are not rendered by default.

1,041 changes: 718 additions & 323 deletions spice/spectre/spectre_testbench.py

Large diffs are not rendered by default.

49 changes: 9 additions & 40 deletions spice/spice_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Mix-in class of common properties and methods for spice simulator classes

"""

import os
import sys
import subprocess
Expand All @@ -15,7 +16,8 @@
from spice.spice_methods import spice_methods
import pdb

class spice_common(spice_methods,thesdk):

class spice_common(spice_methods, thesdk):
"""
Common properties and methods for spice simulator tool classes.
Most of these are overloaded in __init__.py
Expand All @@ -24,47 +26,14 @@ class spice_common(spice_methods,thesdk):

@property
def extracts(self):
""" Bundle
"""Bundle

A thesdk.Bundle containing extracted quantities.
"""
if not hasattr(self,'_extracts'):
self._extracts=Bundle()
if not hasattr(self, "_extracts"):
self._extracts = Bundle()
return self._extracts
@extracts.setter
def extracts(self,value):
self._extracts=value

#### [TODO] To be relocated
# Strobing related stuff should not be in this class. Maybe spice_iofile or
# testbench also suposedly these are spectre specific
@property
def strobe_indices(self):
"""
Internally set list of indices corresponding to time,amplitude pairs
whose time value of is a multiple of the strobeperiod (see spice_simcmd).
"""
if not hasattr(self,'_strobe_indices'):
self._strobe_indices=[]
return self._strobe_indices

@strobe_indices.setter
def strobe_indices(self,val):
if isinstance(val, list) or isinstance(val, np.ndarray):
self._strobe_indices=val
else:
self.print_log(type='W', msg='Cannot set strobe_indices to be of type: %s' % type(val))

@property
def is_strobed(self):
'''
Check if simulation was strobed or not
'''
if not hasattr(self, '_is_strobed'):
self._is_strobed=False
for simtype, simcmd in self.simcmd_bundle.Members.items():
if simtype=='tran':
if simcmd.strobeperiod:
self._is_strobed=True
return self._is_strobed

@extracts.setter
def extracts(self, value):
self._extracts = value
61 changes: 34 additions & 27 deletions spice/spice_dcsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@

import os
import sys
from abc import *
from abc import *
from thesdk import *
from thesdk.iofile import iofile
import numpy as np
import pandas as pd


class spice_dcsource(thesdk):
"""
Class to provide DC source definitions to spice testbench. When
Expand All @@ -26,7 +27,7 @@ class spice_dcsource(thesdk):

Attributes
----------
parent : object
parent : object
The parent object initializing the spice_dcsource instance. Default
None.
name : str
Expand Down Expand Up @@ -77,32 +78,34 @@ class spice_dcsource(thesdk):

@property
def _classfile(self):
return os.path.dirname(os.path.realpath(__file__)) + "/"+__name__
return os.path.dirname(os.path.realpath(__file__)) + "/" + __name__

def __init__(self,parent,**kwargs):
try:
def __init__(self, parent, **kwargs):
try:
self.parent = parent
self.sourcetype=kwargs.get('sourcetype','V')
self.name=kwargs.get('name','sourcename')
self.pos=kwargs.get('pos','POSNODE')
self.neg=kwargs.get('neg','NEGNODE')
self.value=kwargs.get('value',0)
self.paramname=kwargs.get('paramname', None)
self.extract=kwargs.get('extract',False)
self.ext_start=kwargs.get('ext_start',None)
self.ext_stop=kwargs.get('ext_stop',None)
self.noise=kwargs.get('noise',True)
self.ramp=kwargs.get('ramp',0)
self.sourcetype = kwargs.get("sourcetype", "V")
self.name = kwargs.get("name", "sourcename")
self.pos = kwargs.get("pos", "POSNODE")
self.neg = kwargs.get("neg", "NEGNODE")
self.value = kwargs.get("value", 0)
self.paramname = kwargs.get("paramname", None)
self.extract = kwargs.get("extract", False)
self.ext_start = kwargs.get("ext_start", None)
self.ext_stop = kwargs.get("ext_stop", None)
self.noise = kwargs.get("noise", True)
self.ramp = kwargs.get("ramp", 0)
except:
self.print_log(type='F', msg="Spice DC source definition failed.")
self.print_log(type="F", msg="Spice DC source definition failed.")
# This enables e.g. DC sweeps
if isinstance(self.paramname, str): # Parameterized source
if isinstance(self.paramname, str): # Cannot use string as default value, parameter value set by sweep
self.parent.spiceparameters.update({self.paramname: '0'})
if isinstance(self.paramname, str): # Parameterized source
if isinstance(
self.paramname, str
): # Cannot use string as default value, parameter value set by sweep
self.parent.spiceparameters.update({self.paramname: "0"})
else:
self.parent.spiceparameters.update({self.paramname:self.value})
if hasattr(self.parent,'dcsource_bundle'):
self.parent.dcsource_bundle.new(name=self.name,val=self)
self.parent.spiceparameters.update({self.paramname: self.value})
if hasattr(self.parent, "dcsource_bundle"):
self.parent.dcsource_bundle.new(name=self.name, val=self)

@property
def ext_file(self):
Expand All @@ -111,10 +114,14 @@ def ext_file(self):
Optional filepath for extracted transient current when
self.extract=True.
"""
if not hasattr(self,'_ext_file'):
self._ext_file = '%s/tb_%s.print' % (self.parent.simpath,self.parent.name)
if not hasattr(self, "_ext_file"):
self._ext_file = "%s/tb_%s.print" % (
self.parent.simpath,
self.parent.name,
)
return self._ext_file

@ext_file.setter
def ext_file(self,val):
self._ext_file=val
def ext_file(self, val):
self._ext_file = val
return self._ext_file
Loading