From: Sebastien Bourdeauducq Date: Fri, 15 Mar 2013 17:18:32 +0000 (+0100) Subject: Local clock domain example X-Git-Tag: 24jan2021_ls180~2099^2~645 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=208e039bbbd854e63c4632b2085b96e8b99145f0;p=litex.git Local clock domain example --- diff --git a/examples/basic/local_cd.py b/examples/basic/local_cd.py new file mode 100644 index 00000000..ca8200a1 --- /dev/null +++ b/examples/basic/local_cd.py @@ -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}))