From: Sebastien Bourdeauducq Date: Fri, 15 Mar 2013 09:49:18 +0000 (+0100) Subject: CRG: support reset inversion X-Git-Tag: 24jan2021_ls180~2099^2~443^2~56 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37d8029848db6badb0b7de79f890abfe3ea01493;p=litex.git CRG: support reset inversion --- diff --git a/mibuild/crg.py b/mibuild/crg.py index 6448ec49..131b7e62 100644 --- a/mibuild/crg.py +++ b/mibuild/crg.py @@ -10,7 +10,11 @@ class CRG(Module): return r class SimpleCRG(CRG): - def __init__(self, platform, clk_name, rst_name): + def __init__(self, platform, clk_name, rst_name, rst_invert=False): self.cd = ClockDomain("sys") platform.request(clk_name, None, self.cd.clk) - platform.request(rst_name, None, self.cd.rst) + if rst_invert: + rst_n = platform.request(rst_name) + self.comb += self.cd.rst.eq(~rst_n) + else: + platform.request(rst_name, None, self.cd.rst)