I'm having trouble using the SB_RGBA_DRV primitive provided for the Lattice ICE40UP fpga. The Technology Library provides a verilog example which I got to work but when i try using it in VHDL the P&R fails, outputting the following message:
Error: Illegal Connection: Pin 'RGB2' of instance 'myrgb' of type 'SB_RGBA_DRV' should be connected to only one top module port. It is connected to the following terminals : LED2_obuf/DOUT0
This is my .vhdl file:
library ieee;
use ieee.std_logic_1164.all;
entity led is
port (
LED0 : out std_logic;
LED1 : out std_logic;
LED2 : out std_logic
);
end entity led;
architecture rtl of led is
component SB_HFOSC is
port (
CLKHFEN : in std_logic;
CLKHFPU : in std_logic;
CLKHF : out std_logic
);
end component;
component SB_RGBA_DRV is
generic (
RGB0_CURRENT: string:="0b000000";
RGB1_CURRENT: string:="0b000000";
RGB2_CURRENT: string:="0b000000"
);
port (
RGBPU : in std_logic;
RGBLEDEN : in std_logic;
RGB0PWM : in std_logic;
RGB1PWM : in std_logic;
RGB2PWM : in std_logic;
RGB0 : out std_logic;
RGB1 : out std_logic;
RGB2 : out std_logic
);
end component;
signal int_osc : std_logic;
begin
myosc : SB_HFOSC
PORT MAP (
CLKHFEN => '1',
CLKHFPU => '1',
CLKHF => int_osc
);
myrgb : SB_RGBA_DRV
GENERIC MAP (
RGB0_CURRENT => "0b111111",
RGB1_CURRENT => "0b111111",
RGB2_CURRENT => "0b111111"
)
PORT MAP (
RGBPU => '1',
RGBLEDEN => '1',
RGB0PWM => '1',
RGB1PWM => '1',
RGB2PWM => '1',
RGB0 => LED0,
RGB1 => LED1,
RGB2 => LED2
);
process
begin
wait until int_osc'event;
end process;
end rtl;