mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Local clock domain example
This commit is contained in:
parent
bd8bbd9305
commit
208e039bbb
1 changed files with 17 additions and 0 deletions
17
examples/basic/local_cd.py
Normal file
17
examples/basic/local_cd.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from migen.fhdl.structure import *
|
||||
from migen.fhdl.module import Module
|
||||
from migen.fhdl import verilog
|
||||
from migen.genlib.divider import Divider
|
||||
|
||||
class CDM(Module):
|
||||
def __init__(self):
|
||||
self.submodules.divider = Divider(5)
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
|
||||
class MultiMod(Module):
|
||||
def __init__(self):
|
||||
self.submodules.foo = CDM()
|
||||
self.submodules.bar = CDM()
|
||||
|
||||
mm = MultiMod()
|
||||
print(verilog.convert(mm, {mm.foo.cd_sys.clk, mm.bar.cd_sys.clk}))
|
Loading…
Reference in a new issue