Menu

bug in V PULSE??

Sherif
2017-01-24
2017-01-24
  • Sherif

    Sherif - 2017-01-24

    I'm trying a very simple circuit below

    ** first line
    .param psup=3.3
    
    r1 vdd 0 10k
    vvsup vdd 0 PULSE(psup 0 100u 0.1u 0.1u 1 2) DC=0
    
    .tran 100n 10m
    

    this simulation throws the following error

    Circuit  ** first line
    
    Error on line 5 : vvsup vdd 0 pulse(psup 0 100u 0.1u 0.1u 1 2) DC=0
      no such parameter on this device
    
    ngspice stopped due to error, no simulation run!
    
    ERROR: fatal error in ngspice, exit(1)
    

    if I swap V1 and V2 of the pulse source such as

    vvsup vdd 0 PULSE(0 psup 100u 0.1u 0.1u 1 2) DC=0
    

    the simulation runs fine as expected, did anyone see that?

     
    • Holger Vogt

      Holger Vogt - 2017-01-24

      Please put single quotes around psup:

      vvsup vdd 0 PULSE('psup' 0 100u 0.1u 0.1u 1 2) DC=0

      Holger

       
    • marcel hendrix

      marcel hendrix - 2017-01-25

      Thank you for this observation, I found it very helpful because I'm
      working on such issues at the moment.

      The actual (software) root cause is not the position of the parameter
      in the list, but the absence of a space when not specifying the single
      quotes. Either one of the following works:

      vvsup vdd 0 PULSE( psup 0 100u 0.1u 0.1u 1 2) DC=0
      vvsup vdd 0 PULSE ( psup 0 100u 0.1u 0.1u 1 2) DC=0
      vvsup vdd 0 PULSE ( psup 0 100u 0.1u 0.1u 1 2 ) DC=0
      

      According to the syntax shown in the manual, the order of sources is first DC, then AC, then DISTOF1, then DISTOF2, then one of the 9 independent source functions (PULSE, EXPONENTIAL .. external data). Putting DC at the end of the list is unusual. Currently it happens to work in at least some cases, e.g. here.

      -marcel

       

      Last edit: marcel hendrix 2017-01-25
  • Sherif

    Sherif - 2017-01-26

    thanks for picking it up, when enclosed in quotes it works, when adding a leading space it also works

     

Log in to post a comment.