Skip to content

Commit 28f6322

Browse files
committed
i3c_controller: Add address width parameters
These values affect considerably the resource utilization, therefore, make them user-configurable. Signed-off-by: Jorge Marques <[email protected]>
1 parent 1055995 commit 28f6322

File tree

4 files changed

+108
-16
lines changed

4 files changed

+108
-16
lines changed

library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface.v

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ***************************************************************************
22
// ***************************************************************************
3-
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
3+
// Copyright (C) 2024-2025 Analog Devices, Inc. All rights reserved.
44
//
55
// In this HDL repository, there are many different and unique modules, consisting
66
// of various HDL (Verilog or VHDL) components. The individual modules are
@@ -36,6 +36,11 @@
3636
`timescale 1ns/100ps
3737

3838
module i3c_controller_host_interface #(
39+
parameter CMD_FIFO_ADDRESS_WIDTH = 4,
40+
parameter CMDR_FIFO_ADDRESS_WIDTH = 4,
41+
parameter SDO_FIFO_ADDRESS_WIDTH = 5,
42+
parameter SDI_FIFO_ADDRESS_WIDTH = 5,
43+
parameter IBI_FIFO_ADDRESS_WIDTH = 4,
3944
parameter ID = 0,
4045
parameter ASYNC_CLK = 0,
4146
parameter OFFLOAD = 1
@@ -140,6 +145,11 @@ module i3c_controller_host_interface #(
140145
endgenerate
141146

142147
i3c_controller_regmap #(
148+
.CMD_FIFO_ADDRESS_WIDTH(CMD_FIFO_ADDRESS_WIDTH),
149+
.CMDR_FIFO_ADDRESS_WIDTH(CMDR_FIFO_ADDRESS_WIDTH),
150+
.SDO_FIFO_ADDRESS_WIDTH(SDO_FIFO_ADDRESS_WIDTH),
151+
.SDI_FIFO_ADDRESS_WIDTH(SDI_FIFO_ADDRESS_WIDTH),
152+
.IBI_FIFO_ADDRESS_WIDTH(IBI_FIFO_ADDRESS_WIDTH),
143153
.ID(ID),
144154
.OFFLOAD(OFFLOAD),
145155
.ASYNC_CLK(ASYNC_CLK)

library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface_hw.tcl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
2+
## Copyright (C) 2024-2025 Analog Devices, Inc. All rights reserved.
33
### SPDX short identifier: ADIBSD
44
###############################################################################
55

@@ -30,6 +30,11 @@ ad_ip_files i3c_controller_host_interface [list \
3030

3131
# Parameters
3232

33+
ad_ip_parameter CMD_FIFO_ADDRESS_WIDTH INTEGER 4
34+
ad_ip_parameter CMDR_FIFO_ADDRESS_WIDTH INTEGER 4
35+
ad_ip_parameter SDO_FIFO_ADDRESS_WIDTH INTEGER 5
36+
ad_ip_parameter SDI_FIFO_ADDRESS_WIDTH INTEGER 5
37+
ad_ip_parameter IBI_FIFO_ADDRESS_WIDTH INTEGER 4
3338
ad_ip_parameter ID INTEGER 0
3439
ad_ip_parameter ASYNC_CLK INTEGER 0
3540
ad_ip_parameter OFFLOAD INTEGER 0

library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface_ip.tcl

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
2+
## Copyright (C) 2024-2025 Analog Devices, Inc. All rights reserved.
33
### SPDX short identifier: ADIBSD
44
###############################################################################
55

@@ -105,6 +105,46 @@ set_property -dict [list \
105105
] \
106106
[ipx::get_user_parameters ID -of_objects $cc]
107107

108+
## CMD_FIFO_ADDRESS_WIDTH
109+
set_property -dict [list \
110+
"value_validation_type" "range_long" \
111+
"value_validation_range_minimum" "1" \
112+
"value_validation_range_maximum" "16" \
113+
] \
114+
[ipx::get_user_parameters CMD_FIFO_ADDRESS_WIDTH -of_objects $cc]
115+
116+
## CMDR_FIFO_ADDRESS_WIDTH
117+
set_property -dict [list \
118+
"value_validation_type" "range_long" \
119+
"value_validation_range_minimum" "1" \
120+
"value_validation_range_maximum" "16" \
121+
] \
122+
[ipx::get_user_parameters CMDR_FIFO_ADDRESS_WIDTH -of_objects $cc]
123+
124+
## SDO_FIFO_ADDRESS_WIDTH
125+
set_property -dict [list \
126+
"value_validation_type" "range_long" \
127+
"value_validation_range_minimum" "1" \
128+
"value_validation_range_maximum" "16" \
129+
] \
130+
[ipx::get_user_parameters SDO_FIFO_ADDRESS_WIDTH -of_objects $cc]
131+
132+
## SDI_FIFO_ADDRESS_WIDTH
133+
set_property -dict [list \
134+
"value_validation_type" "range_long" \
135+
"value_validation_range_minimum" "1" \
136+
"value_validation_range_maximum" "16" \
137+
] \
138+
[ipx::get_user_parameters SDI_FIFO_ADDRESS_WIDTH -of_objects $cc]
139+
140+
## IBI_FIFO_ADDRESS_WIDTH
141+
set_property -dict [list \
142+
"value_validation_type" "range_long" \
143+
"value_validation_range_minimum" "1" \
144+
"value_validation_range_maximum" "16" \
145+
] \
146+
[ipx::get_user_parameters IBI_FIFO_ADDRESS_WIDTH -of_objects $cc]
147+
108148
foreach {k v} { \
109149
"ASYNC_CLK" "false" \
110150
"OFFLOAD" "false" \
@@ -151,6 +191,40 @@ set_property -dict [list \
151191
"tooltip" "\[OFFLOAD\] Allows to offload output data to a external receiver, like a DMA" \
152192
] [ipgui::get_guiparamspec -name "OFFLOAD" -component $cc]
153193

194+
## Command stream FIFO depth configuration
195+
set cmd_stream_fifo_group [ipgui::add_group -name "Command stream FIFO configuration" -component $cc \
196+
-parent $page0 -display_name "Command stream FIFO configuration" ]
197+
198+
ipgui::add_param -name "CMD_FIFO_ADDRESS_WIDTH" -component $cc -parent $cmd_stream_fifo_group
199+
set_property -dict [list \
200+
"display_name" "Command FIFO address width" \
201+
"tooltip" "\[CMD_FIFO_ADDRESS_WIDTH\] Define the depth of the FIFO" \
202+
] [ipgui::get_guiparamspec -name "CMD_FIFO_ADDRESS_WIDTH" -component $cc]
203+
204+
ipgui::add_param -name "CMDR_FIFO_ADDRESS_WIDTH" -component $cc -parent $cmd_stream_fifo_group
205+
set_property -dict [list \
206+
"display_name" "CMDR FIFO address width" \
207+
"tooltip" "\[CMDR_FIFO_ADDRESS_WIDTH\] Define the depth of the FIFO" \
208+
] [ipgui::get_guiparamspec -name "CMDR_FIFO_ADDRESS_WIDTH" -component $cc]
209+
210+
ipgui::add_param -name "SDO_FIFO_ADDRESS_WIDTH" -component $cc -parent $cmd_stream_fifo_group
211+
set_property -dict [list \
212+
"display_name" "SDO FIFO address width" \
213+
"tooltip" "\[SDO_FIFO_ADDRESS_WIDTH\] Define the depth of the FIFO" \
214+
] [ipgui::get_guiparamspec -name "SDO_FIFO_ADDRESS_WIDTH" -component $cc]
215+
216+
ipgui::add_param -name "SDI_FIFO_ADDRESS_WIDTH" -component $cc -parent $cmd_stream_fifo_group
217+
set_property -dict [list \
218+
"display_name" "SDI FIFO address width" \
219+
"tooltip" "\[SDI_FIFO_ADDRESS_WIDTH\] Define the depth of the FIFO" \
220+
] [ipgui::get_guiparamspec -name "SDI_FIFO_ADDRESS_WIDTH" -component $cc]
221+
222+
ipgui::add_param -name "IBI_FIFO_ADDRESS_WIDTH" -component $cc -parent $cmd_stream_fifo_group
223+
set_property -dict [list \
224+
"display_name" "IBI FIFO address width" \
225+
"tooltip" "\[IBI_FIFO_ADDRESS_WIDTH\] Define the depth of the FIFO" \
226+
] [ipgui::get_guiparamspec -name "SDI_FIFO_ADDRESS_WIDTH" -component $cc]
227+
154228
## Create and save the XGUI file
155229
ipx::create_xgui_files $cc
156230
ipx::save_core $cc

library/i3c_controller/i3c_controller_host_interface/i3c_controller_regmap.v

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ***************************************************************************
22
// ***************************************************************************
3-
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
3+
// Copyright (C) 2024-2025 Analog Devices, Inc. All rights reserved.
44
//
55
// In this HDL repository, there are many different and unique modules, consisting
66
// of various HDL (Verilog or VHDL) components. The individual modules are
@@ -37,9 +37,12 @@
3737

3838
`include "i3c_controller_regmap.vh"
3939

40-
`define ADDRESS_WIDTH 8
41-
4240
module i3c_controller_regmap #(
41+
parameter CMD_FIFO_ADDRESS_WIDTH = 4,
42+
parameter CMDR_FIFO_ADDRESS_WIDTH = 4,
43+
parameter SDO_FIFO_ADDRESS_WIDTH = 5,
44+
parameter SDI_FIFO_ADDRESS_WIDTH = 5,
45+
parameter IBI_FIFO_ADDRESS_WIDTH = 4,
4346
parameter ID = 0,
4447
parameter ASYNC_CLK = 0,
4548
parameter OFFLOAD = 1,
@@ -138,7 +141,7 @@ module i3c_controller_regmap #(
138141

139142
// CMD FIFO
140143

141-
wire [`ADDRESS_WIDTH-1:0] cmd_fifo_room;
144+
wire [CMD_FIFO_ADDRESS_WIDTH-1:0] cmd_fifo_room;
142145
wire cmd_fifo_almost_empty;
143146
wire up_cmd_fifo_almost_empty;
144147

@@ -149,7 +152,7 @@ module i3c_controller_regmap #(
149152
// CMDR FIFO
150153

151154
wire cmdr_fifo_data_msb_s;
152-
wire [`ADDRESS_WIDTH-1:0] cmdr_fifo_level;
155+
wire [CMDR_FIFO_ADDRESS_WIDTH-1:0] cmdr_fifo_level;
153156
wire cmdr_fifo_almost_full;
154157
wire up_cmdr_fifo_almost_full;
155158

@@ -160,7 +163,7 @@ module i3c_controller_regmap #(
160163

161164
// SDO FIFO
162165

163-
wire [`ADDRESS_WIDTH-1:0] sdo_fifo_room;
166+
wire [SDO_FIFO_ADDRESS_WIDTH-1:0] sdo_fifo_room;
164167
wire sdo_fifo_almost_empty;
165168
wire up_sdo_fifo_almost_empty;
166169

@@ -172,7 +175,7 @@ module i3c_controller_regmap #(
172175
// SDI FIFO
173176

174177
wire sdi_fifo_data_msb_s;
175-
wire [`ADDRESS_WIDTH-1:0] sdi_fifo_level;
178+
wire [SDI_FIFO_ADDRESS_WIDTH-1:0] sdi_fifo_level;
176179
wire sdi_fifo_almost_full;
177180
wire up_sdi_fifo_almost_full;
178181

@@ -184,7 +187,7 @@ module i3c_controller_regmap #(
184187
// IBI FIFO
185188

186189
wire ibi_fifo_data_msb_s;
187-
wire [`ADDRESS_WIDTH-1:0] ibi_fifo_level;
190+
wire [IBI_FIFO_ADDRESS_WIDTH-1:0] ibi_fifo_level;
188191
wire ibi_fifo_almost_full;
189192
wire up_ibi_fifo_almost_full;
190193

@@ -576,7 +579,7 @@ module i3c_controller_regmap #(
576579

577580
util_axis_fifo #(
578581
.DATA_WIDTH(DATA_WIDTH),
579-
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
582+
.ADDRESS_WIDTH(CMD_FIFO_ADDRESS_WIDTH),
580583
.ASYNC_CLK(ASYNC_CLK),
581584
.M_AXIS_REGISTERED(0),
582585
.ALMOST_EMPTY_THRESHOLD(1),
@@ -608,7 +611,7 @@ module i3c_controller_regmap #(
608611
util_axis_fifo #(
609612
.DATA_WIDTH(DATA_WIDTH),
610613
.ASYNC_CLK(ASYNC_CLK),
611-
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
614+
.ADDRESS_WIDTH(CMDR_FIFO_ADDRESS_WIDTH),
612615
.M_AXIS_REGISTERED(0),
613616
.ALMOST_EMPTY_THRESHOLD(1),
614617
.ALMOST_FULL_THRESHOLD(31)
@@ -641,7 +644,7 @@ module i3c_controller_regmap #(
641644
util_axis_fifo #(
642645
.DATA_WIDTH(DATA_WIDTH),
643646
.ASYNC_CLK(ASYNC_CLK),
644-
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
647+
.ADDRESS_WIDTH(SDO_FIFO_ADDRESS_WIDTH),
645648
.M_AXIS_REGISTERED(0),
646649
.ALMOST_EMPTY_THRESHOLD(1),
647650
.ALMOST_FULL_THRESHOLD(1)
@@ -676,7 +679,7 @@ module i3c_controller_regmap #(
676679
util_axis_fifo #(
677680
.DATA_WIDTH(DATA_WIDTH),
678681
.ASYNC_CLK(ASYNC_CLK),
679-
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
682+
.ADDRESS_WIDTH(SDI_FIFO_ADDRESS_WIDTH),
680683
.M_AXIS_REGISTERED(0),
681684
.ALMOST_EMPTY_THRESHOLD(1),
682685
.ALMOST_FULL_THRESHOLD(31)
@@ -705,7 +708,7 @@ module i3c_controller_regmap #(
705708
util_axis_fifo #(
706709
.DATA_WIDTH(DATA_WIDTH),
707710
.ASYNC_CLK(ASYNC_CLK),
708-
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
711+
.ADDRESS_WIDTH(IBI_FIFO_ADDRESS_WIDTH),
709712
.M_AXIS_REGISTERED(0),
710713
.ALMOST_EMPTY_THRESHOLD(1),
711714
.ALMOST_FULL_THRESHOLD(31)

0 commit comments

Comments
 (0)