F
fl
Guest
Hi,
I am implementing 7 lookup tables, which compose a large table. In this way, the resource used only depends on the table values. I only list one lut component: lut6 to save space below.
You can see that s_addr6(5:0) is ignored. This is a 64 to 1 saving for the table (These 64 addresses have one same lut output).
I use Modelsim 6.5 SE. The problem is that it seems that the case always select "when others " line. Even though tmp value is "000011100000001" (15 bits), it does not use o_tmp_2 output.
This case statement originates from "The designer's guide to VHDL" book.
In the example snippet on the book, it uses "case?". But Xilinx ISE does not understand "case?".
Could you help me on this problem?
Thanks,
signal tmp : unsigned(14 DOWNTO 0);
signal o_tmp0 : std_logic_vector(25 DOWNTO 0);
signal o_tmp1 : std_logic_vector(25 DOWNTO 0);
signal o_tmp2 : std_logic_vector(25 DOWNTO 0);
signal o_tmp3 : std_logic_vector(25 DOWNTO 0);
signal o_tmp4 : std_logic_vector(25 DOWNTO 0);
signal o_tmp5 : std_logic_vector(25 DOWNTO 0);
signal o_tmp6 : std_logic_vector(25 DOWNTO 0);
signal o_tmp_0 : unsigned(25 DOWNTO 0);
signal o_tmp_1 : unsigned(25 DOWNTO 0);
signal o_tmp_2 : unsigned(25 DOWNTO 0);
signal o_tmp_3 : unsigned(25 DOWNTO 0);
signal o_tmp_4 : unsigned(25 DOWNTO 0);
signal o_tmp_5 : unsigned(25 DOWNTO 0);
signal o_tmp_6 : unsigned(25 DOWNTO 0);
signal s_addr0 : unsigned(8 DOWNTO 0);
signal s_addr1 : unsigned(7 DOWNTO 0);
signal s_addr2 : unsigned(7 DOWNTO 0);
signal s_addr3 : unsigned(7 DOWNTO 0);
signal s_addr4 : unsigned(7 DOWNTO 0);
signal s_addr5 : unsigned(7 DOWNTO 0);
signal s_addr6 : unsigned(7 DOWNTO 0);
signal lut_reciprocal_internal : unsigned(25 DOWNTO 0);
lut6 : kalman_fadd_lut6 port map (
clk => clk,
reset => reset,
enb_1_1_1 => '1',
divider_u => std_logic_vector(s_addr6),
lut_reciprocal => o_tmp6);
tmp <= unsigned(divider_in(14 downto 0));
o_tmp_0 <= unsigned(o_tmp0);
o_tmp_1 <= unsigned(o_tmp1);
o_tmp_2 <= unsigned(o_tmp2);
o_tmp_3 <= unsigned(o_tmp3);
o_tmp_4 <= unsigned(o_tmp4);
o_tmp_5 <= unsigned(o_tmp5);
o_tmp_6 <= unsigned(o_tmp6);
s_addr0 <= tmp( 8 downto 0);
s_addr1 <= tmp( 8 downto 1);
s_addr2 <= tmp( 9 downto 2);
s_addr3 <= tmp(10 downto 3);
s_addr4 <= tmp(11 downto 4);
s_addr5 <= tmp(12 downto 5);
s_addr6 <= tmp(13 downto 6);
PROCESS(tmp)
BEGIN
CASE tmp IS
-- lut: 15 address bus
when "1--------------" => lut_reciprocal_internal <= o_tmp_6;
when "01-------------" => lut_reciprocal_internal <= o_tmp_5;
when "001------------" => lut_reciprocal_internal <= o_tmp_4;
when "0001-----------" => lut_reciprocal_internal <= o_tmp_3;
when "00001----------" => lut_reciprocal_internal <= o_tmp_2;
when "000001---------" => lut_reciprocal_internal <= o_tmp_1;
WHEN OTHERS => lut_reciprocal_internal <= o_tmp_0;
END CASE;
END PROCESS;
I am implementing 7 lookup tables, which compose a large table. In this way, the resource used only depends on the table values. I only list one lut component: lut6 to save space below.
You can see that s_addr6(5:0) is ignored. This is a 64 to 1 saving for the table (These 64 addresses have one same lut output).
I use Modelsim 6.5 SE. The problem is that it seems that the case always select "when others " line. Even though tmp value is "000011100000001" (15 bits), it does not use o_tmp_2 output.
This case statement originates from "The designer's guide to VHDL" book.
In the example snippet on the book, it uses "case?". But Xilinx ISE does not understand "case?".
Could you help me on this problem?
Thanks,
signal tmp : unsigned(14 DOWNTO 0);
signal o_tmp0 : std_logic_vector(25 DOWNTO 0);
signal o_tmp1 : std_logic_vector(25 DOWNTO 0);
signal o_tmp2 : std_logic_vector(25 DOWNTO 0);
signal o_tmp3 : std_logic_vector(25 DOWNTO 0);
signal o_tmp4 : std_logic_vector(25 DOWNTO 0);
signal o_tmp5 : std_logic_vector(25 DOWNTO 0);
signal o_tmp6 : std_logic_vector(25 DOWNTO 0);
signal o_tmp_0 : unsigned(25 DOWNTO 0);
signal o_tmp_1 : unsigned(25 DOWNTO 0);
signal o_tmp_2 : unsigned(25 DOWNTO 0);
signal o_tmp_3 : unsigned(25 DOWNTO 0);
signal o_tmp_4 : unsigned(25 DOWNTO 0);
signal o_tmp_5 : unsigned(25 DOWNTO 0);
signal o_tmp_6 : unsigned(25 DOWNTO 0);
signal s_addr0 : unsigned(8 DOWNTO 0);
signal s_addr1 : unsigned(7 DOWNTO 0);
signal s_addr2 : unsigned(7 DOWNTO 0);
signal s_addr3 : unsigned(7 DOWNTO 0);
signal s_addr4 : unsigned(7 DOWNTO 0);
signal s_addr5 : unsigned(7 DOWNTO 0);
signal s_addr6 : unsigned(7 DOWNTO 0);
signal lut_reciprocal_internal : unsigned(25 DOWNTO 0);
lut6 : kalman_fadd_lut6 port map (
clk => clk,
reset => reset,
enb_1_1_1 => '1',
divider_u => std_logic_vector(s_addr6),
lut_reciprocal => o_tmp6);
tmp <= unsigned(divider_in(14 downto 0));
o_tmp_0 <= unsigned(o_tmp0);
o_tmp_1 <= unsigned(o_tmp1);
o_tmp_2 <= unsigned(o_tmp2);
o_tmp_3 <= unsigned(o_tmp3);
o_tmp_4 <= unsigned(o_tmp4);
o_tmp_5 <= unsigned(o_tmp5);
o_tmp_6 <= unsigned(o_tmp6);
s_addr0 <= tmp( 8 downto 0);
s_addr1 <= tmp( 8 downto 1);
s_addr2 <= tmp( 9 downto 2);
s_addr3 <= tmp(10 downto 3);
s_addr4 <= tmp(11 downto 4);
s_addr5 <= tmp(12 downto 5);
s_addr6 <= tmp(13 downto 6);
PROCESS(tmp)
BEGIN
CASE tmp IS
-- lut: 15 address bus
when "1--------------" => lut_reciprocal_internal <= o_tmp_6;
when "01-------------" => lut_reciprocal_internal <= o_tmp_5;
when "001------------" => lut_reciprocal_internal <= o_tmp_4;
when "0001-----------" => lut_reciprocal_internal <= o_tmp_3;
when "00001----------" => lut_reciprocal_internal <= o_tmp_2;
when "000001---------" => lut_reciprocal_internal <= o_tmp_1;
WHEN OTHERS => lut_reciprocal_internal <= o_tmp_0;
END CASE;
END PROCESS;