Menu

#283 Message invoked if netname same as result variable name in meas statement

v1.0 (example)
closed-wont-fix
nobody
None
5
2018-11-04
2014-05-15
No

I am seeing a warning(?) message when running a transient simulation using an 'meas' statement.

The message seems to be invoked if I use the same name for a 'meas' statement result variable as a net name that exists in the netlist.

Whilst this appears to have no effect on the result, it is confusing for the user.

To demonstrate, running this sim:


  • strange message when measuring RMS

V1 FOO GND SIN(0 1 1)

.control
tran 1m 1
meas TRAN foo AVG V(foo) from=0 to=1 ; invokes message
meas TRAN bar AVG V(foo) from=0 to=1 ; no message

quit
.endc

.END


gives the results:

No. of Data Rows : 10008
foo = 9.719015e-05 from= 0.000000e+00 to= 1.001120e+00
left-hand expression is too small (need 100160064)
bar = 9.719015e-05 from= 0.000000e+00 to= 1.001120e+00

Message for foo. No message for bar!

Discussion

  • Robert Larice

    Robert Larice - 2014-05-15

    ~~~~~
    :::html

    Hello,

    if you run
    tran ...
    display
    let foo = 42

    you will see:
    1) there is indeed already a vector named "foo"
    before you even start "meas"
    This vector has a length around 1008 (in your case)
    and stores the simulated voltage of circuit node "foo"
    2) Then when you run
    let foo = 42
    you will get a similar (somewhat buggy) message
    which basically tells that you are trying to overwrite
    a vector of certain length with a value of another length
    (scalar 42 in your case)

    The message is "somewhat buggy" because it tried to report the
    current length 1008, but instead reports the squared value of that.
    That's in com_let.c
    if (length > t->v_length) {
    fprintf(cp_err, "left-hand expression is too small (need %d)\n",
    length * cube);
    Since we support multi dimensional vectors too,
    its not that straight forward to decide whether we should replace
    length * cube with cube or with length or with even something else.

    finally "meas" internally invokes a "let foo = ..."
    and thus emits the reported message.

    Regards,
    Robert

     
    • Andy Fierman

      Andy Fierman - 2014-05-15

      Hi Robert,

      Many thanks for the explanation.

      Note to self: never use netnames as variable names!

      :)

      Cheers,

           Andy.
      

      signality.co.uk

       
  • Holger Vogt

    Holger Vogt - 2018-11-04
    • status: open --> closed-wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB