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

6.5k Views Asked by At

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.

3

There are 3 best solutions below

5
On BEST ANSWER

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.
0
On

Just be aware that sometimes it implements things with adders. The highest order bit will not use the carry output of that adder, and the lowest order bit will not use the sign input. So you get a warning like:

WARNING - synthesis: logical net 'clock_chain/dcmachine/count_171_add_4_1/S0' has no load WARNING - synthesis: logical net 'clock_chain/dcmachine/count_171_add_4_19/CO' has no load

No problem, bit 19 is the highest, so it will not carry anywhere, and bit 1 is the lowest, so it does not get a sign bit from anywhere. If, however, you get this warning on any of the bits in between highest and lowest, it normally means something is wrong, but not an error, so it will build something that "works" when you test it, but not in an error case. If you simulate it with error cases it will normally show undesirable results.

0
On

Lattice ngdbuild is particularly spammy for the job it is doing, I pipe ngdbuild output through grep in my makefile to remove exactly these messages:

ngdbuild ... | grep -v "ngdbuild: logical net '.*' has no load"

There's more than 2500 of these otherwise, eliminating them helps concentrate on real issues.

Second worst toolchain spammer is edif2ngd complaining about Verilog parameters it does not have explicit handling for. This one is a two line message (over 300 of these) so I remove it with:

edif2ngd ... | sed '/Unsupported property/{N;d;}'