How to input 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 input 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 interpret a ready-in strobe signal that determines the validity of the accompanying data. The example below inputs data from a clocked port only when a ready-in signal is high.
The following statement configures the input port inP to be sampled only when the value sampled on the port inReady equals 1. The ready-in port must be 1-bit wide.
configure_in_port_strobed_slave(inP, inReady, clk);
Data is sampled on the rising edge of the clock whenever the ready-in signal is high. The port samples two 4-bit values and combines them to produce a single 8-bit value for input by the processor.
inP :> void;