ad9xxx: fix gpio signal length

This commit is contained in:
Sebastien Bourdeauducq 2015-08-22 13:12:30 +08:00
parent fba05531f4
commit d38f1e6796

View File

@ -55,7 +55,11 @@ class AD9xxx(Module):
dts.oe.eq(~rx)
]
gpio = Signal(flen(pads.sel) + 1)
if hasattr(pads, "sel"):
sel_len = flen(pads.sel)
else:
sel_len = flen(pads.sel_n)
gpio = Signal(sel_len + 1)
gpio_load = Signal()
self.sync += If(gpio_load, gpio.eq(bus.dat_w))
if hasattr(pads, "rst"):