fhdl.cd: rename ClockDomain.{reset→rst}.
This commit is contained in:
parent
e0a81edf4d
commit
d2e2d00e45
|
@ -415,7 +415,7 @@ def convert_fragment(builder, fragment, name, top, clock_domains):
|
||||||
for cd_name, _ in fragment.iter_sync():
|
for cd_name, _ in fragment.iter_sync():
|
||||||
cd = clock_domains[cd_name]
|
cd = clock_domains[cd_name]
|
||||||
xformer(cd.clk)
|
xformer(cd.clk)
|
||||||
xformer(cd.reset)
|
xformer(cd.rst)
|
||||||
|
|
||||||
# Transform all subfragments to their respective cells. Transforming signals connected
|
# Transform all subfragments to their respective cells. Transforming signals connected
|
||||||
# to their ports into wires eagerly makes sure they get sensible (prefixed with submodule
|
# to their ports into wires eagerly makes sure they get sensible (prefixed with submodule
|
||||||
|
@ -488,7 +488,7 @@ def convert_fragment(builder, fragment, name, top, clock_domains):
|
||||||
cd = clock_domains[cd_name]
|
cd = clock_domains[cd_name]
|
||||||
triggers.append(("posedge", xformer(cd.clk)))
|
triggers.append(("posedge", xformer(cd.clk)))
|
||||||
if cd.async_reset:
|
if cd.async_reset:
|
||||||
triggers.append(("posedge", xformer(cd.reset)))
|
triggers.append(("posedge", xformer(cd.rst)))
|
||||||
else:
|
else:
|
||||||
raise ValueError("Clock domain {} not found in design".format(cd_name))
|
raise ValueError("Clock domain {} not found in design".format(cd_name))
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ def convert(fragment, ports=[], clock_domains={}):
|
||||||
# Clock domain reset always takes priority over all other logic. To ensure this, insert
|
# Clock domain reset always takes priority over all other logic. To ensure this, insert
|
||||||
# decision trees for clock domain reset as the very last step before synthesis.
|
# decision trees for clock domain reset as the very last step before synthesis.
|
||||||
fragment = xfrm.ResetInserter({
|
fragment = xfrm.ResetInserter({
|
||||||
cd.name: cd.reset for cd in clock_domains.values() if cd.reset is not None
|
cd.name: cd.rst for cd in clock_domains.values() if cd.rst is not None
|
||||||
})(fragment)
|
})(fragment)
|
||||||
|
|
||||||
ins, outs = fragment._propagate_ports(ports, clock_domains)
|
ins, outs = fragment._propagate_ports(ports, clock_domains)
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ClockDomain:
|
||||||
clk : Signal, inout
|
clk : Signal, inout
|
||||||
The clock for this domain. Can be driven or used to drive other signals (preferably
|
The clock for this domain. Can be driven or used to drive other signals (preferably
|
||||||
in combinatorial context).
|
in combinatorial context).
|
||||||
reset : Signal or None, inout
|
rst : Signal or None, inout
|
||||||
Reset signal for this domain. Can be driven or used to drive.
|
Reset signal for this domain. Can be driven or used to drive.
|
||||||
"""
|
"""
|
||||||
def __init__(self, name=None, reset_less=False, async_reset=False):
|
def __init__(self, name=None, reset_less=False, async_reset=False):
|
||||||
|
@ -41,8 +41,8 @@ class ClockDomain:
|
||||||
|
|
||||||
self.clk = Signal(name=self.name + "_clk")
|
self.clk = Signal(name=self.name + "_clk")
|
||||||
if reset_less:
|
if reset_less:
|
||||||
self.reset = None
|
self.rst = None
|
||||||
else:
|
else:
|
||||||
self.reset = Signal(name=self.name + "_reset")
|
self.rst = Signal(name=self.name + "_rst")
|
||||||
|
|
||||||
self.async_reset = async_reset
|
self.async_reset = async_reset
|
||||||
|
|
|
@ -58,8 +58,8 @@ class Fragment:
|
||||||
for cd_name, _ in self.iter_sync():
|
for cd_name, _ in self.iter_sync():
|
||||||
cd = clock_domains[cd_name]
|
cd = clock_domains[cd_name]
|
||||||
self_used.add(cd.clk)
|
self_used.add(cd.clk)
|
||||||
if cd.reset is not None:
|
if cd.rst is not None:
|
||||||
self_used.add(cd.reset)
|
self_used.add(cd.rst)
|
||||||
|
|
||||||
# Our input ports are all the signals we're using but not driving. This is an over-
|
# Our input ports are all the signals we're using but not driving. This is an over-
|
||||||
# approximation: some of these signals may be driven by our subfragments.
|
# approximation: some of these signals may be driven by our subfragments.
|
||||||
|
|
Loading…
Reference in a new issue