Search code examples
vhdlfpgalattice-diamond

Warning "has no load", but I can't see why


I got these warnings from Lattice Diamond for each instance of any uart (currently 11)

WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_14' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_0_COUT1_9_14' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_12' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_10' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_8' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_6' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_4' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_2' has no load
WARNING - ngdbuild: logical net 'UartGenerator_0_Uart_i/Uart/rxCounter_cry_0' has no load

The VHDL-code is

entity UART is 
    generic (
        dividerCounterBits: integer := 16
    );
    port (
        Clk         : in  std_logic;                        -- Clock signal
        Reset       : in  std_logic;                        -- Reset input
        ClockDivider: in  std_logic_vector(15 downto 0);

        ParityMode  : in std_logic_vector(1 downto 0);      -- b00=No, b01=Even, b10=Odd, b11=UserBit
    [...]


architecture Behaviour of UART is
    constant oversampleExponent : integer := 4;

    subtype TxCounterType is integer range 0 to (2**(dividerCounterBits+oversampleExponent))-1;
    subtype RxCounterType is integer range 0 to (2**dividerCounterBits)-1;
    signal rxCounter: RxCounterType;
    signal txCounter: TxCounterType;
    signal rxClockEn: std_logic; -- clock enable signal for receiver
    signal txClockEn: std_logic; -- clock enable signal for transmitter
begin
    rxClockdivider:process (Clk, Reset)
    begin
        if Reset='1' then
        rxCounter <= 0;
        rxClockEn <= '0';
    elsif Rising_Edge(Clk) then
        -- RX counter (oversampled)
        if rxCounter = 0 then
            rxClockEn <= '1';
            rxCounter <= to_integer(unsigned(ClockDivider));
        else
            rxClockEn <= '0';
            rxCounter <= rxCounter - 1;
        end if;
    end if;
    end process;

    txClockDivider: process (Clk, Reset)
    [...]

    rx: entity work.RxUnit
    generic map (oversampleFactor=>2**oversampleExponent)
    port map (Clk=>Clk, Reset=>Reset, ClockEnable=>rxClockEn, ParityMode=>ParityMode,
            ReadA=>ReadA, DataO=>DataO, RxD=>RxD, RxAv=>RxAv, ParityBit=>ParityBit,
            debugout=>debugout
             );

end Behaviour;

This is a single Uart, to create them all (currently 11 uarts) I use this

-- UARTs

    UartGenerator: For i IN 0 to uarts-1 generate
    begin
        Uart_i : entity work.UartBusInterface 
            port map (Clk=>r_qclk, Reset=>r_reset, 
                cs=>uartChipSelect(i), nWriteStrobe=>wr_strobe, nReadStrobe=>rd_strobe,
                address=>AdrBus(1 downto 0), Databus=>DataBus,
                TxD=>TxD_PAD_O(i), RxD=>RxD_PAD_I(i),
                txInterrupt=>TxIRQ(i), rxInterrupt=>RxIRQ(i), debugout=>rxdebug(i));

        uartChipSelect(i) <= '1' when to_integer(unsigned(adrbus(5 downto 2)))=i+4 and r_cs0='0' else '0';
    end generate;

I can syntesis it and the uarts work, but why I got the warning?

IMHO the rxCounter should use each single possible value, but why each second bit creates the warning "has no load"?

I read somewhere that this mean that these net's aren't used and will be removed.
But to count from 0 to 2^n-1, I need no less than n-bits.


Solution

  • This warning means that nobody is "listening" to those nets.

    It is OK to have signals that will be removed in synthesis. Warnings are not Errors! You just need to be aware of them.

    We cannot assess what is happening from your partial code.

    • Is there a signal named rxCounter_cry?
    • What is the datatype of ClockDivider?
    • What is the value of dividerCounterBits?
    • What happens in the other process? If it is irrelevant, please try to run your synthesis without that process. If it is relevant, we need to see it.