<< Click to Display Table of Contents >> Using 'ASH PRINT' to Create Formatted Log Files |
Click here to download this example
The ASH WARE eTPU simulator detects print statements that are embedded as comments in your code. Whenever the code is traversed, the simulation is paused and the print statement is used by the simulator to inject formatted symbolic text in the trace window. The trace window's buffer can be streamed to an external file.
For example, say you would like to monitor the calculations in the following file.
int MyAshPrintFunc(int24 A, int24 B, int24 C)
{
if( hsr==7 )
{
C=F(A,B,C);
// @ASH@print_to_trace("A=%d, B=%d, C=%d", A, B, C);
Every time the above code is traversed by the eTPU the text similar to the following appears in the trace window.
A=5, B=7, C=12
The trace window can be streamed to an external file using the following script commands.
start_trace_stream("Record.Trace", PRINT, VIEWABLE, US, 3, 1);
At the end of a simulation run, the following script command causes the trace file, Record.Trace, to be closed
end_trace_stream();