question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SPICE co-simulation for Analog Mixed Signal (AMS)

See original GitHub issue

This is an overall feature-request to make cocotb drive a workbench in a SPICE environment.

Note: This is quite different from what https://docs.cocotb.org/en/latest/examples.html#mixed-signal-analog-digital talks about. The currently supported way requires the use of a simulator that can simulate e.g. Verilog-AMS. That is useful but also quite restricted in the number of people having access to those kind of simulators.

Instead, this is about interacting with a SPICE simulation straight away using the cocoTB python library.

This can be done in various ways, e.g. using PySpice or using a SPICE simulator capable of VPI like Xyce[1][2].

A proposed goal is to be able to take a SPICE netlist and a Python cocoTB testbench and run those together to produce a result. Just like you today can take a cocoTB testbench and a Verilog module and get a result. Notable differences are that SPICE is of course analog but that will hopefully prove a surmountable problem.

Imagine this simple inverter as the DUT: image

**.subckt test out vcc gnd in
*.opin out
*.ipin vcc
*.ipin gnd
*.ipin in
XM1 out in vcc vcc sky130_fd_pr__pfet_01v8 w=1 l=1 m=1
XM2 out in gnd gnd sky130_fd_pr__nfet_01v8 w=1 l=1 m=1
**.ends
.end

And this as the testbench:

@cocotb.test()
async def test(dut):
    # Set voltage to logical high
    dut.in <= V(1.8)
    await Timer(2, units='ns')
    # Check that voltage is in the zone of a logical 0
    assert dut.out.value < 1.8/2, "Inverter result is incorrect"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ktbarrettcommented, Oct 8, 2020

This is yet another good case for supporting arbitrary GPI extensions, which further re-enforces the need to remove the embed library (#1994) and replace it with a service-handler-style interface in the GPI, much like the VPI and VHPI.

0reactions
ktbarrettcommented, Jun 27, 2021

Closing as the original suggestion is out of scope.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Analogue Mixed Signal Simulation Using Spice ... - CiteSeerX
Abstract—SystemC is a discrete event simulator that enables the programmer to model complex designs with varying levels of abstraction.
Read more >
Beyond SPICE - Analog/Mixed Signal Simulation - LinkedIn
In this article, I like to inspire a little bit to go beyond using only SPICE in circuit simulation and do AMS -...
Read more >
PrimeSim SPICE simulator for analog, RF, and mixed-signal ...
PrimeSim SPICE is a high-performance SPICE circuit simulator for analog, RF, and mixed-signal applications.
Read more >
Co-Simulation of SPICE Netlists and VHDL ... - IEEE Xplore
This paper addresses a method for simulator coupling allowing a transient time simulation of SPICE and the mixed-signal language VHDL-AMS within one ...
Read more >
SystemC analog co-simulation - Accellera Forums
We are currently using rollback with VHDL analog co-simulation but rollback with ... February 14, 2014 in SystemC AMS (Analog/Mixed-Signal).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found