Home > Support > NI Product Manuals > LabVIEW Communications System Design Suite 1.0 Manual
Testing individual Clock-Driven Logic (CDL) documents on the host allows you to ensure that you thoroughly test the functionality of the CDL code. When you deploy a CDL document to an FPGA, as a sub-document of an FPGA VI, it becomes part of the larger FPGA design and you can no loner isolate the CDL code for testing.

What to Use

What to Do

Create the following diagram to simulate your CDL document on the host.

Customize the gray sections for your unique programming goals.

Select a CDL document to simulate in the Run FPGA Simulation node in the Properties section of the Configure tab. The inputs and outputs that appear on the node correspond to the inputs and outputs of the CDL document you select.

The Run FPGA 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 FPGA Simulation node to ensure that the host VI runs until the CDL executes completely.
Note  

The complexity needed in the host VI varies depending upon the complexity of the CDL document you are testing. For example, if the CDL document uses handshaking or pipelining, you might need more complex code in the host VI to fully test the CDL document.

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.

Examples

Search LabVIEW for the following installed lessons: Programming with Clock-Driven Logic.