How to output data accompanied by a data valid signal
version
1.1.0
scope
Example.
This code is provided as example code for a user to base their code on.
description
How to output data accompanied by a data valid signal
boards
Unless otherwise specified, this example runs on the SliceKIT Core Board, but can easily be run on any XMOS device by using a different XN file.
A clocked port can generate a ready-out strobe signal whenever data is output. The program below causes an output port to drive a data valid signal whenever data is driven on a 4-bit port.
The following statement configures the output port outP to drive the port outR high whenever data is output. The ready-out port must be 1-bit wide.
configure_out_port_strobed_master(outP, outR, clk, 0);
The port drives two 4-bit values over two clock periods, raising the ready-out signal during this time.
outP <: 0x85;
It is also possible to implement control flow algorithms that output data using a ready-in strobe signal and that input data using a ready-out strobe signal; when both signals are configured, the port implements a symmetric strobe protocol that uses a clock to handshake the communication i of the data