8000 how to debug .ac and .step? · Issue #135 · Xyce/Xyce · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

how to debug .ac and .step? #135

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

Open
olisnr opened this issue Feb 27, 2025 · 3 comments
Open

how to debug .ac and .step? #135

olisnr opened this issue Feb 27, 2025 · 3 comments

Comments

@olisnr
Copy link
olisnr commented Feb 27, 2025

my VCO simulation works with .tans .op .dc and .ac simulation. in the .trans simulation i see a frequency-change with a VCO change. i see also the change in the resonance-frequency of the LC-thank in the .ac simulations if using different VCO voltages.

but if i put the change of the VCO voltage and the .ac analysis together, i only get the resonance of the default VCO voltage:

.step vco 0 2 .5
.ac dec 111 10e6 1001e9
.print ac format=raw v(*) i(*)

if i look at the .res file, i see the different VCO voltages, but all voltages producing the same resonance. i think while the .ac simulation is working, the nonlinear-op simulation that should be done after every .ac simulation is failing. or only the first .op simulation is working and all the .op updates of the .step loop are failing.

ac_step_simulation.zip

how can i debug this?

what i see is

VCO_HBT_TB_017.pdf

what i would expect is

VCO_HBT_TB_013.pdf

@olisnr
Copy link
Author
olisnr commented Feb 27, 2025

there is a .options diagnostic VOLTAGELIMIT=5 that produces some diagnostic output. but im not sure what it means:

dia.zip

the working one says:

Analysis event INITIALIZE AC_IC
Analysis event DC_OP_STARTED DC
Analysis event FINISH AC_IC
Analysis event INITIALIZE AC
Analysis event FINISH AC

while to problematic tells:

Analysis event INITIALIZE AC_IC
Analysis event DC_OP_STARTED DC
Analysis event STEP_FAILED DC
Analysis event DC_OP_GMIN_STEPPING DC
Analysis event  DC_OP_GMIN_STEPPING_FAILED DC smallest gmin = 1.000000e+04
Analysis event DC_OP_SOURCE_STEPPING DC
Analysis event FINISH AC_IC
Analysis event INITIALIZE AC
Analysis event FINISH AC

but the doc Xyce_Users_Guide_7.9.pdf says there should be a statement:
Analysis event STEP_SUCCESSFUL DC
and this i see in no version...

@Karlsefni2012
Copy link
Member

Hello, sorry it has taken me so long to reply to this query.

Based on your description, what I think is probably going on is that the DCOP calculation isn't getting performed after the first .STEP iteration. So, rather than attempting it and failing, it may be getting skipped. I think if the DCOP failed, then the simulation wouldn't continue on to the AC calculation.

From what I remember, the DCOP calculation is the most expensive part of AC analysis. So, if a sweep doesn't affect any variables or parameters that might require a new DCOP, it isn't performed. At any rate, that is my best guess. I'll dig into this later once I have a little time.

@Karlsefni2012
Copy link
Member
Karlsefni2012 commented Apr 2, 2025

I just managed to run your circuit. And, I turned on the DIAGNOSTIC option, same as you.

I agree, looking at the diagnostic output, there is never a STEP_SUCCESSFUL DC output, and I would expect that there would be.

I also built a verbose version of Xyce to observe the solver behavior in more detail. It does look like Xyce (1) does do a DCOP for every .STEP iteration, and (2) does eventually solve the DCOP successfully. Like most simulators Xyce employs a DCOP strategy, in which it initially uses a straight Newton solve, and then if that fails, attempts GMIN stepping and finally if that fails, attempts source stepping. On most (all?) iterations, it doesn't succeed until the source-stepping phase.

So, skipping or failing the DCOP is not the reason for Xyce getting the wrong answer. I'll dig into this some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0