From dac10f5570615a70a670347b08ad9919e8738f5d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 26 Aug 2013 20:33:34 +0200 Subject: [PATCH] bus/wb2lasmi: use existing interface to determine WB width to be consistent with other modules --- migen/bus/wishbone2lasmi.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migen/bus/wishbone2lasmi.py b/migen/bus/wishbone2lasmi.py index d8ce1d5b..39a9daeb 100644 --- a/migen/bus/wishbone2lasmi.py +++ b/migen/bus/wishbone2lasmi.py @@ -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: -- 2.30.2