Section 5.5. Application Monitoring


5.5. Application Monitoring

One 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 Windows

Log 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:

1.

Call the cosim_logwindow_init function from within the configuration function of your application. (It is only necessary to call this function once, no matter how many log windows you will be creating.)

2.

From within a process run function, declare a variable of type cosim_logwindow.

3.

Create and name the log window using cosim_logwindow_create. Assign the return value of cosim_logwindow_create to the variable declared in step 2.

4.

Write to the window any time after creating it by using cosim_logwindow_write or cosim_logwindow_fwrite.

5.

Prior to executing the application in a desktop simulation environment (either as a stand-alone application or under the control of a debugger), launch the application monitor program.

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.




    Practical FPGA Programming in C
    Practical FPGA Programming in C
    ISBN: 0131543180
    EAN: 2147483647
    Year: 2005
    Pages: 208

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net