Error: Unknown model type filesource - ignore

Help
Daniel
2012-07-02
2013-06-12
  • Daniel
    Daniel
    2012-07-02

    Hi,

    I'm looking at the user manual for the filesource analog model and I'm trying to learn how to use it given the example syntax provided and I get this error:

    Error on line 2 : v1 %v([n1 n0]) filesrc
     unknown parameter (filesrc) 
    Model issue on line 3 : .model filesrc filesource (file= sine.m  amploffset=[0 0 ...
    Unknown model type filesource - ignored
    

    This is my code

    * testing
    V1 %v([n1 n0]) filesrc
    .model filesrc filesource (file="sine.m" amploffset=[0 0] amplscale=[1 1]
    +              timeoffset=0 timescale=1
    +              timerelative=false amplstep=false)
    R1 n1 n2 1k
    R2 n2 n0 50k
    *
    .end
    

    and the sine.m example file provide is the same except I took out the 3 column.
    So instead of having

    # columns 2, 3: values
    0 0 1
    3.90625e-09 0.02454122852291229 0.9996988186962042

    I have # columns 2: values
    0 1
    3.90625e-09 1.02454122852291229

    How exactly do I make this command work?
    Thanks

     
  • Holger Vogt
    Holger Vogt
    2012-07-02

    You intend to use the XSPICE filesource analog code model.
    XSPICE code model devices always start with letter A, so you may write
    AV1 %v() filesrc

    Regards

    Holger

     
  • Daniel
    Daniel
    2012-07-02

    Thanks, but I still get the same error

    Code:

    * Spice netlister for gnetlist
    *
    AV1 %v([n1 n0]) filesrc
    .model filesrc filesource (file="sine.m" amploffset=[0 0] amplscale=[1 1]
    +                         timeoffset=0       timescale=1
    +                         timerelative=false amplstep=false)
    *
    R1 n0 n1 7.234k
    C1 n1 0 0.22pF
    *
    *
    *
    .END
    

    Error message:

    Error on line 3 : av1 %v([n1 n0]) filesrc
     MIF-ERROR - unable to find definition of model filesrc
    Model issue on line 4 : .model filesrc filesource (file= sine.m  amploffset=[0 0 ...
    Unknown model type filesource - ignored
    
     
  • Holger Vogt
    Holger Vogt
    2012-07-03

    No, it is a different error message:
    MIF-ERROR - unable to find definition of model filesrc
    tells us that there is no code model for filesrc available, model type filesource is missing.

    Do you have ngspice (including XSPICE) installed properly?
    Which ngspice version are you using? filesesource is available since ngspice 24.

    Holger

     
  • marcel hendrix
    marcel hendrix
    2012-07-03

    > av1 %v() filesrc

    Note that not all XSPICE's fancy parameter specification possibilities work yet. In a previous forum message I have made a list of what worked and what not (at that point in time). Specifically, "%v()" may be unrecognized - try something more straightforward? (Sorry, I don't have details available on the machine I type this reply with).

    -marcel

     
  • Daniel
    Daniel
    2012-07-03

    @h_vogt

    I downloaded the source yesterday and set up the config to include the xspice with "-enable-xspice".
    I'll uninstall it and rebuild/install it again just to be sure.

     
  • Daniel
    Daniel
    2012-07-03

    ./configure -enable-xspice -with-readline -prefix=/home/shaboinkin/newNG

    That's my config and it ran without any issues.
    I removed my old ngspice and ran the make and make install and I still get the same error.

    @mhx_at_sf
    I tried

    AV1 n1 n0 filesrc
    AV1 %v(n1 n0) filesrc

    and neither one worked. Am I just out of luck with this function?

     
  • Daniel
    Daniel
    2012-07-03

    OK, not entirely sure what I did differently. But I once again, removed ngspice, configured it again, and ran the code, and it worked.
    From what I can tell, it didn't build correctly before. I noticed "exit" didn't close the program but "quit" did. And pressing the up arrow didn't go through my history of commands like how you normally would in the terminal. Not too sure where the problem happened at, but it works now.

     
  • Daniel
    Daniel
    2012-07-05

    Have one more question.

    I'm able to read in my file with no problem. Only thing is I only have 1 signal in the file. Is it possible to have multiple signals in one file and have spice tell 1 signal from another? Or is it only able to read in 1 signal per file at a time?

     
  • Holger Vogt
    Holger Vogt
    2012-07-07

    The example given in the actual distribution
    ngspice/examples/xspice/fstest.sp
    does show two signals read in differentially (so you need 4 ports).

    Of course you have to have the same time base for the two signals.

    Holger

     
  • Daniel
    Daniel
    2012-07-09

    Sorry, I don't think I worded my question right.
    If I have a file with thousands of signals in it, can I read them in sequentially?

     
  • Holger Vogt
    Holger Vogt
    2012-07-09

    To be honest, I still do not understand what you intend to do. Please give an example!

    Filesource allows to enter signals (for example streams of real values as voltage versus time). These value-time pairs then may be used as stimulus in a transient simulation. The file is read upon circuit initialization. For each time step the corresponding signal value is read in and used as input  at the defined node for the simulation. More than one signal value may be entered for each time step. Values between time steps are interpolated.

    If this is not what you need, please give an example with more details of what you intend to do.

    Holger

     
  • Daniel
    Daniel
    2012-07-11

    I have a file with thousands of different signals in 0.1us intervals, all one after the other. I was just hoping that ngspice had the capability that if I pass in this file, it could possible tell the difference between the first thousand points of 1 signal the the next thousand points of my second signal.
    But it's no worries now. I just wrote up a program that splits up my original file into separate files and I pass them in one by one and combine all of the signals from spice into another file.

    Thanks for all the help though.