Skip to content

Commit 35251ed

Browse files
committed
Remove DIGITAL_IO_I3C and make IOs digital permanently
Internal-tag: [#76053] Signed-off-by: Maciej Kurc <[email protected]>
1 parent 2f81fef commit 35251ed

File tree

4 files changed

+21
-50
lines changed

4 files changed

+21
-50
lines changed

src/i3c.sv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
- sel_od_pp_o: Select driver
1818
1919
The sel_od_pp_o signal is synchronized with the {scl,sda} pins.
20-
21-
The Open-Drain and Push-Pull driver behavior is modelled in the i3c_io module
22-
and instantiated in the appropriate i3c_wrapper.
2320
*/
2421
module i3c
2522
import i3c_pkg::*;

src/i3c_wrapper.sv

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,15 @@ module i3c_wrapper #(
103103
`endif
104104
`endif
105105

106-
// digital I3C input and output signals are exposed for the purpose of simulation
107-
`ifdef DIGITAL_IO_I3C
106+
// I3C bus driver signals
108107
input logic scl_i,
109108
input logic sda_i,
110109
output logic scl_o,
111110
output logic sda_o,
111+
output logic scl_oe,
112+
output logic sda_oe,
113+
112114
output logic sel_od_pp_o,
113-
`else
114-
// I3C bus IO
115-
inout wire i3c_scl_io,
116-
inout wire i3c_sda_io,
117-
`endif
118115

119116
// Recovery interface signals
120117
output logic recovery_payload_available_o,
@@ -137,13 +134,6 @@ module i3c_wrapper #(
137134
i3c_pkg::dct_mem_sink_t dct_mem_sink;
138135
`endif // CONTROLLER_SUPPORT
139136

140-
logic scl_phy2io;
141-
logic sda_phy2io;
142-
logic scl_io2phy;
143-
logic sda_io2phy;
144-
logic sel_od_pp;
145-
146-
147137
i3c #(
148138
`ifdef I3C_USE_AHB
149139
.AhbDataWidth(AhbDataWidth),
@@ -229,11 +219,11 @@ module i3c_wrapper #(
229219
`endif
230220
`endif
231221

232-
.i3c_scl_i (scl_io2phy),
233-
.i3c_scl_o (scl_phy2io),
234-
.i3c_sda_i (sda_io2phy),
235-
.i3c_sda_o (sda_phy2io),
236-
.sel_od_pp_o(sel_od_pp),
222+
.i3c_scl_i (scl_i),
223+
.i3c_scl_o (scl_o),
224+
.i3c_sda_i (sda_i),
225+
.i3c_sda_o (sda_o),
226+
.sel_od_pp_o(sel_od_pp_o),
237227

238228
`ifdef CONTROLLER_SUPPORT
239229
.dat_mem_src_i (dat_mem_src),
@@ -290,33 +280,18 @@ module i3c_wrapper #(
290280
);
291281
`endif // CONTROLLER_SUPPORT
292282

293-
`ifdef DIGITAL_IO_I3C
294-
assign scl_io2phy = scl_i;
295-
assign sda_io2phy = sda_i;
296-
assign scl_o = scl_phy2io;
297-
assign sda_o = sda_phy2io;
298-
assign sel_od_pp_o = sel_od_pp;
299-
`else
300-
logic scl_drive_low, sda_drive_low;
301-
logic sda_od, scl_od;
302-
wire i3c_scl_pp_io, i3c_sda_pp_io;
303-
assign scl_drive_low = ~scl_phy2io;
304-
assign sda_drive_low = ~sda_phy2io;
305-
306-
i3c_io xio (
307-
.scl_i(scl_phy2io),
308-
.sda_i(sda_phy2io),
309-
.scl_o(scl_io2phy),
310-
.sda_o(sda_io2phy),
311-
.scl_io(i3c_scl_pp_io),
312-
.sda_io(i3c_sda_pp_io)
313-
);
283+
/*
284+
Truth table.
314285
315-
assign sda_od = sda_drive_low ? 1'b0 : 1'bz;
316-
assign scl_od = scl_drive_low ? 1'b0 : 1'bz;
317-
assign i3c_sda_io = sel_od_pp ? i3c_sda_pp_io : sda_od;
318-
assign i3c_scl_io = sel_od_pp ? i3c_scl_pp_io : scl_od;
286+
sel_od_pp_o | sda_o || sda_oe | IO state
287+
------------+--------++--------+-----------
288+
0 | 0 || 1 | 0
289+
0 | 1 || 0 | hi-z
290+
1 | 0 || 1 | 0
291+
1 | 1 || 1 | 1
292+
*/
319293

320-
`endif
294+
assign sda_oe = sel_od_pp_o || !sda_o;
295+
assign scl_oe = 1'b0;
321296

322297
endmodule

testbench/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
VCS = vcs
44
BUILD_DIR = $(I3C_ROOT_DIR)/testbench/build
55

6-
BUILD_ARGS += +define+DIGITAL_IO_I3C -full64 -sverilog +lint=TFIPC-L
6+
BUILD_ARGS += -full64 -sverilog +lint=TFIPC-L
77
BUILD_ARGS += +libext+.sv +libext+.v
88
BUILD_ARGS += $(foreach dir,$(VERILOG_INCLUDE_DIRS),-y $(dir))
99
BUILD_ARGS += -debug_access+all +memcbk -timescale=1ns/1ps -assert svaext

testbench/tb.sv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
22
`include "i3c_defines.svh"
3-
`define DIGITAL_IO_I3C
43

54
/*
65
Testbench

0 commit comments

Comments
 (0)