This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

syntax difficulties

Other Parts Discussed in Thread: TINA-TI

I'm trying to use the new macro wizard to import a spice model from a device manufacturer.  

The spice model is for a CMF20120D, which is an NMOSe.  The .lib is attached.  7418.Cree_Z-FET_Models_Rev0p3.lib

The first syntax problem I was able to fix by replacing "=af1" with "={af1}".  That gets me a bit further along.  Now however, I get the following error:

Undefined parameter or possible use of function before Definition: AF.

  • Matt,

    The parameter AF is NOT being passed to the gmos and cdgmos subcircuits. Please add params: af=1 to both of the .subckt lines where gmos and cdgmos are defined. Also add the {} to all instances where af is being assigned to af1.

    Britt

  • Matt,

    I found another problem. The Log natural function is LOG in PSpice, not LN. Once this is changed, the model will import correctly. Please see the attached .lib file for all of the corrections.

    Britt

    6177.cree_question.lib

  • Thanks Britt.  

    The model imported fine. 

    Just to double check, about adding af=1 to the gmos subckt.  The higher level subckt that instantiates an xgmos will overwrite this value?  The 20120 subckt for example passes in an af=2, which I assume will overwrite the default af=1.

    Also, I did a bit of searching of the forums, and the TINA-non-TI website to find a summary of differences between TINA spice and PSpice.  The best I could find was a post by Marcos:http://e2e.ti.com/support/development_tools/webench_design_center/f/234/t/105399.aspx 

    Though quite useful, it doesn't include some of the points you mentioned here.  Do you know of other resources that will help me import devices?

    Thanks,
    Matt 

  • Matt,

    Yes, the default value in the .subckt statement will be overwritten by the value passed in the subckt placement. The reason to add a default is to avoid the issue if the user forgets to pass a value for af, or wants to use the default. Quite honestly, if the model is a PSpice model (not a spice model that runs in some kind of Spice...), TINA-TI will import it properly. There are so many differences between the different flavors of Spice, it would be difficult to describe them all. I've been using different Spice simulators for over 20 years now and I still don't have all of the differences captured.

    What I look for is problems I have seen previously (changing ^ to ** for the power function, removing special characters from the node/pin names, parameter passing {}, function definitions or names, syntax issues, etc.) but that is only a few items that I have seen. Each simulator seems to have its own list of quirks. In the case of TINA-TI, I have not seen a PSpice model that it would not import unless it had a unsupported model for a MOSFET or bipolar device (such as BSIM3v2 Level=6 in PSpice).

    Marcos' summary is pretty good. Please remember that the ln ---> log change is a PSpice requirement, not a TINA requirement, as are the parameter definitions. The model you posted would not have worked in PSpice as far as I can tell. PSpice can be very tolerant of issues (like having PARAMS: PARAMS: on the subcircuit line and not complaining while other simulators will choke on this...) however.

    Britt

  • I am having similar issues with a slightly different part.   TINA was upset about the AF parameter, but then also about the ** exponential.  Now the error dialog is the same as the one in my original post.

    Here's the original file from CREE:

    2402.C2M0025120D - Die.lib

    This is my attempt to get it to work in TINA.  

    0456.C2M0025120D - Die - modified.lib