Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   Re: sw guy question about latches (http://www.velocityreviews.com/forums/t666384-re-sw-guy-question-about-latches.html)

Andy 01-20-2009 04:03 PM

Re: sw guy question about latches
 
On Jan 18, 11:04*pm, Mike Treseler <mtrese...@gmail.com> wrote:
> d p chang wrote:
> > i'm a sw guy wandering through teaching myself a little bit about
> > (digital) hw, and want to try to go about this 'idiomatically' rather
> > than trying to translate my sw thinking into hdl (and coming up w/ crap
> > hdl).

>
> Match a synchronous template.
> That will simplify synthesis.
> I recommend single process entities to
> the sequentially inclined.
>
> Details:http://mysite.verizon.net/miketreseler/


Mike has given you good advice. I would also add that a single,
clocked process will not give you latches, regardless of whether a
signal or variable is updated on that clock cycle. If one is not
updated, a clock enabled register is inferred, with appropriate
circuit to drive the enable input.

BTW, "Z" is not synonymous with "don't care," it is a tri-state (high
impedance) value used "turn off" a driver on busses with more than one
driver. If your target hardware does not support a tri-state bus
internally, the synthesis tool will convert tri-state busses to
multiplexers for you (probably not what you intended in this case).
"Don't care" is usually specified as either 'X' or '-'.

Andy

Tricky 01-22-2009 09:01 AM

Re: sw guy question about latches
 
A clock enablled register uses the following VHDL template:

process(clk)
begin
if rising_edge(clk) then
if enable = '1' then
--do stuff
end if;
end if;
end process;

What you have built by removing the defaults is NOT registers - but
latches. The 2 process state machine process requires that all signals
in the process be assigned a value for EVERY possible case. The
defaults are there as default conditions, and so will always assign a
value unless specified.

The easiest way to avoid this is to move the whole state machine into
a single process, then you CANNOT infer transparent latches.


All times are GMT. The time now is 04:43 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57