a2 = Signal(BV(d_b))
d2 = Signal(BV(w))
re2 = Signal()
-p2 = MemoryPort(a2, d2, re=re2)
+p2 = MemoryPort(a2, d2, re=re2, clock_domain="rd")
mem = Memory(w, d, p1, p2, init=[5, 18, 32])
f = Fragment(memories=[mem])
--- /dev/null
+from migen.fhdl.structure import *
+from migen.fhdl import verilog
+
+# convert pulse into level change
+i = Signal()
+level = Signal()
+isync = [If(i, level.eq(~level))]
+
+# synchronize level to oclk domain
+slevel = [Signal() for i in range(3)]
+osync = [
+ slevel[0].eq(level),
+ slevel[1].eq(slevel[0]),
+ slevel[2].eq(slevel[1])
+]
+
+# regenerate pulse
+o = Signal()
+comb = [o.eq(slevel[1] ^ slevel[2])]
+
+f = Fragment(comb, {"i": isync, "o": osync})
+v = verilog.convert(f, ios={i, o})
+print(v)