|
FPGA Channels |
Top Previous Next |
|
Diamond organizes components on an FPGA as tasks; your blocks of logic are built as tasks and so are the FPGA's devices. These tasks have input and output ports that can be connected with channels in the usual way, and, just like all other tasks in Diamond, you can give them as many input and output ports as you choose, but if you give a task no ports at all, it will not be able to communicate with other tasks.
A channel's unidirectional data transfer is achieved using two buses, X and Y, which carry signals in opposite directions between the communicating tasks. Each task always sees the signals of the channels it can access as being synchronous to its own clock. Diamond arranges for this to be true even if you should use a channel to connect tasks that have different clocks. Clocks are discussed later.
The transmitting task drives the X bus to send data to the receiver using these signals:
The receiving task drives the Y bus's only signal, Ready, to tell the sender whether it is ready or not to receive data. A transmitter must wait until the receiver's ready signal is asserted before it asserts Write:
These two busses are defined by VHDL types, declared in the package file chan_pkg.
type X_chan_t is record data : std_logic_vector (63 downto 0); write : std_logic; validwords : std_logic_vector (1 downto 0); end record
type Y_chan_t is record ready : std_logic; end record
This package file has been compiled in the library diamond. You include it in your task as follows:
library diamond; use diamond.chan_pkg.all; |