1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00
2005-12-27 14:38:27 +00:00

23 lines
367 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)
if __name__ == '__main__':
main()