ngspice testbench conversion to xyce - sky130A support

76 views
Skip to first unread message

Sai Charan

unread,
Dec 8, 2022, 9:37:41 PM12/8/22
to xyce-users
I have a testbench written for ngspice but I want to run that in Xyce. Do you have any suggestions on converting the testbench to Xyce?
Also I saw that xschem is integrated with Xyce but how do I work with skywater opensource PDK and Xyce in a standalone mode? I don't see any model file for xyce to include in my testbench.

Sai Charan

unread,
Dec 8, 2022, 11:34:28 PM12/8/22
to xyce-users
I managed to include the sky130a library and tried to replace a few ngspice keywords with that of Xyce in my testbench. Now when I am trying to measure the time difference between two rise edges of a signal using this statement `.meas   tran period TRIG v(lc_out) td=10p minval=1.0 rise=2  TARG v(lc_out) td=10p minval=1.0 rise=3`, I get error at this very line saying that this is an invalid statement. I am not sure what I am missing even after referring to the manual. Can anyone help me here please?

xyce-users

unread,
Dec 9, 2022, 10:53:55 AM12/9/22
to xyce-users

In your measure statement using trig/targ:

.meas   tran period TRIG v(lc_out) td=10p minval=1.0 rise=2  TARG v(lc_out) td=10p minval=1.0 rise=3

you need to specify a value for v(lc_out) that will be the trigger value and a value for v(lc_out) that will be the target value.  The keyword "minval" is used as a tolerance on the time.  There doesn't appear to be a legal syntax in Xyce where the trigger target is just a voltage node without a corresponding target value.  

See section 2.1.18 of the reference manual which starts on page 52.  The Trig/Targ section is on page 59

xyce-users

unread,
Dec 9, 2022, 12:36:48 PM12/9/22
to xyce-users
A little while ago, Matthew Guthaus posted a recipe for converting the Sky130 ngspice files to Xyce.


Some of the steps that he describes are not necessary anymore.   We  added some features to Xyce in response to that feedback.

If you would rather not convert the files yourself,  Murat Eskiyerli posted a converted Xyce files for sky130.  You can find those here:    https://github.com/eskiyerli/sky130_reveda

When you run Xyce on the converted Sky130 files, I recommend you use the command line option:  Xyce --hspice-ext all  <netlist>

That enables all of the Xyce "Hspice" compatibility features that Xyce currently supports.

thanks,
Eric

Sai Charan

unread,
Dec 9, 2022, 3:45:39 PM12/9/22
to xyce-users
Great thanks, Eric. I do see a bunch of warning messages referring to a few sky130 primitive spice files and Xyce is trying to fix something I guess (see below for that message). So if you do this conversion, I no longer get them?
`
Netlist warning in file
$PDKROOT/sky130A/libs.tech/ngspice/corners/../../../libs.ref/sky130_fd_pr/spice/sky130_fd_pr__pfet_01v8_hvt__tt.pm3.spice
 at or near line 21474
 Device model XI1:X_112_:X1:SKY130_FD_PR__PFET_01V8_HVT__MODEL.80: Given
 pbswgd is less than 0.1. Pbswgd is set to 0.1

Also I tried to modify the above measure line in this manner `.meas   tran period TRIG when v(lc_out)=1.0 td=10p rise=2  TARG when v(lc_out)=1.0 td=10p rise=3` which made the simulation run smoothly. However, there is a difference between ngspice results and xyce results. Power improved in xyce but period value (the above calculated ones) is increased by a small number (ngspice:1.23...us, xyce:1.60....us). Please note that no stimulus (voltage sources and signal config) is changed.

Can you comment on the above result please?

Regards
Sai

Sai Charan

unread,
Dec 9, 2022, 3:57:16 PM12/9/22
to xyce-users
I think its worth mentioning the time. Ngspice took around 15 -20 mins to give the result but Xyce did the same thing in around 4 mins with a difference in results of course. I am yet to convert the testbench deck and run it in a single go, but I think Xyce will finish it with a significant difference in total time than that of Ngspice. For automation and regression runs, with this run time, Xyce is definitely a preferred choice.

Regards
Sai

xyce-users

unread,
Dec 9, 2022, 6:37:33 PM12/9/22
to xyce-users
Glad to hear the runtime is faster.  Hopefully that will hold up!

Regarding the warnings you are getting, those are coming from the BSIM4 device model and they are part of that model, as the original Berkeley developers designed it.   In the more recent versions of Xyce we modified the code to throttle warnings so that you (hopefully) won't see too many of these. But basically, some internal parameter is evaluating to a value outside the allowed range.

I should give the caveat that I haven't run Sky130 much myself. 

I have seen other people report seeing these warnings from Xyce.  If ngspice isn't emitting these warnings that could be a sign of something we need to fix.   Sometimes, I've noticed that various simulators have extensions to models like the BSIM4, that go beyond the original Berkeley code.  So, that could be a potential culprit. If that were happening here, you'd probably see some warnings about unrecognized model parameters.  Are you seeing any "unrecognized parameter" warnings as well?  If so what were they?

thanks,
Eric

Sai Charan

unread,
Dec 9, 2022, 9:27:44 PM12/9/22
to xyce-users, me...@umich.edu
I don't see any such warning but I do something like this -
`Device model XI1:X_079_:X1:SKY130_FD_PR__PFET_01V8_HVT__MODEL.80: Model card
 specifies BSIM4 version 4.5 which is older than the oldest version supported
 in Xyce (4.6.1).  Using oldest version available.` 
I see this for other models as well (nfet, nfet_hvt and pfet). Is this because of not converting sky130a files like you mentioned? Tim Edwards mentioned that the existing models after installing the pdk should support both ngspice and xyce. Not sure about that but I tagged you to that conversation on the #xyce channel.

Regards
Sai 

--
You received this message because you are subscribed to a topic in the Google Groups "xyce-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xyce-users/Nghc0DsLZw0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xyce-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xyce-users/babab26c-6225-46b1-bc47-a48a4b32f15dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages