How to output data accompanied by a data valid signal

  • version

    1.1.1

  • 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 readyOut 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 readyOut 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 readyOut signal during this time.

outP <: 0x85;

It is also possible to implement control flow algorithms that output data using a readyIn strobe signal and input data using a readyOut strobe signal; when both signals are configured, the port implements a symmetric strobe protocol that uses a clock to handshake the communication of the data.