Mike,
>> The downside to subprogram approaches is that they are
>> sequential. While sequential programs work well for many
>> things, there are many problems where the concurrency
>> is alot easier to visualize and write. So while a UART
>> transmitter is easy to implement sequentially, a UART
>> receiver (with its hunt state and 16X reference clock)
>> is much easier to implement concurrently - particularly if
>> you are coming from a hardware design background.
>
> However, for a hardware guy who has done
> enough C to turn on a new circuit board,
> a sequential hardware description can be addictive.
> A good editor and interactive sim waveforms
> can safely move the focus from gates and wires
> to source code and functional performance.
>
> Is the procedure rx_state in
> http://home.comcast.net/~mike_treseler/uart.vhd
> more difficult to follow than a
> ten process version of the same thing?
So you have coded the functionality as a single process,
however, there is more in verification model than just
functionality. There are protocol checkers, timing
checkers (such as a pulse width that spans multiple
clocks), results logging, ... Some of these execute based
on clock (as does everything in your design) and some execute
on a signal changing.
Going further, the point is that if I have an entity/BFM,
I have a choice of using independent processes or sequential
code and the coding style employed can suit the style of the
coder. With a subprogram one is limited to sequential code
- there is no fork and join and hence no concurrency. And
why would I want fork and join if I can use separate processes?
Back to your statement, anyone can write bad code such as you
suggest with a 10 process version. Or if you read one of the
VHDL texts, anyone can implement a simple 2-input "OR" in a
process with if statements or implement an adder with "AND",
"OR" and "XOR".
I find a well written 2 process or even a 1 process state machine
with independent support logic in separate processes easy to
read. It suits me, I am productive writing it, and
others find it reasonable to read.
With yours, since it has so many nested procedure
calls, I have to spend some time descending through it
before I can understand any of it. Perhaps it is
something I could make friends with, perhaps not,
I find I really can't comment on some coding styles
until I have tried it myself.
Having done synthesis for some time, I value separability
of code so that when a synthesis tool does a poor
implementing a particular construct, I can easily isolate
it and make attempts at improving the implementation
by changing the code. Having worked as a consultant the
statement a customer does not want to here is that the
synthesis tool they just spent $$$$K on sucks. Instead
they would prefer to hear, the synthesis tool is giving
us some issues with some code, however, with some small
tweaks we will get it to produce the implementation
we need. Ok so I have suffered through more than one
project using either Synopsys DC or FPGA compiler for an
FPGA design. As a result, I tend to protect myself
more than the coding style you enjoy affords.
Cheers,
Jim
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training private.php?do=newpm&u=
SynthWorks Design Inc.
http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~