Section B.4. Data Transmission

B.4. Data Transmission

After initializing the serial connection, it is possible to send data. As mentioned previously, up to 13 of the 16 bits can be used for data transmission. The lower bits were arbitrarily chosen for this purpose, while the high bits are used for flags. The data width can be specified during instantiation by means of a VHDL generic. The diagram shown in Figure B-3 illustrates the packet sent to the serializer.

Figure B-3. Serializer/deserializer data packet.

A feedback mechanism is implemented to stop the remote sender from sending data if the local FIFO is too full. If the local FIFO is too full, the "FIFO too full" flag is set in the outgoing packet. The remote transceiver then reads this flag and stops sending data. This process works in both directions because the serial links are bidirectional. The "Write Enable" and "End of Stream" flags are associated with the data in the corresponding packet. These flags let the receiver know if the data is valid and if the stream is finished.

The interface to this VHDL stream is identical to the standard Impulse C stream with the addition of a hardware transceiver interface. The VHDL stream must be instantiated for each hardware transceiver that is to be used for an Impulse C stream. Each stream has an interface for a producer and for a consumer. The data sent to the producer port appears on the consumer port of the remote stream instantiation, and vice versa. Figure B-4 illustrates a typical stream setup.

Figure B-4. Serializer/deserializer-to-Impulse C stream connections.

Future Refinements

Note that the stream implementation described here can only be used for data widths up to 13 bits. If it is necessary to send data consisting of more than 13 bits, the data can first be broken down into smaller portions directly in the Impulse C program, and the pieces can be sent sequentially. A drawback of this implementation is that, depending on the word size, several of the bits sent across the serial link may never contain any data, which reduces potential bandwidth. If a more sophisticated method were used to send the data, such as consecutively sending several 16-bit data words followed by 16 bits of flags, higher data throughput could be achieved.

    Practical FPGA Programming in C
    Practical FPGA Programming in C
    ISBN: 0131543180
    EAN: 2147483647
    Year: 2005
    Pages: 208

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: