From: Luke Kenneth Casson Leighton Date: Sat, 16 Apr 2022 15:26:33 +0000 (+0100) Subject: select width is data_width // data granularity. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38b888ff9dc612dabd4df9382f9bdd4c4e1e65d2;p=soc.git select width is data_width // data granularity. (common mistake to make, confused the hell out of me too) --- diff --git a/src/soc/bus/wb_async.py b/src/soc/bus/wb_async.py index 6775427f..9c7b4e2c 100644 --- a/src/soc/bus/wb_async.py +++ b/src/soc/bus/wb_async.py @@ -102,7 +102,11 @@ class WBAsyncBridge(Elaboratable): # Parameters p_ADDR_WIDTH=self.address_width, p_DATA_WIDTH=self.data_width, - p_SELECT_WIDTH=self.granularity, + # width of select is the data width + # *divided* by the data granularity. + # data_width=32-bit, data granularity=8-bit, + # select_width ==> 32/8 ==> 4 + p_SELECT_WIDTH=self.data_width//self.granularity, # Clocks/resets i_wbm_clk=self.wb_mclk,