FIR System
/*
This file passes the FIR filter over a stream of data and sends the
results to an output stream.
Be sure to compile this code with ROCCC only after you have compiled
the example in the FIR directory.
*/
#include "roccc-library.h"
void FIRSystem(int* A, int* B)
{
int i ;
int myTmp ;
for(i = 0 ; i < 100 ; ++i)
{
FIR(A[i], A[i+1], A[i+2], A[i+3], A[i+4], myTmp) ;
B[i] = myTmp ;
}
}
Description
The code above shows how to use the FIR module in system code. All available modules are shown the IPCores view after compiling them. The parameter order of the module call may have values in different orders than originally declared. Double clicking the desired module in the IPCores view will place the module skeleton call with the ports in the correct order that they should be called. This function will instantiate a hardware component in the resulting pipeline, integrating it tightly with the rest of the system.
System code also supports loops and arrays as shown. Through dependence analysis and various compiler transformations, all arrays are identified as either FIFOs or smart buffers. Smart buffers are used when there is reuse between iterations of the loop. In the above code, A is recognized as a smart buffer and B is recognized as an output FIFO.