Menu

MIF-ERROR - unable to find definition of model

fiveight
2023-01-26
2023-01-27
  • fiveight

    fiveight - 2023-01-26

    Hi All!
    I have a cir file like this:

    .title test Circuit
    
    xU1 QNETU1_1 QNETU1_2 QNETU1_3 QNETU1_4 QNETU1_5 LM358_SUBCKT
    
    .subckt LM358_SUBCKT 1 2 3 4 5
    EGND 99 0 poly(2) (3,0) (4,0) 0 0.5 0.5
    FB    7 99 POLY(5) VB VC VE VLP VLN 0 15.91E6 -20E6 20E6 20E6 -20E6
    C1   11 12 5.544E-12
    C2    6  7 20.00E-12
    DC    5 53 DX
    DE   54  5 DX
    DLP  90 91 DX
    DLN  92 90 DX
    DP    4  3 DX
    GA    6  0 11 12 125.7E-6
    GCM   0  6 10 99 7.067E-9
    IEE   3 10 DC 10.04E-6
    HLIM 90  0 VLIM 1K
    Q1   11  2 13 QX
    Q2   12  1 14 QX
    R2    6  9 100.0E3
    RC1   4 11 7.957E3
    RC2   4 12 7.957E3
    RE1  13 10 2.773E3
    RE2  14 10 2.773E3
    REE  10 99 19.92E6
    RO1   8  5 50
    RO2   7 99 50
    RP    3  4 30.31E3
    VB    9  0 DC 0
    VC 3 53 DC 2.100
    VE   54  4 DC 0.6
    VLIM  7  8 DC 0
    VLP  91  0 DC 40
    VLN   0 92 DC 40
    .MODEL DX D(IS=800.0E-18)
    .MODEL QX PNP(IS=800.0E-18 BF=250)
    .ends LM358_SUBCKT
    
    .tran 1m 10m
    
    .end
    

    When I run this with ngspice, I get error:

    Error on line 0 or its substitute:
      a$poly$e.xu1.egnd %vd [ qnetu1_3 0 qnetu1_4 0 ] %vd ( xu1.99 0 ) a$poly$e.xu1.egnd
     MIF-ERROR - unable to find definition of model a$poly$e.xu1.egnd
        Simulation interrupted due to error!
    

    I am using ngspice-37 with win10 64bit. Is there any bug when POLY used in subckt?
    Thanks!

     
  • Holger Vogt

    Holger Vogt - 2023-01-26

    This is typically caused by an ngspice installation problem. Where did you get ngspice? How did you install it?

    The best method is to download the package (https://sourceforge.net/projects/ngspice/files/ng-spice-rework/38/ngspice-38_64.zip/download), expand it and store it (completely, without removing anything) to C:.

     
  • Clyde

    Clyde - 2023-01-26

    With NGSPICE-33 Windows it loads and runs, but it is not very useful as the subcircuit has no stimulation nor supporting circutry which I can see.

     
  • fiveight

    fiveight - 2023-01-27

    I have fixed this.
    I built the executable file from source by myself. And I changed SIMinfo's simulator name. So I meet this problem. After I change SIMinfo's simulator name to its origin string, I fix this.
    But I can't understand, why this problem has to do with SIMinfo's simulator name. I think Cir file parse process should not couple with simulator name.
    Thanks!

     
    • Clyde

      Clyde - 2023-01-27

      Lose SIMinfo. Run from a terminal window like everyone else.

       
  • Holger Vogt

    Holger Vogt - 2023-01-27

    In your case the XSPICE code models are missing. This has nothing to do with the parse process (except for that the models are needed but are not found).

    XSPICE code models are loaded into ngspice by commands given in file spinit.

    In file spinit, a flag is set when the simulator name is 'ngspice'. Only then the code models are loaded. If the name was 'nutmeg' or others, no code models are needed, so the 'codemodel' commands are skipped.

    In ngspice-39 this will change (due to other reasons).

     
    • fiveight

      fiveight - 2023-01-27

      I get it. Thank you!

       

Log in to post a comment.