Cpu: why only on posedge?

OP #5464506
Rate this post
• ▲ useful
▼ not useful
Hi,
I've been training my fpga skills but I still have a question.

https://github.com/ejrh/cpu/blob/master/rtl/alu.v

This page is a cpu ALU.
I am wondering why we should wait on a posedge to restrict the execution 
flow. We could have better parallelism, albeit with a supporting 
compiler.

Thanks
Guest #5464515
Rate this post
• ▲ useful
▼ not useful
Mark L. wrote:

> I am wondering why we should wait on a posedge to restrict the execution
> flow. We could have better parallelism, albeit with a supporting
> compiler.

There are asynchrounous designs but mostly there a larger than the 
synchronous ones.

http://haltenraum.com/article/asynchrone-schaltung
https://en.wikipedia.org/wiki/Asynchronous_circuit
http://www.tkt.cs.tut.fi/kurssit/3520/K13/CH_16.pdf
https://en.wikipedia.org/wiki/C-element
Moderator (Company: Titel) #5464537
Rate this post
• ▲ useful
▼ not useful
Mark L. wrote:
> wondering why we should wait on a posedge to restrict the execution flow.
How do you expect to get a working adresscounter without a clock? (a 
hint: a "combinatorial loop" is usually not desirable in a design).
How would you read code without an consistent adresscounter?

Mark L. wrote:
> Ok, so  if I understand correctly adding negedge is a bad idea here
It virtually doubles the clock frequency in your design. Because it 
leaves you only half the time to setup for the next active clock edge.
In fact due to an asymmetric clock it's a little bit more than factor 2.
Moderator (Company: Titel) #5464787
Rate this post
• ▲ useful
▼ not useful
Mark L. wrote:
> So with a negedge, the whole system becomes unpredictable
No, it's perfectly predictable as long as you specify the clock 
correctly to the toolchain.

When having only one active clock edge (only rising or falling) and your 
logic needs 10ns to get stable then you get something around 100MHz.

When using both edges as active edges and your logic needs 10ns to get 
stable, then you need that time between two consecutive edges, then you 
must halve your clock frequency to 50MHz.

So at the end nothing is won.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.