J
Jonathan Bromley
Guest
Hi all,
Normally I reckon that I know my way around VHDL pretty well.
This one, however, has me stumped. I expect it's in the
LRM - most things are - but I can't find it.
Clarification welcome...
Suppose I have an entity and (to keep things simple) a
matching component declaration, and it has an unconstrained
array output port...
entity E is port (P: out bit_vector); end;
Now, if I instance it in an architecture, the unconstrained
array port is of course constrained to have the same subtype
as the signal connected to it...
....
signal V: bit_vector(2 downto 0);
....
inst: E port map (P => V);
-- port P is now constrained (2 downto 0) like V
However, suppose I now apply a conversion function to that
output port...
....
signal W: widget;
function F(BV: in bit_vector) return widget is...
....
inst: E port map (F(P) => W);
Since the unconstrained port is an *input* to the
conversion function, how does it get its subtype constraint?
Or is this illegal? Illegal sounds likely, but where is this
defined in the LRM?
Thanks in advance
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
Normally I reckon that I know my way around VHDL pretty well.
This one, however, has me stumped. I expect it's in the
LRM - most things are - but I can't find it.
Clarification welcome...
Suppose I have an entity and (to keep things simple) a
matching component declaration, and it has an unconstrained
array output port...
entity E is port (P: out bit_vector); end;
Now, if I instance it in an architecture, the unconstrained
array port is of course constrained to have the same subtype
as the signal connected to it...
....
signal V: bit_vector(2 downto 0);
....
inst: E port map (P => V);
-- port P is now constrained (2 downto 0) like V
However, suppose I now apply a conversion function to that
output port...
....
signal W: widget;
function F(BV: in bit_vector) return widget is...
....
inst: E port map (F(P) => W);
Since the unconstrained port is an *input* to the
conversion function, how does it get its subtype constraint?
Or is this illegal? Illegal sounds likely, but where is this
defined in the LRM?
Thanks in advance
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.