24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The PLI callback reason argument<br />

The PLI callback reason argument UM-585<br />

The second argument to a PLI callback function is the reason argument. The values of the<br />

various reason constants are defined in the veriuser.h include file. See IEEE Std 1364 for a<br />

description of the reason constants. The following details relate to <strong>ModelSim</strong> Verilog, <strong>and</strong><br />

may not be obvious in the IEEE Std 1364. Specifically, the simulator passes the reason<br />

values to the misctf callback functions under the following circumstances:<br />

reason_endofcompile<br />

For the completion of loading the design.<br />

reason_finish<br />

For the execution of the $finish system task or the quit comm<strong>and</strong>.<br />

reason_startofsave<br />

For the start of execution of the checkpoint comm<strong>and</strong>, but before any of the simulation<br />

state has been saved. This allows the PLI application to prepare for the save, but it<br />

shouldn't save its data with calls to tf_write_save() until it is called with reason_save.<br />

reason_save<br />

For the execution of the checkpoint comm<strong>and</strong>. This is when the PLI application must<br />

save its state with calls to tf_write_save().<br />

reason_startofrestart<br />

For the start of execution of the restore comm<strong>and</strong>, but before any of the simulation state<br />

has been restored. This allows the PLI application to prepare for the restore, but it<br />

shouldn't restore its state with calls to tf_read_restart() until it is called with<br />

reason_restart. The reason_startofrestart value is passed only for a restore comm<strong>and</strong>, <strong>and</strong><br />

not in the case that the simulator is invoked with -restore.<br />

reason_restart<br />

For the execution of the restore comm<strong>and</strong>. This is when the PLI application must restore<br />

its state with calls to tf_read_restart().<br />

reason_reset<br />

For the execution of the restart comm<strong>and</strong>. This is when the PLI application should free<br />

its memory <strong>and</strong> reset its state. We recommend that all PLI applications reset their internal<br />

state during a restart as the shared library containing the PLI code might not be reloaded.<br />

(See the -keeploaded (CR-376) <strong>and</strong> -keeploadedrestart (CR-376) arguments to<br />

vsim for related information.)<br />

reason_endofreset<br />

For the completion of the restart comm<strong>and</strong>, after the simulation state has been reset but<br />

before the design has been reloaded.<br />

reason_interactive<br />

For the execution of the $stop system task or any other time the simulation is interrupted<br />

<strong>and</strong> waiting for user input.<br />

reason_scope<br />

For the execution of the environment comm<strong>and</strong> or selecting a scope in the structure<br />

window. Also for the call to acc_set_interactive_scope() if the callback_flag argument is<br />

non-zero.<br />

reason_paramvc<br />

For the change of value on the system task or function argument.<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

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

Saved successfully!

Ooh no, something went wrong!