5.5. Application MonitoringOne aspect of the FIR filter software test bench that differs from the HelloFPGA example of the preceding chapter is the presence of application monitoring function calls, which are identified by the prefix cosim_. Application monitoring is a mechanism by which individual processes in an application may be selectively instrumented for the purpose of debugging. The cosim_ instrumentation functions are compatible with all supported desktop compiler environments. When included in your running Impulse C application, these functions communicate with the Impulse C application monitor to provide you with additional debugging capabilities that may be used in conjunction with standard desktop debugging environments. Why use monitoring functions? Standard C debuggers (such as the debugger provided with Visual Studio) are useful for examining control flow in an application and for examining values of variables within specific processes. For highly parallel applications, however (applications consisting of many, perhaps hundreds, of interrelated processes), it is useful as well to add debug-related instrumentation directly within the application source code. Software instrumentation can be used to analyze data dependencies, to dynamically view the contents of streams, and to better understand how an application and its component algorithms might be optimized by the application programmer. Monitoring with Log WindowsLog windows (which appear as child windows of the application monitor) are used to organize, format, and display messages and other information from within an executing Impulse C application. Any number of log windows may be created. To create and use a log window, do the following:
During the course of the simulation, the log windows you have defined will display useful information on the state of each input and output stream, as well as messages generated as a result of calls to cosim_logwindow_fwrite, as shown in Figure 5-7. Figure 5-7. The application monitor can be used to view process and stream information. |