Skip to content

Is it possible to do SPICE simulation and generate an SVG from the same netlist? #134

Answered by devbisme
gsingh93 asked this question in Q&A
Discussion options

You must be logged in to vote

I added a simple method to Part objects to convert them into a form that's compatible with SPICE:

def convert_for_spice(self, spice_part, pin_map):
    """Convert a Part object for use with SPICE.

    Args:
        spice_part (Part): The type of SPICE Part to be converted to.
        pin_map (dict): Dict with pin numbers/names of self as keys and num/names of spice_part pins as replacement values.
    """

Here's a simple test program I wrote that shows how it's used:

from skidl.pyspice import *

def test_part_convert_for_spice():

    set_default_tool(KICAD)

    vcc = Part("Device", "Battery", value=5 @ u_V)
    r1 = Part("Device", "R", value=1 @ u_kOhm)
    r2 = Part("Device", "R", value=

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@gsingh93
Comment options

@gsingh93
Comment options

@devbisme
Comment options

@devbisme
Comment options

Answer selected by gsingh93
@Geocali
Comment options

@devbisme
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants