Skip to content

Instantly share code, notes, and snippets.

@cfelton
cfelton / simple_2dlos.py
Last active August 29, 2015 14:18
Simple 2D list-of-signals example
from random import randint
from myhdl import *
def m_2dlos(clock, reset, x, y, Nrows=4, Mcols=8):
mem2d = [[Signal(intbv(randint(1, 7689), min=0, max=7690))
for col in range(Mcols)]
for row in range(Nrows)]
rcnt = Signal(modbv(0, min=0, max=4))
ccnt = Signal(modbv(0, min=0, max=8))