From 38b888ff9dc612dabd4df9382f9bdd4c4e1e65d2 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 16 Apr 2022 16:26:33 +0100 Subject: [PATCH] select width is data_width // data granularity. (common mistake to make, confused the hell out of me too) --- src/soc/bus/wb_async.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, -- 2.30.2