class SimpleCRG(Module):
def __init__(self, platform, clk_name, rst_name, rst_invert=False):
+ self._clk = platform.request(clk_name)
+ self._rst = platform.request(rst_name)
self.clock_domains.cd_sys = ClockDomain()
- self.comb += self.cd_sys.clk.eq(platform.request(clk_name))
+ self.comb += self.cd_sys.clk.eq(self._clk)
if rst_invert:
- self.comb += self.cd_sys.rst.eq(~platform.request(rst_name))
+ self.comb += self.cd_sys.rst.eq(~self._rst)
else:
- self.comb += self.cd_sys.rst.eq(platform.request(rst_name))
+ self.comb += self.cd_sys.rst.eq(self._rst)
class CRG_SE(SimpleCRG):
def __init__(self, platform, clk_name, rst_name, period, rst_invert=False):
SimpleCRG.__init__(self, platform, clk_name, rst_name, rst_invert)
- _add_period_constraint(platform, self.cd_sys.clk, period)
+ _add_period_constraint(platform, self._clk, period)
class CRG_DS(Module):
def __init__(self, platform, clk_name, rst_name, period, rst_invert=False):