2013-05-22 11:11:09 -04:00
|
|
|
from migen.fhdl.std import *
|
2012-01-27 14:22:17 -05:00
|
|
|
from migen.fhdl import verilog
|
|
|
|
|
2013-03-12 11:45:28 -04:00
|
|
|
class Example(Module):
|
2015-04-13 14:07:07 -04:00
|
|
|
def __init__(self):
|
|
|
|
self.specials.mem = Memory(32, 100, init=[5, 18, 32])
|
|
|
|
p1 = self.mem.get_port(write_capable=True, we_granularity=8)
|
|
|
|
p2 = self.mem.get_port(has_re=True, clock_domain="rd")
|
|
|
|
self.specials += p1, p2
|
|
|
|
self.ios = {p1.adr, p1.dat_r, p1.we, p1.dat_w,
|
|
|
|
p2.adr, p2.dat_r, p2.re}
|
2012-01-27 14:22:17 -05:00
|
|
|
|
2013-03-12 11:45:28 -04:00
|
|
|
example = Example()
|
|
|
|
print(verilog.convert(example, example.ios))
|