M
Mike Treseler
Andy said:I usually don't separate related counters, shifters, etc. from a
controlling state machine, preferring to code them in one process.
I agree.
I put everything that uses an
enumerated value in the same process
that creates it. If it's
too unrelated to be there, I move it
to another entity.
However, I prefer to use separate processes for separate
state machines, if for no other reason than to avoid combinatorial
control loops between them.
I don't follow the "combinational" part,
but this is really a matter of style.
Nests of wires or nests of procedures.
It's all about updating registers.
A bad count is no better than a bad state.
I prefer to concatenate CASE and IF
expressions sequentially in the same process.
If they get too big, I declare a procedure
and call it from below. Enumerated types
themselves provide some protection against
poor typing.
That's where I most commonly use flags
instead of direct state decoding in the other state machine.
With a single threaded description,
I can already see the upstream variable assignments.
Even in a single process entity, one can use blocks around chunks of
sequential code, with an enclosed declarative region to define local
variables, visible only within that block.
If I need "protection" I declare
a common subprogram inside the main procedure scope.
I have gone nuts trying to use blocks for this.
I prefer not to have to use entities to hide implementation details,
especially when lightweight processes with variables can give me the
same benefits with less code. Entities tend to be on more structural
boundaries in my designs.
I agree. I see it as a test boundary.
That's the size limit for me.
I like to put all my signals in
a top entity of instances and port maps.
In the functional entities, I use port references only.
I like the compile time checking I get
from the IN and OUT port directions.
But if all of us designed alike, it'd be an awfully boring world.
Indeed.
-- Mike Treseler