ODB Sub-Package

The Simulation Debugger (ODB) provides an interactive environment for controlling and monitoring simulation activities. This environment is entered by running a simulation from the command shell, with the debug environment attribute enabled (full documentation on ODB appears in “Simulation Debugger (ODB)“ on page 39). ODB supports the definition of breakpoints which will halt a simulation, and traces which print diagnostic messages to the standard output device as the simulation progresses (messages relate to specific objects, packets, etc.). The power of ODB is enhanced by the set of KPs in the ODB sub-package of the Prg Package, which provide coordination “hooks” between process model logic and ODB commands.

The KP op_prg_odb_bkpt() defines the location of a labeled breakpoint in the midst of process model logic; such breakpoints are enabled by the ODB commands lstop (global labeled trace) and mlstop (module-specific labeled trace). When op_prg_odb_bkpt() is invoked with a label argument, it is compared to any enabled labeled breakpoints, and if a match is found, the breakpoint occurs.

ODB supports a variety of tracing features. Full tracing (activated by the ODB command fulltrace) prints diagnostic messages for every event and every KP which is invoked by process model logic. Module tracing (activated by the ODB command mtrace) generates event and KP diagnostic messages for a specific module. Packet tracing (activated by the ODB commands pktrace and pttrace) generates event and KP diagnostic messages for a specific packet. Labeled tracing (activated by the ODB commands ltrace or mltrace) is designed to interact with a ODB sub-package KP to trigger diagnostic messages.

The tracing-related KPs in the ODB sub-package are concerned with detecting whether a particular form of tracing is active in ODB, so that certain diagnostic messages or related actions can be conditional performed. The KP op_prg_odb_trace_active() detects if full tracing is active, or if a module trace is active for the surrounding module. The KP op_prg_odb_pktrace_active() detects if the specified packet is actively being traced. The KP op_prg_odb_ltrace_active() detects if a specific labeled trace is active. When any of these KPs detects that a trace is active, diagnostic messages can be generated in the standard ODB trace message format using the KPs op_prg_odb_print_major() and op_prg_odb_print_minor().

You can use op_prg_text_output() to print arbitrary strings during debugging.

The KPs in the ODB sub-package cause no overhead in optimized simulation kernels. Because there is no ODB support in optimized kernels, these KPs are not invoked.