import inspect
+import warnings
from .._utils import deprecated
from ..hdl.cd import *
in this case.
"""
if isinstance(domain, ClockDomain):
- pass
+ if (domain.name in self._fragment.domains and
+ domain is not self._fragment.domains[domain.name]):
+ warnings.warn("Adding a clock process that drives a clock domain object "
+ "named {!r}, which is distinct from an identically named domain "
+ "in the simulated design"
+ .format(domain.name),
+ UserWarning, stacklevel=2)
elif domain in self._fragment.domains:
domain = self._fragment.domains[domain]
elif if_exists:
r"^Value defined at .+?/test_sim\.py:\d+ is 4294967327 bits wide, "
r"which is unlikely to simulate in reasonable time$"):
Simulator(dut)
+
+ def test_bug_566(self):
+ dut = Module()
+ dut.d.sync += Signal().eq(0)
+ sim = Simulator(dut)
+ with self.assertWarnsRegex(UserWarning,
+ r"^Adding a clock process that drives a clock domain object named 'sync', "
+ r"which is distinct from an identically named domain in the simulated design$"):
+ sim.add_clock(1e-6, domain=ClockDomain("sync"))