Have I really overlooked something in the VHDL rules?
It seems, that it should not be considered a conflict, as each field is driven
by a single process.
--
TIA
WZab
And according to the solution decribed there, I set ALL fields (elements)
of the record in ALL processes. If the particular process does not drive
the particular signal, I set it to "Z".
This solution works, however I'm afraid that setting a signal to 'Z' in any
place instead of ports of top entity may confuse the synthesis tools...
Does any of you have any experiences with such a problem?
--
TIA
WZab
Avoiding 'Z' except for actual tri-state hardware (e.g., IOB pins on
FPGAs) is a good idea. The synthesizers can often deal with Z OK, but
I prefer to keep my designs closer to what the hardware can actually
implement, rather than counting on the cleverness of the synthesizer.
(Obviously I still do count on the cleverness of the synthesizer; I
just try not to do it more than necessary.)
Eric
Ciao,
Maurizio
What exactly is connected to the ports? The entire record or the
particular element of the record? If it's the entire record, like
this...
u1 : entity work.my_thing1 port map(s => my_record);
u2 : entity work.my_thing2 port map(v => my_record);
Then you will have problems because (as you've begun to discover based
on your later post) you will have multiple processes driving the
'my_record' signal. It doesn't matter that the entity only has one
obvious statement that is driving one element of the record.
> Have I really overlooked something in the VHDL rules?
The fact is that the two entities are defined to have an output that
is of the record type. That you choose to not have anything in the
architecture for that entity to drive the other elements of the record
means that those other elements gets the VHDL default assignment of
'U'.
> It seems, that it should not be considered a conflict, as each field is driven
> by a single process.
The output of the entity in your case is not an element of the record,
but the record itself.
Kevin Jennings
Not using records, just invites other problems...like when bit fields
definitions change. A record allows this change to be handled
completely in one file, three locations in that file: in the record
definition and within two functions. Not using a record involves
finding and changing every instance where the (could've been) record
is used, which is generally in far more places in the code and not
always as easy to find. Plus to find them, you need to rely on text
search tools rather than the VHDL compiler. Far more likely to miss
an usage instance in that case, thus the problem
Kevin Jennings
Step back a minute and think about why you would have an entity that
is defined to have a record output that does not drive all the
elements? Doesn't that seem to you like the entity *really* does not
have the record output that you've defined? (Hint: The answer is
'yes').
What this suggests is that you've defined the record per some pre-
conceived notion of how it should be, but it does not match how you're
defining your entities. You should go back to the drawing board and
re-think the record definitions to match how you really intend to use
them. The alternative is the kludge you've found regarding setting
unused record fields to 'Z'.
Kevin Jennings