2013-05-22 11:11:09 -04:00
|
|
|
from migen.fhdl.std import *
|
2013-02-22 13:10:02 -05:00
|
|
|
from migen.fhdl.specials import SynthesisDirective
|
2012-09-10 17:46:19 -04:00
|
|
|
from migen.fhdl import verilog
|
2013-02-23 13:04:11 -05:00
|
|
|
from migen.genlib.cdc import *
|
2012-09-10 17:46:19 -04:00
|
|
|
|
2013-02-23 13:04:11 -05:00
|
|
|
class XilinxMultiRegImpl(MultiRegImpl):
|
2015-04-13 14:07:07 -04:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
MultiRegImpl.__init__(self, *args, **kwargs)
|
|
|
|
self.specials += set(SynthesisDirective("attribute shreg_extract of {r} is no", r=r)
|
|
|
|
for r in self.regs)
|
2012-09-10 17:46:19 -04:00
|
|
|
|
2013-02-23 13:14:31 -05:00
|
|
|
class XilinxMultiReg:
|
2015-04-13 14:07:07 -04:00
|
|
|
@staticmethod
|
|
|
|
def lower(dr):
|
|
|
|
return XilinxMultiRegImpl(dr.i, dr.o, dr.odomain, dr.n)
|
2012-09-10 17:46:19 -04:00
|
|
|
|
2013-02-23 13:04:11 -05:00
|
|
|
ps = PulseSynchronizer("from", "to")
|
2013-03-12 11:45:28 -04:00
|
|
|
v = verilog.convert(ps, {ps.i, ps.o}, special_overrides={MultiReg: XilinxMultiReg})
|
2012-09-10 17:46:19 -04:00
|
|
|
print(v)
|