1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00
2008-11-19 21:19:13 +01:00

24 lines
404 B
Python

from myhdl import *
CONTENT = (17, 134, 52, 9)
def rom(dout, addr, CONTENT):
""" ROM model """
@always_comb
def read():
dout.next = CONTENT[int(addr)]
return read
dout = Signal(intbv(0)[8:])
addr = Signal(intbv(0)[4:])
CONTENT = (17, 134, 52, 9)
def main():
toVerilog(rom, dout, addr, CONTENT)
toVHDL(rom, dout, addr, CONTENT)
if __name__ == '__main__':
main()