On 4 Aug 2005 13:17:10 -0700, "Brandon" <
[email protected]> wrote:
>Actually, this syntax was ok:
>port map (... P => unsigned(S) ...)
>
>While this was not:
>port map (... unsigned(A) => B ...)
ok - both versions should be absolutely fine, assuming
A is an output port of course. Both forms were made
legal in VHDL-93 (in VHDL-87 it would have been necessary
to write your own function, something like "my_unsigned",
so that the conversion is a function call rather than an
array type conversion)
>I don't understand why they haven't fixed this...
Not enough people shouting about it, I guess.
> Is there any sort of
>option to toggle VHDL-93 syntax?
You must have VHDL-93 enabled already, otherwise the input-port
conversion would also have been illegal.
>If you don't mind, could you explain the wrapper workaround? I made the
>changes manually myself, but that involved creating a duplicate signal
>to perform the type conversion on. This is quite sloppy imo, and I
>dislike having to tailor my code to a specific tool.
Well... the code you end up with will work in any tool OK, it's
just that it is tiresome to do. I wasn't suggesting anything
different - just another layer of module instantiation so that
the conversion is not visible in the top-level module:
entity Original is
port (P: in unsigned(...); Q: out std_logic_vector(...));
end;
entity Wrapper is
port (P: in std_logic_vector(...); Q: out unsigned(...));
end;
architecture Hack of Wrapper is
signal QU: unsigned(...);
begin
Original_Instance: entity work.Original(arch)
port map (P => unsigned(P), Q => QU);
Q <= std_logic_vector(QU);
end;
Now, when you instantiate Wrapper in your top-level module,
no type conversion is needed. I'm sure this is exactly
what you have already done - I'm merely suggesting the
wrapper module as a way of localising the type conversion
so that it doesn't pollute the architecture of the
enclosing module.
--
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, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
[email protected]
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.