Create the following diagram to simulate and test your CDL document in a host VI.
Select a CDL document to simulate with the Run GCDL Simulation node on the Item tab. The inputs and outputs that appear on the node correspond to the inputs and outputs of the CDL document you select.
If there are sampling probes in the CDL document that you select, you can view data for each sampling probe when you simulate using Run GCDL Simulation. To view data, use the Tool Launcher to open the Sampling Probes tab and set Sampling source to the FPGA to which you targeted the CDL document.
|The Run GCDL Simulation node simulates clock cycles on an FPGA. Because code on an FPGA often takes multiple clock cycles to produce valid data, you can use a While Loop around the Run GCDL Simulation node to ensure that the host VI runs until the CDL executes completely.|
|The For Loop repeats the code you want to test until all the test values you supply are consumed. The auto-indexing functionality of a For Loop allows the CDL document to access and process each individual element of an input array. You can then collect the result of each loop iteration with an auto-indexing output tunnel.|
|Provide test data that exercises all inputs and outputs of the CDL document and spans the range you expect the CDL document
to receive from the application.
The code in the diagram example above focuses on testing the data in input, a cluster, of the CDL document. Depending on your preference, you can test all inputs and outputs in a single host VI or you can test them across multiple VIs.
|Provide results you expect the CDL document to produce for the test data provided.|
|Compare the results of the data processed by the CDL document to the results you expect to determine if logic or other code in the CDL document needs to change.|
Search within the programming environment to access the following installed example: Sampling Probes
Search within the programming environment to access the following lesson: Programming with Clock-Driven Logic.