Compare commits

...

1 commit

Author SHA1 Message Date
saji 8e046b442a initial coordinator
Some checks failed
Verilator Unit Tests / Test (push) Failing after 3m25s
2024-09-20 14:59:44 -05:00

View file

@ -223,10 +223,40 @@ class Hub75Coordinator(wiring.Component):
def __init__(self, n_strings=1):
self.n_strings = n_strings
super().__init__()
super().__init__(
{
"ctrl": Out(Hub75Ctrl),
"data": data.ArrayLayout(Hub75Data, n_strings),
# TODO: fetching routine? maybe it's passed through.
}
)
def elaborate(self, platform: Platform) -> Module:
m = Module()
# swapline is which buffer we are using vs sending out.
swapline = Signal(1)
# for each string, spawn a swapbuffer + stringdriver and connect.
# don't worry about fetching for now.
self.strings = strings = []
self.buffers = bufs = []
donearr = []
startStrings = Signal(1)
stringsDone = Signal(1)
for i in range(self.n_strings):
sb = SwapBuffer(depth=128, shape=data.ArrayLayout(Rgb666Layout, 2))
bufs += sb
stringdriver = Hub75StringDriver(128)
strings += stringdriver
wiring.connect(m, sb.read_port, stringdriver.bram_port)
m.d.comb += [
self.data[i].eq(stringdriver.display_out),
stringdriver.start.eq(startStrings),
sb.selector.eq(swapline),
]
m.submodules += [sb, stringdriver]
donearr += stringdriver.done
m.d.comb += stringsDone.eq(Cat(*donearr).all())
return m