Main Content

Pixel Control Bus

Vision HDL Toolbox™ blocks use a nonvirtual bus data type, pixelcontrol, for control signals associated with serial pixel data. The bus contains 5 boolean signals indicating the validity of a pixel and its location within a frame. You can easily connect the data and control output of one block to the input of another, because Vision HDL Toolbox blocks use this bus for input and output. To convert an image into a pixel stream and a pixelcontrol bus, use the Frame to Pixels block.

SignalDescriptionData Type
hStarttrue for the first pixel in a horizontal line of a frameboolean
hEndtrue for the last pixel in a horizontal line of a frameboolean
vStarttrue for the first pixel in the first (top) line of a frameboolean
vEndtrue for the last pixel in the last (bottom) line of a frameboolean
validtrue for any valid pixelboolean

For multipixel streaming, each vector of pixel values has one set of control signals. Because the vector has only one valid signal, the pixels in the vector must be either all valid or all invalid. The hStart and vStart signals apply to the pixel with the lowest index in the vector. The hEnd and vEnd signals apply to the pixel with the highest index in the vector.

Troubleshooting:

When you generate HDL code from a Simulink® model that uses this bus, you may need to declare an instance of pixelcontrol bus in the base workspace. If you encounter the error Cannot resolve variable 'pixelcontrol' when you generate HDL code in Simulink, use the pixelcontrolbus function to create an instance of the bus type. Then try generating HDL code again.

To avoid this issue, the Vision HDL Toolbox model template includes this line in the InitFcn callback.

evalin('base','pixelcontrolbus')

See Also

| |

Related Topics