<@U01SBMJT5BP> I am struggling with the following ...
# xyce
s
@Eric Keiter I am struggling with the following apparently simple task. I want to run an AC analysis and a TRAN analysys in a single run. So I tried to give the following lines:
Copy code
.ac dec 10 1 1e12
.tran 1e-15 6e-12
.print ac format=raw file=test_ac_ac.raw v(*) i(*)
.print tran format=raw file=test_ac_tran.raw v(*) i(*)
However it seems Xyce can do only one analysis at a time, it gives this error:
Netlist error: Analysis type AC and print type TRAN are inconsistent.
Simulation aborted due to error.  There are 0 MSG_FATAL errors and 1 MSG_ERROR
errors
The manual states that: A netlist may contain many .PRINT commands, but only commands with analysis types which are appropriate for the analysis being performed are processed. This feature allows you to generate multiple formats and variable sets in a single analysis run. My understanding was that
.print tran
lines are applied to the
.tran
analysis and
.print ac
lines are applied to the
.ac
analysis. Any suggestions? --EDIT-- May be I found the answer in the FAQ: "I am trying to simulate a netlist that contains two kinds of simulation (such as .TRAN and .AC)" "A netlist with two .print lines (such as .print ac file=file1.prn v(1) and .print tran file=file2.prn v(1)) will run in Xyce. However, Xyce currently doesn’t handle multiple analysis types in the same netlist. In this example, it will only output the second file (file2.prn)". In my tests even leaving two .print lines with different analyses and one single .tran or .ac or other analysis line also produces the above error.
e
Hi @Stefan Schippers, as you discovered, Xyce currently only supports a single analysis at a time. Probably the error handling is too strict with .PRINT lines with mismatched analysis types - we could probably change that to a warning, rather than a fatal error.
Longer term, we’ve been aware of this issue for a while. When we started writing Xyce many years ago, we were only focused on transient simulation. We didn’t bother adding things like AC and HB until much later. And, by then the assumption of a single analysis was pervasive throughout the source code. But, it has been our plan to change Xyce to support multiple analyses in the same netlist.
We’ve been gradually working towards this, but it has required unraveling some technical debt.
Currently, we have a customer who wants Xyce to perform local optimizations of analog circuits, and to use objective functions from DC, Tran and AC in the same optimization loop. So, to make that work we probably have to make multiple analyses work in general.
s
Thank you @Eric Keiter. If there is a plan to allow multiple sims in the future i will wait for that. This is a nice feature since a user might click 'SImulate' in the schematic editor and get operating point info annotated directly int the schematic as well as transient waveforms. I think you are already halfway in the process since Xyce already supports writing into multiple files.
👍 1
e
Yes, I think much of the code is in place to make it happen. For every type of analysis in Xyce, there is an analysis class that gets allocated, and there is the beginnings of code to simply have a vector of these classes that Xyce then just has to loop over, one by one. The issues that (I think) remain include (1) getting rid of any fatal errors that forbid this and (2) making sure that everything gets properly cleaned up and re-initialized in between each analysis.
There may be some other issues I don’t know about yet, of course. The joy of programming. 🙂
s
I had lot of test circuits i built for general validation of the schematic editor and later for sky130 simulations. Originally all tests were for ngspice as it was the only option. I am now converting all these test cases to run both with ngspice and Xyce with no modifications (of course there are instructions specific to ngspice and specific to Xyce, the schematic editor emits the right ones based on the selected target simulator). So far the addition of Xyce is straightforward, and I always got valid results. A class of test circuits that may be somewhat difficult to migrate are the ones that use mismatch/MonteCarlo simulations. I have to understand how this is done in Xyce. 🙂 @Tim Edwards. have you done some tests?
e
Xyce does support sampling to some degree. I added that code a few years ago. I haven’t focused on using it for mismatch, but I would imagine it can be made to work.
👍 1