Altera_Forum
Honored Contributor
11 years agoAbout multiplexer optimization issue need you help
I saw attached training presentation from ALTERA, it seems 5:1 mux can be absorbed into one LE. I compiled below codes(copy from attached slide), unfortunately, i can't get the same result as the training paper said. why? The result what i got is more than 2 LEs, 3 LEs for Cyclone serials and 2 ALUT for high-end device, such as ArriaGX.
library ieee;use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity mux_5x1 is
port(
clk : in std_logic;
reset : in std_logic;
sclr : in std_logic;
sload : in std_logic;
ena : in std_logic;
sel : in std_logic;
dia : in std_logic;
dib : in std_logic;
dic : in std_logic;
do : out std_logic
);
end entity;
architecture rtl of mux_5x1 is
--signal sclr: std_logic;
--signal sload: std_logic;
--signal ena: std_logic;
begin
process (clk,reset)
begin
if reset='1' then
do <= '0';
elsif clk'event and clk='1' then
if ena='1' then
if sclr='1' then
do <= '0';
elsif sload='1' then
do <= dic;
else
if sel='1' then
do <= dib;
else
do <= dia;
end if;
end if;
end if;
end if;
end process;
end rtl; Also, i tried the option "Restructure Multiplexer" in settings->Analysis & Synthesis Settings -> More Settings... This option still hasn't any affection.