Skip to content

Instantly share code, notes, and snippets.

@cr1901
Created September 22, 2015 12:29
Show Gist options
  • Save cr1901/1164f581018d995f8f2d to your computer and use it in GitHub Desktop.
Save cr1901/1164f581018d995f8f2d to your computer and use it in GitHub Desktop.
Migen Simulator "Recursion Depth Exceeded" Example
from migen import *
class Recur(Module):
def __init__(self):
self.divider = Signal(16)
self.half_of_divider = Signal(16)
###
self.sync += [self.half_of_divider[:15].eq(self.divider[1:] - 1)]
def recur_test(m):
yield
if __name__ == "__main__":
m = Recur()
run_simulation(m, recur_test(m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment