jean-philippea said:
Thanks for the quick answer.
Unfortunatly having a direction signal is not possible.
I define my own types for the I/O ports of the component. And actually all
my components only have 1 INOUT port in which all the signals coming in
and out are gathered. Signals are unidirectional but as they are grouped
in the same type the port needs to be INOUT, which confuses my simulator
and I guess will confuse my synthesiser too...
The idea is to define a set of components and the rules/methods to
interconnect them.
This way I can have a code that will look like the following.
Note that function Connect could be overloaded for the various types of
signals.
This create a simple easy to read code. It also make it very easy to
automate generation of code using generate statement or automatic code
generation tools for example.
signal u0_io: MyTypeA;
signal u1_io: MyTypeB;
u0 : MyCompA
port map(
io => u0_io,
);
u1 : MyCompB
port map(
io => u1_io,
)
Connect (u0_io, u1_io)
I think this can be summed up with the quote that things shoud be "as
simple as possible, but no simpler". I think you are trying to make the
IO of signals so simple that it won't work. Signals are not exactly
wires. Signals have drivers and receivers. Although ports can be
INOUT, an assignment to a signal must be directional.
So why can't you break the INOUT ports into IN and OUT? On the other
hand, why do you need a "connect" procedure instead of just using the
same signal for both port mappings?
BTW, if MyTypeA and MyTypeB are not compatible types, you won't be able
to connect them anyway... I must say that what you are trying to do is
not very clear at all...
--
Rick "rickman" Collins
(e-mail address removed)
Ignore the reply address. To email me use the above address with the XY
removed.
Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL
http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX