L
Lolo
Guest
This is a question about how to connect signals having
"equivalent" types but defined in different packages.
Here is the skeleton of the problem:
----------------------
package P1:
type t is <something>;
end
----------------------
use P1;
entity M1 is port (a: in t);
----------------------
package P2:
type t is <something> -- exactly the same as in P1
end
----------------------
use P2;
entity M2 is port (b: out t);
-----------------------
package P3:
type t is <something> -- the same as in P1 and P2
end
-----------------------
use P3;
entity M3 is port (...);
architecture of M3 is
signal x: t;
begin
c1:M1 port map (a=>x);
c2:M2 port map (b=>x);
end
Modelsim and other VHDL tools complain because a, b and x have different types.
This is because they consider the types as being different because in different
packages. How to **simply** make them understand they are the same types ?
I'd like to apply changes to P3 and/or M3 only.
My current solution consists in modifying M3 as follows:
use P3;
entity M3 is port (...);
architecture of M3 is
signal x: t;
signal x_aux_1: work.P1.t;
signal x_aux_2: work.P2.t;
begin
x_aux_1 <= work.P1.t(x);
c1:M1 port map (a=>x_aux_1);
x <= t(x_aux_2);
c2:M2 port map (b=>x_aux_2);
end
Can anybody propose a nicer solution ? Possibly without creating additional
signals ?
Thanks in advance.
Laurent Arditi
Esterel Technologies
Laurent.Arditi@<company name, replace blank with dash>.com
--
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr
http://forums.club-internet.fr/
"equivalent" types but defined in different packages.
Here is the skeleton of the problem:
----------------------
package P1:
type t is <something>;
end
----------------------
use P1;
entity M1 is port (a: in t);
----------------------
package P2:
type t is <something> -- exactly the same as in P1
end
----------------------
use P2;
entity M2 is port (b: out t);
-----------------------
package P3:
type t is <something> -- the same as in P1 and P2
end
-----------------------
use P3;
entity M3 is port (...);
architecture of M3 is
signal x: t;
begin
c1:M1 port map (a=>x);
c2:M2 port map (b=>x);
end
Modelsim and other VHDL tools complain because a, b and x have different types.
This is because they consider the types as being different because in different
packages. How to **simply** make them understand they are the same types ?
I'd like to apply changes to P3 and/or M3 only.
My current solution consists in modifying M3 as follows:
use P3;
entity M3 is port (...);
architecture of M3 is
signal x: t;
signal x_aux_1: work.P1.t;
signal x_aux_2: work.P2.t;
begin
x_aux_1 <= work.P1.t(x);
c1:M1 port map (a=>x_aux_1);
x <= t(x_aux_2);
c2:M2 port map (b=>x_aux_2);
end
Can anybody propose a nicer solution ? Possibly without creating additional
signals ?
Thanks in advance.
Laurent Arditi
Esterel Technologies
Laurent.Arditi@<company name, replace blank with dash>.com
--
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr
http://forums.club-internet.fr/