XDM and hspice fab models

224 views
Skip to first unread message

Hassan Hassan

unread,
Jan 14, 2021, 2:01:15 PM1/14/21
to xyce-users
Hi,

I am trying to translate a simple netlist with XDM that includes the fab models. Running the simulation with the translated files yields an error in xyce that seems to reflect an issue with how the fab model was translated. The model file is defined using subckt that then includes different model cards. An example is shown below

.SUBCKT n_1p05_hlplvt d g s b
.PARAM P1=1
.PARAM P2=2

.MODEL n_1p05_hlplvt.1 NMOS
+ ...
+ LEVEL=14

When I run xyce simulation, it complains that parameter P1 and P2 are not defined for the mode n_1p05_hlplvt.1. The only way that I can get the simulation to go is to add these parameters into every instance definition for n_1p05_hlplvt. This is too much manual work that can not be done. Is there something that I am missing here?

xyce-users

unread,
Jan 14, 2021, 2:13:57 PM1/14/21
to xyce-users
Could you please clarify something?  Is the model card n_1p05hplvt.1 inside the .subckt/.ends block, or is it outside?

.param statements inside .subckt/.ends are local to that subcircuit and not visible outside the subcircuit definition, so if your model card is outside the subcircuit *and* references those parameters, it won't work.  Moving the model cards into the .subckt would fix that.

If the .model card is inside the .subckt/.ends then there is a different issue to understand.

Either way, we would need more detail to debug it.

Hassan A. Hassan

unread,
Jan 14, 2021, 2:18:47 PM1/14/21
to xyce-users
HI,

The .model card is inside the subckt.

Regards,
Hassan


--
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/ll9JGNTLmjw/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/2e0124cd-7182-446d-bda3-7bf7bbe49e89o%40googlegroups.com.

xyce-users

unread,
Jan 14, 2021, 2:25:52 PM1/14/21
to xyce-users

In that case, we have some work to do.  In order to diagnose this properly, we'll need a complete failing netlist.  Without that we would simply be guessing at what's going on.  It could be a translation issue, it could be a bug, or it could be something else.

The best results would obtain if you could reduce this to a small, non-proprietary example that fails --- then you could post it here with no problem and we could take it from there.  If you are unable to reduce it to something simple and non-proprietary, you can email the team directly at xy...@sandia.gov and we can come up with a way of working with you to resolve the issue.

But without an exact example of something that fails, it will be difficult for us to proceed.
To unsubscribe from this group and all its topics, send an email to xyce-users+unsubscribe@googlegroups.com.

Hassan A. Hassan

unread,
Jan 14, 2021, 2:42:49 PM1/14/21
to xyce-users
Hi,

Let me share first how I am doing the translation and see if we can catch an issue there first. I created a dummy spice file that looks like that
.lib '/cad_design/mirror/CADP/sim_models/umc_28nm/revisions/version3/model/2sigma/l28hlp_mm_v101_e.lib' SS
.end
I then call XDM as shown below.
xdm_bdl -s hspice -d xyc2/ -o xyce --auto dummy.spi

This usually fails with the following error:
Traceback (most recent call last):
  File "xdm_bdl.py", line 292, in <module>
  File "xdm/inout/readers/GenericReader.py", line 283, in read
  File "xdm/inout/readers/GenericReaderState.py", line 172, in resolve_unknown_pnl
AttributeError: 'NoneType' object has no attribute 'name'
[227222] Failed to execute script xdm_bdl

However, if I pass the model file directly to XDM, it passes and then I get the error I mentioned before while running xyce. Can the issue be caused by me calling XDM directly on the model file? If so, do you know why XDM is failing when I include the model file? 

Regards,
Hassan


To unsubscribe from this group and all its topics, send an email to xyce-users+...@googlegroups.com.

--
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/ll9JGNTLmjw/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/bbf11456-3d4b-46ab-b2fb-89d76fb79931o%40googlegroups.com.

xyce-users

unread,
Jan 14, 2021, 5:49:56 PM1/14/21
to xyce-users
For the XDM translation part, we don't have enough information to tell what's going wrong. We need to be able to see the PDK in question and how everything is organized in it. But speculating - that part of the code that it crashes out on seems to be looking for subckt definitions for a device instance. Perhaps a file that has a subckt definition isn't being included? Are you including

.lib '/cad_design/mirror/CADP/sim_models/umc_28nm/revisions/version3/model/2sigma/l28hlp_mm_v101_e.lib' SS

in the main include file? In other words, does the SS section in the file l28hlp_mm_v101_e.lib include all the other files needed to run a simulation?

It may well be something else but we need a failing netlist to drill down to the problem.

xyce-users

unread,
Jan 14, 2021, 6:03:50 PM1/14/21
to xyce-users
There's a typo in the above. It should read:

"is the file 
.lib '/cad_design/mirror/CADP/sim_models/umc_28nm/revisions/version3/model/2sigma/l28hlp_mm_v101_e.lib' SS

the main include file?”

Hassan A. Hassan

unread,
Jan 15, 2021, 10:17:40 AM1/15/21
to xyce-users
Hi,

I found what was causing the issue with XDM and the translation of the model file, it did not like something in the BJT models. Since I am not using BJTs, I just got rid of it and the conversion was successful. After reading the converted model file into xyce, I found these issues below and fixed them. I am not sure if there is a better way to fix these issues other than what I have done, but at least what I have done so far seems to have worked.
1- Xyce did not like the multiline delimiter \\. To avoid that, I removed this delimiter and removed the new line, this seems to get this to work.
    .param a = 'b+c\\
    +d'
    should be converted to either 
    .param a = 'b+c+d'
    or
    .param a = 'b+c+ 
    + d'
2- Xyce did not like parameters described as below:
    .param f1(a) = 'a*2'
     To get this to work, all these parameters needed to be transformed to:
     .func f1(a) {a*2}
3- Xyce did not like conditional parameters when spaces are not used:
    .param a = 'b > 1 ? x: y'
    This needed to be fixed to
     .param a = 'b > 1 ? x : y' 
    notice the space before the colon. The same also applies for & and | signs, I needed to add spaces around them.
4- Xyce did not like parameters with the simulation temperature being used in them:
    .param a = 'temper*2'
    To fix this, I needed to add a global parameter for the temperature to be used in all the parameters
    .global_param temper = 100

Now, I am still facing one more error:
Netlist error in file l28hlp_mm_v101_e.lib at or near line 142553
 Model is required for device M1 and no valid model card found.
Simulation aborted due to error.  There are 0 MSG_FATAL errors and 1 MSG_ERROR

I am guessing this is related to the simulator unable to find the proper model card for the length/width limits, right? I am going to keep on debugging, but I was wondering whether this rings a bell or not.

m1 d g s b n_1p05_hlplvt_lplus_main
+ w=w l=l ad=ad as=as pd=pd ps=ps sd=sd
+ nf=nf dtemp=dtemp sca=sca scb=scb scc=scc
+ nrd=nrd nrs=nrs
************************************************************************************************************************
.model n_1p05_hlplvt_lplus_main.1 nmos
+vgs_max = '1.1*1.05'
+vgd_max = '1.1*1.05'
+vds_max = '1.1*1.05'
+vbd_max = '2.1*1.05'
+vbs_max = '2.1*1.05'
+vgb_max = '2.1*1.05'
+lmin = '9.0000000e-007-dxl_n_1p05_hlplvt'                    lmax = '5.4000000e-006+1.0000000e-010'
+wmin = '4.5000000e-006-dxw_n_1p05_hlplvt'                    wmax = '9.0000000e-006+1.0000000e-010'
+level = 54                                                   version = 4.62
+binunit = 1                                                  paramchk = 1

Regards,
Hassan


xyce-users

unread,
Jan 15, 2021, 11:38:47 AM1/15/21
to xyce-users
Hi Hasan,

That's great you found the issue with XDM and got it working! Thanks for reporting the bugs as well! The issues you reported are things we believe XDM should handle. For example, if you have a HSPICE file called dummy.inc:

.param f1(a) = 'a*2'
.param a = 'b+c\\
    +d'
.param a = 'b > 1 ? x: y'
.param a = 'temper*2'

and ran XDM on is using xdm_bdl -s hspice -d out -o xyce ./dummy.inc, then the translated output should be:

.GLOBAL_PARAM XYCE_TEMPER=25
.STEP LIN TEMP 25 25 1
.OPTIONS DEVICE TNOM=25  ; converted options using xdm
.FUNC f1(a) 'a*2'
.PARAM A='b+c+d'
.PARAM A='b > 1 ? x : y'
.PARAM A='XYCE_TEMPER*2'

So we were wondering if you could provide more context on what happened?
1. Are you sure XDM translated all the files, especially those with the problems you mentioned in particular?
2. Could you provide some fragments of the original HSPICE code around those problem statements? 
3. Could you tell us what in the BJT was causing the issues? 

This would really help us out and make XDM a better product. Thanks!

xyce-users

unread,
Jan 15, 2021, 11:45:30 AM1/15/21
to xyce-users
Also, the model card you are showing doesn't look like it's translated. XDM would usually strip out the version model parameter from the HSPICE, as well as changing the level to 14. For example, if you have a HSPICE file called dummymodel.inc with the following code:

.model n_1p05_hlplvt_lplus_main.1 nmos
+vgs_max = '1.1*1.05'
+vgd_max = '1.1*1.05'
+vds_max = '1.1*1.05'
+vbd_max = '2.1*1.05'
+vbs_max = '2.1*1.05'
+vgb_max = '2.1*1.05'
+lmin = '9.0000000e-007-dxl_n_1p05_hlplvt'                    lmax = '5.4000000e-006+1.0000000e-010'
+wmin = '4.5000000e-006-dxw_n_1p05_hlplvt'                    wmax = '9.0000000e-006+1.0000000e-010'
+level = 54                                                   version = 4.62
+binunit = 1                                                  paramchk = 1


and ran XDM on it with the command xdm_bdl -s hspice -d out -o xyce ./dummymodel.inc, the translation should look like:

.OPTIONS PARSER model_binning=true  ; converted options using xdm

.OPTIONS DEVICE TNOM=25  ; converted options using xdm
.MODEL n_1p05_hlplvt_lplus_main.1 NMOS
+ BINUNIT=1 LMAX='5.4000000e-006+1.0000000e-010'
+ LMIN='9.0000000e-007-dxl_n_1p05_hlplvt' PARAMCHK=1
+ WMAX='9.0000000e-006+1.0000000e-010' WMIN='4.5000000e-006-dxw_n_1p05_hlplvt'
+ LEVEL=14

Are you certain that the files are being translated by XDM? Thanks!

xyce-users

unread,
Jan 15, 2021, 1:38:58 PM1/15/21
to xyce-users
One more thing - after running the XDM translation, the translated files ought to be in the directory indicated by the "-d <directory>" flag in the command you used. So, when you say your ran the XDM command using:

xdm_bdl -s hspice -d xyc2/ -o xyce --auto dummy.spi

then the output should be in the directory xyc2. Your netlists should then refer to the files in that directory then.

Manoj Maskey

unread,
Sep 10, 2021, 2:05:00 PM9/10/21
to xyce-users

This is a follow up question regarding the issue mentioned by Hassan (from  Jan 15, 2021, 7:17:40 AM ) :
" Now, I am still facing one more error:
Netlist error in file l28hlp_mm_v101_e.lib at or near line 142553
 Model is required for device M1 and no valid model card found.
Simulation aborted due to error.  There are 0 MSG_FATAL errors and 1 MSG_ERROR

I am guessing this is related to the simulator unable to find the proper model card for the length/width limits, right? I am going to keep on debugging, but I was wondering whether this rings a bell or not.
"
I did not see this issue addressed. 

Regards,
Manoj

xyce-users

unread,
Sep 10, 2021, 3:25:22 PM9/10/21
to xyce-users
The "No valid model card found" is a fairly generic error message that simply means that Xyce was unable to resolve the model referenced on the instance line. 

There are many reasons this might happen, and it is impossible to tell what the reason is without seeing the entire netlist.  Unfortunately, the way the netlist parser is written and the way instance lines are scanned for a model name obscures the specific reason "no valid model" might be tripped.  A series of different checks are made to try to find a model, and by the time we hit the spot where an error message can be emitted, all we know is that all the attempts failed.  Hence, the only thing we can say is that we didn't find a valid model.

Without going into detail about the difficulty SPICE MOSFET instance lines present to a netlist parser, it is hard to explain all the reasons why this error might be thrown.  But here are a number of reasons Xyce might say that it can't find a valid model card.  It is NOT exhaustive.

  - No model card with a matching name of the correct type is found (for an M device, that means a model card of type NMOS or PMOS), or a model card with the right name is found but it has the wrong type for the device
  - A set of binned model cards with an appropriate name is found, but the length/width cannot be matched with any of the binned models
  - A model card with a matching name and the correct type is found but has an unrecognized level number (making it an invalid model card)
  - A model card with a matching name is found, but the number of nodes on the instance line is wrong for the level requested (e.g. only three nodes specified for a mosfet model that requires a minimum of four nodes, or 7 nodes are specified for a model that can take only a maximum of 4 nodes). 

The only way to diagnose what is actually wrong in the netlist is to look at the mosfet that Xyce says has no valid card, then try to determine what card is *supposed* to be found and make sure that it is actually something that is valid for the instance as specified.  The list above contains the most common reasons for the search to have failed.

Manoj Maskey

unread,
Sep 16, 2021, 10:20:41 PM9/16/21
to xyce-users
Now I am seeing the following error in the model card with Xyce simulation:

Netlist error: Unable to resolve parameter DELETA0 found in .PARAM statement
Parameter ETA0 for model
 XTOP:XXBUF_ALOC_X0_Y0/XSTAGE1/MM1:N_1P05_HLPRVT_LPLUS_MAIN.76 contains
 unrecognized symbols: 1.2792736e+000+deta0_n_1p05_hlprvt+deleta0
*** Xyce Abort ***

where ETA0 is defined in the model as:
+ ETA0='1.2792736e+000+deta0_n_1p05_hlprvt+deleta0' ETAB=4.1818333e-001 

and in the subckt:
.PARAM
+ DELETA0='deta0_pp+deta0_pp2+deta0_pp3+deta0_pp4+deta0_pp5+dketa0+deta0xa+deta0xb+deta0ya+deta0yb+deta0yb+deta0_ds+deta0_ds_y+deta0_ds_fb+deta0_ds_y_fb'

.PARAM
+ DETA0_N_1P05_HLPRVT='((global_flag_n_1p05_hlprvt*deta0_n_1p05_hlprvt_g  + local_flag_n_1p05_hlprvt*deta0_n_1p05_hlprvt_l))*(1-0*total_flag_n_1p05_hlprvt)+ total_flag_n_1p05_hlprvt*deta0_n_1p05_hlprvt_t'
Reply all
Reply to author
Forward
0 new messages