Visible to Intel only — GUID: cru1439932887752
Ixiasoft
Visible to Intel only — GUID: cru1439932887752
Ixiasoft
4.2. Building the CRC Example Software
Creating the Software Project
The downloadable design files include the software source files. The following table lists the CRC application software source files and their corresponding descriptions.
File Name | Description |
---|---|
crc_main.c | Main program that populates random test data, executes the CRC both in software and with the custom instruction, validates the output, and reports the processing time. |
crc.c | Software CRC algorithm run by the Nios II processor. |
crc.h | Header file for crc.c. |
ci_crc.c | Program that accesses CRC custom instruction. |
ci_crc.h | Header file for ci_crc.c. |
To run the application software, you must create an Executable and Linking Format File (.elf) first. To create the .elf file, follow the instructions in the "Nios II Software Build Flow" section in the readme_qsys.txt file in the extracted design files.
The application program runs three implementations of the CRC algorithm on the same pseudo-random input data: an unoptimized software implementation, an optimized software implementation, and the custom instruction CRC. The program calculates the processing time and throughput for each of the versions, to demonstrate the improved efficiency of a custom instruction compared to a software implementation.