vhdl architecture configuration

Joined
Jul 11, 2008
Messages
1
Reaction score
0
Hello!
I would like to know how can I configure the use of different architectures for one entity.
I have seen few examples in Internet but I haven´t found what I was looking for.
I have tried this example:
-----------ent2.vhd-----------------
entity ent2 is
port(
clk: in std_logic;
sal: out std_logic
);
end entity ent2;

architecture a1 of ent2 is

component ent1 is port
(
clk: in std_logic;
sal: out std_logic );
end component;

begin
e : ent1 port map (clk=>clk, sal=>sal);

end a1;

architecture a2 of ent2 is

component ent1 is port(
clk: in std_logic;
sal: out std_logic );
end component;

begin
e : ent1 port map (clk=>clk, sal=>sal);

end a2;

configuration cfg1 of ent2 is
for a1
for e : ent1 use entity work.ent1(a1);
end for;
end for;
end cfg1;

configuration cfg2 of ent2 is
for a2
for e : ent1 use entity work.ent1(a2);
end for;
end for;
end cfg2;
--for a2
--for e : ent1 use entity work.ent1(a2);
--end for;
--end for;
---------------ent1.vhd------------------
entity ent1 is port
(
clk: in std_logic;
sal: out std_logic );
end ent1;

architecture a1 of ent1 is

begin
.....
end a1;

architecture a2 of ent1 is
begin
......
end a2;

-----------------------------------
What I want to do is with the definition of a parameter, select one of the configurations, how can I do it??
Is there any other way to select an architecture depending on a configuration parameter?
my ideal would be:
case x is:
when '0'=> for all: use......
when '1'=> for all: use....

So, I would be very grateful if anybody could help me!
Thank You!!!
Bye
 

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,012
Latest member
RoxanneDzm

Latest Threads

Top