bus/wb2lasmi: use existing interface to determine WB width to be consistent with other modules

This commit is contained in:
Sebastien Bourdeauducq 2013-08-26 20:33:34 +02:00
parent 2cf6b6c768
commit dac10f5570
1 changed files with 5 additions and 2 deletions

View File

@ -6,11 +6,14 @@ from migen.genlib.record import Record, layout_len
# cachesize (in 32-bit words) is the size of the data store, must be a power of 2
class WB2LASMI(Module):
def __init__(self, cachesize, lasmim, data_width=32):
self.wishbone = wishbone.Interface()
def __init__(self, cachesize, lasmim, wbm=None):
if wbm is None:
wbm = wishbone.Interface()
self.wishbone = wbm
###
data_width = flen(self.wishbone.dat_r)
if lasmim.dw < data_width:
raise ValueError("LASMI data width must be >= {dw}".format(dw=data_width))
if (lasmim.dw % data_width) != 0: