Mail Archives: geda-user/2012/02/20/06:45:16
On 02/20/2012 01:21 AM, DJ Delorie wrote:
>> I suppose the "=" (blocking) makes the code sequential,
> NOT SEQUENTIAL. Think "series wired". "=" means "if the signal has
> been re-defined by some previous logic, use that new output'd signal
> as my input". "<=" means "my inputs will always be the original
> signals."
okay, consider these examples - in both cases think about what happens
if the 2 statements are swapped :
always @(posedge clk)
count = count + 1;
some_output = count;
now this one:
always @(posedge clk)
count < count + 1;
some_output = count;
The first one, the order of statements is important. The second one
the order is arbitrary as far as the logic goes - maybe it's easier to
read though. So in a manner of thinking, the 1st one is sequential in
that the count has to complete before some_output can change.
Maybe we are saying the same thing :)
> Remember, verilog is a SCHEMATIC. It is NOT CODE. It is wires and
> gates and latches.
I don't see it that way. There are a lot of constructs that cannot be
synthesized but work great for things like test benches. But you
probably mean for an fpga. Still, I don't think about it as a schematic.
How the tools implement my case statement, or how it demorganizes my
logic, for example, really is unimportant. Don't get me wrong - I don't
close a blind eye to the fact that this builds gates - it's just not the
first thing I think of.
> The problem with propogation delay, is you might not meet the setup
> times for whoever uses those values. At high clock speeds, you need
> the latches to re-synchronize everything and reset the setup times vs
> propogation delays.
All modern synthesis/place+route tools are similar. If you constrain the
design by telling it the clock rate, it will do it's best to meet the
setup/hold times on all internal logic. If it fails, it tells you.
Again, I don't want to think about the exact implementation - let the
tools do that for you.
>
> Don't confuse verilog "registers" with hardware "latches". Registers
> are just "values you can change" but they could easily be the output
> of a NAND gate or even just a wire, not always a physical latch.
>
But it still consumes extra resources. That's all I was saying.
- Raw text -