mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
11 lines
431 B
Python
11 lines
431 B
Python
from migen.fhdl.structure import *
|
|
from migen.fhdl.module import Module
|
|
|
|
class SimpleCRG(Module):
|
|
def __init__(self, platform, clk_name, rst_name, rst_invert=False):
|
|
self.clock_domains.cd_sys = ClockDomain()
|
|
self.comb += self.cd_sys.clk.eq(platform.request(clk_name))
|
|
if rst_invert:
|
|
self.comb += self.cd_sys.rst.eq(~platform.request(rst_name))
|
|
else:
|
|
self.comb += self.cd_sys.rst.eq(platform.request(rst_name))
|