litex/examples/basic/local_cd.py

19 lines
462 B
Python
Raw Normal View History

from migen.fhdl.std import *
2013-03-15 13:18:32 -04:00
from migen.fhdl import verilog
from migen.genlib.divider import Divider
2015-04-13 14:45:35 -04:00
2013-03-15 13:18:32 -04:00
class CDM(Module):
def __init__(self):
self.submodules.divider = Divider(5)
self.clock_domains.cd_sys = ClockDomain(reset_less=True)
2013-03-15 13:18:32 -04:00
2015-04-13 14:45:35 -04:00
2013-03-15 13:18:32 -04:00
class MultiMod(Module):
def __init__(self):
self.submodules.foo = CDM()
self.submodules.bar = CDM()
2013-03-15 13:18:32 -04:00
mm = MultiMod()
print(verilog.convert(mm, {mm.foo.cd_sys.clk, mm.bar.cd_sys.clk}))