M
Mariusz
Guest
Hello. I have one question. I want to use different component depending on
the given address. But when i try to do this using if RelAddress = "xxx"
then i have the error message which says that '=' is not static. I'v been
trying to put this in process, but it gave me even more errors. I also tried
case but it didn't work for me. I'm completely new in vhdl so i just don't
know what should i do to make it work. Any clues?
I would be very gratefull for some help...
Here is my code:
entity mem_part is
Port (
WrEn : in std_logic;
Clk : in std_logic;
Address : in std_logic_vector (0 to 14);
DIn : in std_logic_vector (0 to 0);
DOut : out std_logic_vector (0 to 0));
end mem_part;
architecture Behavioral of mem_part is
signal ToLow, ToHigh : std_logic;
signal FinalAdress : std_logic_vector (0 to 11);
signal RelAddress : std_logic_vector (0 to 2);
begin
ADD: for i in 0 to 2 generate
RelAddress(i) <= Address(i);
end generate;
FINAL: for i in 3 to 14 generate
FinalAdress(i-3) <= Address(i);
end generate;
ToLow <= '0';
ToHigh <= '1';
TRAM1 : if RelAddress = "000" generate
RAM1: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM2 : if RelAddress = "001" generate
RAM2: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM2 : if RelAddress = "010" generate
RAM2: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM3 : if RelAddress = "011" generate
RAM3: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM4 : if RelAddress = "100" generate
RAM4: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
end Behavioral;
the given address. But when i try to do this using if RelAddress = "xxx"
then i have the error message which says that '=' is not static. I'v been
trying to put this in process, but it gave me even more errors. I also tried
case but it didn't work for me. I'm completely new in vhdl so i just don't
know what should i do to make it work. Any clues?
I would be very gratefull for some help...
Here is my code:
entity mem_part is
Port (
WrEn : in std_logic;
Clk : in std_logic;
Address : in std_logic_vector (0 to 14);
DIn : in std_logic_vector (0 to 0);
DOut : out std_logic_vector (0 to 0));
end mem_part;
architecture Behavioral of mem_part is
signal ToLow, ToHigh : std_logic;
signal FinalAdress : std_logic_vector (0 to 11);
signal RelAddress : std_logic_vector (0 to 2);
begin
ADD: for i in 0 to 2 generate
RelAddress(i) <= Address(i);
end generate;
FINAL: for i in 3 to 14 generate
FinalAdress(i-3) <= Address(i);
end generate;
ToLow <= '0';
ToHigh <= '1';
TRAM1 : if RelAddress = "000" generate
RAM1: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM2 : if RelAddress = "001" generate
RAM2: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM2 : if RelAddress = "010" generate
RAM2: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM3 : if RelAddress = "011" generate
RAM3: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
TRAM4 : if RelAddress = "100" generate
RAM4: RAMB4_S1 port map( WE=>WrEn,
EN => ToHigh,
RST => ToLow,
Clk => Clk,
Addr => FinalAdress,
DI=> DIn,
DO=> DOut);
end generate;
end Behavioral;