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.

UM-414 16 - C Debug<br />

Debugging functions when quitting simulation<br />

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

Stop on quit mode allows you to debug functions that are called when the simulator exits.<br />

Such functions include those referenced by an mti_AddQuitCB function in FLI code,<br />

misctf functions called by a quit or $finish in PLI code, or cbEndofSimulation functions<br />

called by a quit or $finish in VPI code.<br />

To enable Stop on quit mode, follow these steps:<br />

1 Start C Debug by selecting Tools > C Debug > Start C Debug.<br />

2 Select Tools > C Debug > C Debug Setup.<br />

3 Select Stop on quit in the C Debug setup dialog.<br />

With this mode enabled, if you have set a breakpoint in a quit callback function, C Debug<br />

will stop at the breakpoint after you issue the quit comm<strong>and</strong> in <strong>ModelSim</strong>. This allows you<br />

to step <strong>and</strong> examine the code in the quit callback function.<br />

Invoke run -continue when you are done looking at the C code.<br />

Note that whether or not a C breakpoint was hit, when you return to the VSIM> prompt,<br />

you’ll need to quit C Debug by selecting Tools > C Debug > Quit C Debug before finally<br />

quitting the simulation.

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

Saved successfully!

Ooh no, something went wrong!