Cdc count up tester (cdc_count_up_tester)
cdc_count_up_tester is an asset in the ocpi.assets.misc_comps component library. Implementations include cdc_count_up_tester HDL Worker (cdc_count_up_tester.hdl). Tested platforms include xsim, zed.
Design
The cdc_count_up_tester worker serves as a testbench for the count_up cdc primitive. The count_up primitive takes in a pulse from the source domain, synchronizes it to the destination domain, and uses that synchronized pulse to increment a counter. The count of pulses is sent to the worker’s output port.
The cdc count up tester worker uses the clock from the Control Plane as input to the clock generator. The output of the clock generator is used to drive the output port clock.
A block diagram representation of the implementation is given in Figure 148:
Figure 148: cdc_count_up_tester block diagram.
Interface
<ComponentSpec>
<Property Name="src_clk_hz" Type="float"
Parameter="true"
Default="100000000.0"
Description="Source clock frequency"/>
<Property Name="dst_clk_hz" Type="float"
Parameter="true"
Default="100000000.0"
Description="Destination clock frequency"/>
<Property Name="num_input_samples" Type="uchar"
Parameter="true"
Default="15"
Description="Number of input samples sent."/>
<Port Name="out" Producer="true"/>
</ComponentSpec>
Properties
src_clk_hz: Source clock frequency.Type:
floatAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
False
Default value:
100000000.0
dst_clk_hz: Destination clock frequency.Type:
floatAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
False
Default value:
100000000.0
num_input_samples: Number of input samples sent.Type:
ucharAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
False
Default value:
15
Ports
Inputs:
None.
Outputs:
outProtocol:
NoneOptional:
False
Implementations
cdc_count_up_tester(HDL)
Dependencies
The dependencies to other elements in OpenCPI are:
assets/components/misc_comps/cdc_count_up_tester.hdl/cdc_count_up_tester.vhd
core/hdl/primitives/cdc/count_up.vhd
core/hdl/primitives/cdc/cdc_pkg.vhd
Limitations
Limitations of cdc_count_up_tester are:
None.
Testing
There are files used to validate the data the cdc_count_up_tester worker sends. The files used in the verification were created from the output of the unit test when running the unit test in simulation and contain the expected output data when there is no metastability. Since there might or might not be a perfect match of the output data to the expected output data when running the tests in hardware due to metastability or phase offset, the output data is correlated with the expected output data. If there is at least a 0.7 positive Pearson product-moment correlation coefficient, then test case is considered passing. This correlation is only used when running the unit test on hardware. If the test are run in simulation, the output data is compared with expected output data. If they match exactly, then test case is considered passing.