10.06.2016 Views

eldo_user

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Eldo Control Language<br />

Extended Simulation Functions<br />

_simu_set_cond<br />

Task function category: Simulation Flow-Control Functions<br />

Sets a stop condition.<br />

Usage<br />

_simu_set_cond("condition")<br />

Arguments<br />

• "condition"<br />

Stop condition.<br />

Description<br />

The condition can refer to the simulation time value (time), the real time (elapsed_s, elapsed_n,<br />

elapsed_h), the simulation progress (progress), voltages or currents and labels of extracts using<br />

the transient extraction language (but the corresponding .PLOT commands must have been<br />

specified in the netlist and the extract label must be enclosed inside the meas function).<br />

Examples<br />

Notes:<br />

_simu_set_cond("v(2) > 1.5")<br />

_simu_set_cond("(time > 500n) || (elapsed_m >= 20)")<br />

/* If a '.extract tran label=cross1 tcross(v(2),vth=1)' is contained in<br />

the netlist:*/<br />

_simu_set_cond("meas(cross1) > 0")<br />

• Only one condition can be active at a time. A call to _simu_set_cond will delete the<br />

previous conditions. However, multiple conditions can be combined into one condition<br />

using the boolean operators || and &&.<br />

• If you want to use more complex expressions, it is advised to add parentheses around the<br />

different parts composing the expressions. Most of the time, it will help prevent syntax<br />

errors.<br />

The result structure returned by the _simu_run function has a field named simu_stop. It can be<br />

used to know if the simulation has stopped because the condition set with the _simu_set_cond<br />

function has been met or if it has stopped because the simulation has ended without reaching the<br />

condition. If the condition is met, then the _simu_stop attribute will be set to 1. If the simulation<br />

has ended, it is set to -1. If the simulation stopped because of the mode attribute of the<br />

_simu_run function (for example if mode="for 2n" and that the simulator completed the<br />

simulation of this time period), then it is set to 0.<br />

Example:<br />

1036<br />

Eldo® User's Manual, 15.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!