Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cdc: reset GrayCounter gray output early
Browse files Browse the repository at this point in the history
* this is not a binary-to-gray encoder, i.e. no pipeline
* binary and gray would otherwise be out-of-sync for one cycle, even and
especially in the same clock domain
* appears to be standard practice to ensure their synchronization
(http://www.sunburst-design.com/papers/CummingsSNUG2008Boston_CDC.pdf)
* causes problems in artiq
jordens committed Jun 30, 2017
1 parent 991edb6 commit 68c1af4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migen/genlib/cdc.py
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ def __init__(self, width, idomain, odomain, timeout=128):
class GrayCounter(Module):
def __init__(self, width):
self.ce = Signal()
self.q = Signal(width, reset_less=True)
self.q = Signal(width)
self.q_next = Signal(width)
self.q_binary = Signal(width)
self.q_next_binary = Signal(width)

0 comments on commit 68c1af4

Please sign in to comment.