2014-08-06 07:38:37 -04:00
|
|
|
from migen.fhdl.std import *
|
|
|
|
from migen.fhdl.specials import Special
|
|
|
|
from migen.fhdl.tools import list_signals
|
|
|
|
|
|
|
|
class AsyncResetSynchronizer(Special):
|
2015-04-13 14:07:07 -04:00
|
|
|
def __init__(self, cd, async_reset):
|
|
|
|
Special.__init__(self)
|
|
|
|
self.cd = cd
|
|
|
|
self.async_reset = async_reset
|
2014-10-17 05:08:37 -04:00
|
|
|
|
2015-04-13 14:07:07 -04:00
|
|
|
def iter_expressions(self):
|
|
|
|
yield self.cd, "clk", SPECIAL_INPUT
|
|
|
|
yield self.cd, "rst", SPECIAL_OUTPUT
|
|
|
|
yield self, "async_reset", SPECIAL_INPUT
|
2014-08-06 07:38:37 -04:00
|
|
|
|
2015-04-13 14:07:07 -04:00
|
|
|
@staticmethod
|
|
|
|
def lower(dr):
|
|
|
|
raise NotImplementedError("Attempted to use a reset synchronizer, but platform does not support them")
|