x310_gpio HDL Worker
x310_gpio implements interaction with the 12 front-panel GPIOs. It was adapted from the OpenCPI GPI and GPO workers.
Detail
Worker Properties
pin_stateType:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
USE_DEBOUNCEType:
boolAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
CLK_RATE_HZType:
doubleAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
DEBOUNCE_TIME_PSECType:
doubleAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
EDGE_MODEType:
boolAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
RISINGType:
boolAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
USE_TOGGLEType:
boolAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
EVENT_MODEType:
boolAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
gpi_dataType:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
direction_mask_dataType:
ulongAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
FalseRead back:
False
Default value:
0
gpo_mask_enableType:
ucharAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
FalseRead back:
False
Default value:
3
gpo_mask_dataType:
ulongAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
FalseRead back:
False
Default value:
0
ocpi_buffer_size_outType:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
TrueVolatile:
FalseRead back:
False
Default value:
0
ocpi_blocked_outType:
ulongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
ocpi_max_latency_outType:
ushortAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
ocpi_latency_outType:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
ocpi_messages_outType:
ulongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
ocpi_bytes_outType:
ulongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
Worker Ports
dirProtocol:
gpioOptional:
True
inProtocol:
gpioOptional:
True
outProtocol:
gpioOptional:
True
Inputs:
Outputs:
Worker Signals
gpio_pinDirection:
inoutWidth:
12Differential:
falsePin:
true
The direction of each pin is controlled with the direction_mask_data property or the dir port. GPI data is read from the gpi_data property or the out port. GPO data can be sent to the gpo_mask_data property or the in port.
Refer to the OWD XML file for details on the terms ‘mask’ and ‘data’ and how to use each port and property. In brief, the ‘mask’ value specifies which ‘data’ bits are to be changed. The following example, in the context of the GP input, means that bits 2-3 have changed from 0 to 1:
Bit: 12 8 4 0
Mask: 0000 0000 0000 1100
Data: 0000 0000 1100 1100
Although 16 bit data-types are used for mask and data fields only the lower 12 bits are used, corresponding to the 12 front-panel GPIOs on the X310.
Stumbling Blocks
It is worth noting a few potential stumbling blocks:
The GPI
outport will drop messages if it runs out of OCPI-provided buffers. This may result in missing updates at the application layer. A simple solution is to increase the number of buffers using thebuffercountandbuffersizeattributes documented in the Application Development Guide. It is recommended to increase this value from the default of2because GPI changes are often presented in multiple messages in quick succession.Changes to the output pins from a single port message/property write will not necessarily be affected in the same FPGA clock cycle. Likewise concurrent changes to the input pins will not necessarily be represented in the same port message/property read.
If a port and property set an output (or direction) on the same cycle but to opposite values, the value used is
1rather than0.
Changes
Changes in the VHDL with respect to the original OpenCPI GPI and GPO workers are as follows:
The 16 bits of mask were removed from the GPI property. These bits represented the change in GPI data between consecutive FPGA clock cycles and so were rarely anything but 0 because properties are read at a much lower rate.
The use of
gpo_mask_dataanddirection_mask_dataproperties are gated on the OCPI-provided_writtenstrobe. This means that each property does not interfere with subsequent messages from the corresponding ports.
Utilization
Utilization reporting is not currently implemented.