From 11ca61e6a7750f677b8b188dbf2410f9fc026f5a Mon Sep 17 00:00:00 2001 From: Rahul Kumar Date: Wed, 25 Nov 2026 07:49:23 -0800 Subject: [PATCH 1/2] iris debug mux implementation --- software/ucie.h | 51 ++++++++++++++++++++--------------------- src/GenUcieHeader.scala | 12 ++++++---- src/Iris.scala | 12 +++++++--- ucie | 2 +- 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/software/ucie.h b/software/ucie.h index 4f3afc5..05cd280 100644 --- a/software/ucie.h +++ b/software/ucie.h @@ -81,32 +81,31 @@ #define UCIE_DEBUG_DATA_WIDTH 0x8ULL #define UCIE_DEBUG_DRIVERCTL 0x35d8ULL #define UCIE_DEBUG_DRIVERCTL_WIDTH 0x8ULL -#define UCIE_DEBUG_TXCTL_TILE 0x35f8ULL -#define UCIE_DEBUG_TXCTL_SHUFFLER 0x3600ULL +#define UCIE_DEBUG_TXCTL_TILE 0x35e8ULL +#define UCIE_DEBUG_TXCTL_SHUFFLER 0x35f0ULL #define UCIE_DEBUG_TXCTL_SHUFFLER_WIDTH 0x8ULL -#define UCIE_DEBUG_TX_TEST_STATE 0x3700ULL -#define UCIE_DEBUG_TX_PACKETS_SENT 0x3708ULL -#define UCIE_DEBUG_CLK_MUX_SEL 0x3710ULL -#define UCIE_DEBUG_RX_LANE 0x3718ULL -#define UCIE_DEBUG_RX_BIT 0x3720ULL -#define UCIE_TX_VALID 0x3728ULL -#define UCIE_RX_LFSR_VALID 0x3730ULL -#define UCIE_CONTROLLER_SEL 0x3738ULL -#define UCIE_MAINBAND_MODE 0x3740ULL -#define UCIE_SIDEBAND_MODE 0x3748ULL -#define UCIE_CREDIT_FLOW_ENABLE 0x3750ULL -#define UCIE_TX_VALID_LANE_SEL 0x3758ULL -#define UCIE_RX_VALID_LANE_SEL 0x3760ULL -#define UCIE_LAST_SEEN_TL_REQ 0x3768ULL -#define UCIE_SB_TX_PACKET 0x3770ULL -#define UCIE_SB_TX_SEND 0x3778ULL -#define UCIE_SB_TX_BUSY 0x3780ULL -#define UCIE_SB_RX_PACKET 0x3788ULL -#define UCIE_SB_RX_VALID 0x3790ULL -#define UCIE_SB_RX_POP 0x3798ULL -#define UCIE_SB_RX_OVERFLOW 0x37a0ULL -#define UCIE_SB_RX_RST 0x37a8ULL -#define UCIE_SB_TL_RX_OVERFLOW 0x37b0ULL +#define UCIE_DEBUG_TX_TEST_STATE 0x36f0ULL +#define UCIE_DEBUG_TX_PACKETS_SENT 0x36f8ULL +#define UCIE_DEBUG_MUX_SEL 0x3700ULL +#define UCIE_DEBUG_MUX_SEL_WIDTH 0x8ULL +#define UCIE_TX_VALID 0x3710ULL +#define UCIE_RX_LFSR_VALID 0x3718ULL +#define UCIE_CONTROLLER_SEL 0x3720ULL +#define UCIE_MAINBAND_MODE 0x3728ULL +#define UCIE_SIDEBAND_MODE 0x3730ULL +#define UCIE_CREDIT_FLOW_ENABLE 0x3738ULL +#define UCIE_TX_VALID_LANE_SEL 0x3740ULL +#define UCIE_RX_VALID_LANE_SEL 0x3748ULL +#define UCIE_LAST_SEEN_TL_REQ 0x3750ULL +#define UCIE_SB_TX_PACKET 0x3758ULL +#define UCIE_SB_TX_SEND 0x3760ULL +#define UCIE_SB_TX_BUSY 0x3768ULL +#define UCIE_SB_RX_PACKET 0x3770ULL +#define UCIE_SB_RX_VALID 0x3778ULL +#define UCIE_SB_RX_POP 0x3780ULL +#define UCIE_SB_RX_OVERFLOW 0x3788ULL +#define UCIE_SB_RX_RST 0x3790ULL +#define UCIE_SB_TL_RX_OVERFLOW 0x3798ULL #define UCIE_PCIE_EXT_CAP_ID 0x4000ULL #define UCIE_DVSEC_VENDOR_ID 0x4004ULL #define UCIE_DVSEC_ID 0x4008ULL @@ -379,7 +378,7 @@ static inline void setup_ucie(uintptr_t base) { reg_write64(base + UCIE_TX_CLK_N, UCIE_DEFAULT_CLK_N); reg_write64(base + UCIE_TX_VALID, UCIE_DEFAULT_VALID); reg_write64(base + UCIE_RX_LFSR_VALID, UCIE_DEFAULT_VALID); - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 2; i++) { reg_write64(base + UCIE_DEBUG_DRIVERCTL + 8 * i, UCIE_ENABLE_DRIVER_CTL); } reg_write64(base + UCIE_DEBUG_TXCTL_TILE, UCIE_ENABLE_TX_CTL); diff --git a/src/GenUcieHeader.scala b/src/GenUcieHeader.scala index 12c67d8..b02846b 100644 --- a/src/GenUcieHeader.scala +++ b/src/GenUcieHeader.scala @@ -32,21 +32,25 @@ object GenUcieHeader { // everything that layout depends on. Address, moduleId and the clock // distribution netlist do not reach it: the offsets are relative to each // port's own MMIO base, the moduleId only names modules, and the netlist is - // physical design. + // physical design. Nor does `hasTxDebugLane`: a port without the lane + // keeps its registers' slots, holding nothing. val canonical = ports.map( _.copy( address = ports.head.address, moduleId = ports.head.moduleId, - clkDistLayout = ports.head.clkDistLayout + clkDistLayout = ports.head.clkDistLayout, + hasTxDebugLane = true ) ) require( canonical.forall(_ == canonical.head), "UCIe ports must share a register layout, but their parameters differ " + - s"beyond address, moduleId and clock distribution: ${canonical.distinct.mkString("\n")}" + s"beyond address, moduleId, clock distribution and TX debug lane: ${canonical.distinct.mkString("\n")}" ) + // Rendered with the lane, so its registers come out as real ones; on a + // port without it they read 0 and drop writes. edu.berkeley.cs.uciedigital.tilelink.GenUcieHeader - .render(ports.head, regenCommand) + .render(canonical.head, regenCommand) } def main(args: Array[String]): Unit = { diff --git a/src/Iris.scala b/src/Iris.scala index d6bd59f..a65ea09 100644 --- a/src/Iris.scala +++ b/src/Iris.scala @@ -175,8 +175,8 @@ class IrisTop(implicit p: Parameters) extends LazyModule with BindingScope { // Connect D2D UCIe val uciePorts = UciePort.all(p) - val c2c_ucie0 = IO(new edu.berkeley.cs.uciedigital.tilelink.UcieBumpsIO(uciePorts(0).numLanes)) - val c2c_ucie1 = IO(new edu.berkeley.cs.uciedigital.tilelink.UcieBumpsIO(uciePorts(1).numLanes)) + val c2c_ucie0 = IO(new edu.berkeley.cs.uciedigital.tilelink.UcieBumpsIO(uciePorts(0).numLanes, uciePorts(0).hasTxDebugLane)) + val c2c_ucie1 = IO(new edu.berkeley.cs.uciedigital.tilelink.UcieBumpsIO(uciePorts(1).numLanes, uciePorts(1).hasTxDebugLane)) c2c_ucie0 <> system.d2d_port_ios.get(0) c2c_ucie1 <> system.d2d_port_ios.get(1) } @@ -583,6 +583,11 @@ class IrisConfig(sim: Boolean = false) // in one 2 ns cycle, -0.391 at worst. The block's own timing saw // each half alone, inside the 0.2 ns I/O budget its SDC gives the // outside. A cycle of latency each way. + // + // The chip has one off-chip TX data debug lane, in link 1, on its + // own bump; link 0 is built without one (`hasTxDebugLane`). Both + // keep its registers' slots, so they still share one register + // layout. See docs/ucie-debug-bumps.md in the chip repo. UcieComplexPort(edu.berkeley.cs.uciedigital.tilelink.UcieTLParams( address = 0x200000, managerWhere = SBUS, @@ -590,7 +595,8 @@ class IrisConfig(sim: Boolean = false) queueParams = AsyncQueueParams(depth = 16), includeDefaultModels = true, sim = sim, - managerBuffer = BufferParams.default + managerBuffer = BufferParams.default, + hasTxDebugLane = false )), UcieComplexPort(edu.berkeley.cs.uciedigital.tilelink.UcieTLParams( address = 0x208000, diff --git a/ucie b/ucie index f91d0ad..5e2cdc4 160000 --- a/ucie +++ b/ucie @@ -1 +1 @@ -Subproject commit f91d0add842cd822f4b3a7a9d9d3d33de137654d +Subproject commit 5e2cdc4f437ea46056201c98d8038416a87a8ad7 From a59a8db7cf69417e1b30c2ea97c1ea57d7481875 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 25 Nov 2026 08:40:44 -0800 Subject: [PATCH 2/2] Update ucie submodule --- ucie | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucie b/ucie index 5e2cdc4..c46f8d7 160000 --- a/ucie +++ b/ucie @@ -1 +1 @@ -Subproject commit 5e2cdc4f437ea46056201c98d8038416a87a8ad7 +Subproject commit c46f8d7a92ae0f0b3ca7bf23c40353eea995fa18