Xilinx synthetize problems

P

Pedro Claro

After some simulations I decided to synthetize my design, but I don't know
why these errors occur:


WARNING:Xst:1293 - FF/Latch <queue_nr_7> is constant in block <sched_classif>.
WARNING:Xst:1293 - FF/Latch <queue_nr_4> is constant in block <sched_classif>.
WARNING:Xst:1293 - FF/Latch <queue_nr_6> is constant in block <sched_classif>.
WARNING:Xst:1293 - FF/Latch <queue_nr_5> is constant in block <sched_classif>

Does anyone know why this happens?

Here's the code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use work.sched_conf.all;

entity sched_classif is
Port (allow_packet: in std_logic;
clk: in std_logic;
packet_ready: in std_logic;
traffic_class: in std_logic_vector(7 downto 0);
-- packet_size:in std_logic_vector(15 downto 0);
queue_nr: out std_logic_vector(7 downto 0);
reset: in std_logic;
enqueue: out std_logic);

end sched_classif;

architecture Behavioral of sched_classif is

begin

prClassif: process(reset,clk)

--variable tclass: std_logic_vector(7 downto 0);
variable temp: integer range 0 to 255;

begin

if(reset='1') then
queue_nr<="00000000";
enqueue<='0';

else if(rising_edge(clk)) then
if(allow_packet='1') then
temp:=conv_integer(traffic_class) rem N_QUEUES;
queue_nr<= conv_std_logic_vector(temp,8);
enqueue<='1';
else if(packet_ready='0') then
queue_nr<=conv_std_logic_vector(N_QUEUES,8);
enqueue<='0';
end if;
end if;
end if;
end if;
 
D

Dan RADUT

This warnings mean that your code is changing only the bits 3 down to 0 of
the vector queue_nr(7 downto 0).
Simulation results should show queue_nr output as "0000bbbb".

Anyway this warning doesn't stop the implementation.

BTW what is N_QUEUES? Where is declared?

Regards,

Dan Radut
 
P

Pedro Claro

Thanks for the reply Dan. Well N_QUEUES is an integer declared in
sched_conf.all:

constant N_QUEUES : integer:=8;

But you say that queue_nr is changed but what about these piece of codes:

queue_nr<= conv_std_logic_vector(temp,8);

or

queue_nr<="00000000";

Don't they change all the bits in n_queue_nr?


Pedro Claro
 
B

Brian Drummond

constant N_QUEUES : integer:=8;

But you say that queue_nr is changed but what about these piece of codes:

queue_nr<= conv_std_logic_vector(temp,8);
or
queue_nr<="00000000";

Don't they change all the bits in n_queue_nr?
No, because a) temp is already known to be <= N_QUEUES (from the
previous line of code) and "00000000" certainly is.
The synthesiser has quite correctly trimmed the upper bits, and warned
you about it. If that's what you wanted it to do, you can ignore the
warnings.

- Brian
 
D

Dan RADUT

Pedro:

Now as I know that N_QUEUES is an integer having the value 8 it is very
simple to explain why you get those warnings. Please see my comments below
inserted within your code.
entity sched_classif is
Port (allow_packet: in std_logic;
clk: in std_logic;
packet_ready: in std_logic;
traffic_class: in std_logic_vector(7 downto 0);
-- packet_size:in std_logic_vector(15 downto 0);
queue_nr: out std_logic_vector(7 downto 0);
reset: in std_logic;
enqueue: out std_logic);

end sched_classif;

architecture Behavioral of sched_classif is

begin

prClassif: process(reset,clk)

--variable tclass: std_logic_vector(7 downto 0);
variable temp: integer range 0 to 255;

begin

if(reset='1') then
queue_nr<="00000000";
Thsi statement assign all queue_nr bits the value '0'.
enqueue<='0';

else if(rising_edge(clk)) then
if(allow_packet='1') then
temp:=conv_integer(traffic_class) rem N_QUEUES;
As N_QUEUES is 8, temp will take one of the following values:0, 1, 2, 3, 4,
5, 6 or 7.
queue_nr<= conv_std_logic_vector(temp,8);
queue_nr is assigned one of the following vectors:

"00000000" (temp = 0), "00000001" (temp = 1), "00000010" (temp = 2),
"00000011" (temp = 3), "00000100" (temp = 4), "00000101" (temp = 5),
"00000110" (temp = 6) and "00000111" (temp = 7)

You can see that only the bits 2 downto 0 change due to this statement.
enqueue<='1';
else if(packet_ready='0') then
queue_nr<=conv_std_logic_vector(N_QUEUES,8);
As N_QUEUES is 8 this statement means that queue_nr is assigned the vector
"00001000", that is the bit queue_nr(3) changes.

So only the lower 3 downto 0 bits could have different logic values ('0' or
'1') and will be implemented accordingly by inferring FFs.
The upper 7 downto 4 bits are always assigned the '0' logic level, so they
are constant. Warnings tell you that no logic is inferred as it not necessary
to drive these outputs: the input nets of IOB for these bits are merely tied
to constant '0'.

As an exercise change the value of N_QUEUES to 128 and you'll get no warnings.

Regards,

Dan R
 
A

Amontec Team

Dan said:
Pedro:

Now as I know that N_QUEUES is an integer having the value 8 it is very
simple to explain why you get those warnings. Please see my comments below
inserted within your code.


Thsi statement assign all queue_nr bits the value '0'.



As N_QUEUES is 8, temp will take one of the following values:0, 1, 2, 3, 4,
5, 6 or 7.


queue_nr is assigned one of the following vectors:

"00000000" (temp = 0), "00000001" (temp = 1), "00000010" (temp = 2),
"00000011" (temp = 3), "00000100" (temp = 4), "00000101" (temp = 5),
"00000110" (temp = 6) and "00000111" (temp = 7)

You can see that only the bits 2 downto 0 change due to this statement.



As N_QUEUES is 8 this statement means that queue_nr is assigned the vector
"00001000", that is the bit queue_nr(3) changes.

So only the lower 3 downto 0 bits could have different logic values ('0' or
'1') and will be implemented accordingly by inferring FFs.
The upper 7 downto 4 bits are always assigned the '0' logic level, so they
are constant. Warnings tell you that no logic is inferred as it not necessary
to drive these outputs: the input nets of IOB for these bits are merely tied
to constant '0'.

As an exercise change the value of N_QUEUES to 128 and you'll get no warnings.

Regards,

Dan R
Right,

and just for advice and for a better generic code:

please use
queue_nr<= (others => '0');
for your
queue_nr<="00000000";

Larry
Amotnec Team
www.amontec.com
 
P

Pedro Claro

Well, thanks for the explanation. I suspected it was something like.
And I always forget in my code the "others" thing.

Pedro Claro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top