6994 - Lattice Radiant: How do I use the RGB pins on iCE40UltraPlus as GPIO?
The SB_IO_OD primitive is only available for the iCECube2 SW, you will have to use BB_OD as this is the equivalent primitive for the opendrain buffer in Radiant. Note that for Radiant, BB_OD is automatically mapped in the netlist/design whenever you use the opendrain pins of the device (39, 40, 41), which makes these pins function as an ordinary GPIO.
1) Whenever we add the RGB primitive in our design, it is guaranteed that the tool will utilize the OB_RGB (this buffer is used when RGB Function is used):
1.1) Using Port X for RGB primitive causes the 2 other outputs (y and z) to be used as RGB pin functions instead of GPIO pins (as shown it uses the OB for RGB).
1.2) Also, if we use the RGB_TO_GPIO attribute in the design, and use either of the pins as RGB, it will still use the OB_RGB buffer and will result as below:
2) Whenever the RGB Primitive is not used, and the user locates the signals to Opendrain pins (39, 40, 41) manually through DCE, the tool will automatically use the pins as GPIO.
The attribute tells the Synthesis tool that during synthesis, the stated pin should use the stated pins as GPIO instead of as RGB function, this can also be verified in the .vm file.
Setting the pin in DCE.
When an I/O port is manually located to one of the RGB pins by the user and the RGB primitive is not used for the port signal, the software can automatically configure the port as a GPIO without using this attribute.
Testing on Hardware (configuring the pins as CLK):
