
Q: arrays of resolved elements in port maps
I'd like to clarify the requirement for type conversions in port maps
when associating resolved objects with non-resolved objects. I have
seen previous articles in this group mention type conversions in this
case. I am also getting type errors from the analyzer I am using when I
don't include type conversions. These are at odds with my understanding
of the LRM, so hopefully someone might be able to put me on the right
track.
Case 1: Suppose we have a scalar resolved signal declared as:
signal s : std_logic;
My analyzer allows me to associate the signal with scalar unresolved
ports, for example:
b1 : block is
port ( p : in std_ulogic );
port map ( p => s );
begin
end block b1;
b2 : block is
port ( p : out std_ulogic );
port map ( p => s );
begin
end block b2;
I'm happy with this. Seems ok by the LRM. Any problems?
Case 2: Suppose we have a scalar unresolved signal declared as:
signal s : std_ulogic;
My analyzer allows me to associate it with a scalar resolved port, for
example:
b2 : block is
port ( p : out std_logic );
port map ( p => s );
begin
end block b2;
The is fine too - the port b2.p gets resolved, and the result becomes
the driving value for signal s. Ok so far?
Now suppose we declare two constrained array subtypes, with unresolved and
resolved element types respectively:
subtype std_ulogic_word is std_ulogic_vector(31 downto 0);
subtype std_logic_word is std_logic_vector(31 downto 0);
Case 3: We declare a signal of the array-of-resolved-elements subtype:
signal s : std_logic_word;
My analyzer does not allow me to associate this signal with ports of the
array-of-unresolved-elements subtype, for example:
b1 : block is
port ( p : in std_ulogic_word );
port map ( p => s );
begin
end block b1;
b2 : block is
port ( p : out std_ulogic_word );
port map ( p => s );
begin
end block b2;
The analyzer complains that it was expecting type std_ulogic_word for
the actual. I though the association would be ok, since the LRM just
requires the type of the actual and formal to be the same (as opposed to
the subtypes). I understood that inclusion of a resolution function
name in a subtype simply specified that any signal declared to be of
that subtype would be resolved. I thought the subtype still had the
same base type. Is my understanding wrong, or my analyzer? If I'm
wrong, which chapter/verse of the LRM says so?
Case 4 (similar to case 3): Given the same subtypes declared above,
suppose we declare a signal of the array-of-unresolved-elements subtype:
signal s : std_ulogic_word;
My analyzer does not allow me to associate this signal with ports of the
array-of-resolved-elements subtype, for example:
b2 : block is
port ( p : out std_logic_word );
port map ( p => s );
begin
end block b2;
This time the analyzer complains that it was expecting type
std_logic_word for the actual. Again, is my understanding wrong, or my
analyzer? If I'm wrong, which chapter/verse of the LRM says so?
If you can shed some light on this subject, I'd be glad to hear from
you.
Thanks molto!
Cheers,
PA
-------------------------------------------------------------------------
Dept. Computer Science / \
University of Adelaide \_.--*_/ Ph: +61 8 303 4477
SA 5005, Australia v Fax: +61 8 303 4366
http://www.*-*-*.com/ ~petera/
--
-------------------------------------------------------------------------
Dept. Computer Science / \
University of Adelaide \_.--*_/ Ph: +61 8 303 4477
SA 5005, Australia v Fax: +61 8 303 4366
http://www.*-*-*.com/ ~petera/