Skip to content
VLSI

CXL Protocols Explained: CXL.io, CXL.cache, and CXL.mem

  • 10 min read

Modern computing systems require faster communication between processors, accelerators, and memory devices. Traditional interconnect technologies such as PCI Express (PCIe) provide high-speed connectivity, but emerging workloads involving artificial intelligence, high-performance computing, and data-intensive applications also require efficient memory sharing and cache coherency.

Compute Express Link (CXL) addresses these requirements through a high-speed, cache-coherent interconnect designed for communication between processors and devices. It builds on the PCIe physical and electrical infrastructure while introducing additional protocols for memory access and cache coherency.

CXL defines three major protocols: CXL.io, CXL.cache, and CXL.mem. Although they operate through a common CXL connection, each protocol has a different responsibility. CXL.io handles device discovery, configuration, and I/O-related operations. CXL.cache enables devices to access and cache host memory coherently, while CXL.mem allows the host processor to access memory attached to a CXL device.

Understanding these protocols is important for engineers working on SoC architecture, high-speed interfaces, memory systems, and functional verification.

This article explains how CXL.io, CXL.cache, and CXL.mem work, their differences, device types, transaction flows, and important verification scenarios.

Understanding CXL Architecture

CXL is a multi-protocol interconnect technology that enables communication between a host processor and connected devices. It supports different system configurations, including accelerators with coherent access to host memory and devices that provide additional memory capacity.

A typical CXL system contains the following components:
  • Host Processor: Initiates transactions and manages communication with connected CXL devices.
  • CXL Device: Provides functions such as acceleration, memory expansion, or I/O connectivity.
  • CXL Controller: Manages protocol processing and communication between the device and host.
  • CXL Link: Provides the communication path between the host and device.
  • Device-Attached Memory: Memory connected to a CXL device and made accessible according to the supported device configuration.

The three CXL protocols operate together to support different communication requirements.

Protocol

Primary responsibility

Communication purpose

CXL.io

I/O and device management

Discovery, configuration, registers, interrupts

CXL.cache

Cache coherency

Device access to host memory

CXL.mem

Memory access

Host access to device-attached memory

CXL.io is required for CXL devices, while CXL.cache and CXL.mem are implemented according to the device's intended usage model.

CXL.io Protocol: Input, Output, and Device Management

CXL.io is the basic I/O protocol within the CXL architecture. It is based on PCIe transaction and link-layer mechanisms, with CXL-specific enhancements.

Its main responsibility is to support communication required to discover, configure, and manage connected devices.

Important functions of CXL.io

Device Discovery and Enumeration

When a system starts, the host must identify connected devices and determine their capabilities. CXL.io supports the discovery and enumeration process so that the system can identify and configure the connected CXL device.

Configuration Space Access

The host uses configuration transactions to read and update supported device configuration registers. These operations help establish the resources and settings required for device operation.

Register Access

CXL.io supports register access for device management and control. Software can use these mechanisms to inspect device status and configure supported functions.

Interrupt Handling

Devices may need to notify the host when specific events occur. CXL.io supports interrupt-related operations used for device communication and management.

Error Reporting

CXL.io also supports error reporting mechanisms that help the system identify and manage certain device and communication problems.

Practical example: CXL device initialization

Consider a system containing a host processor connected to a CXL memory device.
  1. The system detects the connected device during startup.
  2. The host performs device discovery and enumeration.
  3. Configuration information is accessed through CXL.io.
  4. The host identifies supported capabilities and configures the device.
  5. The system proceeds with the required memory and device initialization procedures.

This example shows why CXL.io is important even when the primary purpose of a device is memory expansion.

CXL.cache Protocol: Enabling Cache-Coherent Device Access

CXL.cache enables a connected device to access and cache data located in host memory while maintaining cache coherency.

This capability is particularly useful for accelerators that need to work with data already being accessed by the host processor.

Without a coherent mechanism, the host and device could hold different versions of the same data. Managing these copies through software-only approaches can introduce additional overhead and complexity.

CXL.cache provides protocol mechanisms to coordinate data ownership and maintain consistency.

How CXL.cache works

CXL.cache primarily supports communication between the device and host.

  • The device requests access to host memory.
  • The host-side coherence logic evaluates the request.
  • The host may provide data or respond with the required coherence information.
  • The device can cache data according to the protocol rules.
  • Coherence-related requests and responses help maintain consistent data across participating agents.
Host-to-Device and Device-to-Host communication

CXL.cache defines transaction categories for communication in both directions.

Host-to-Device (H2D): The host sends requests, responses, or data towards the device. These transactions participate in the coherence process.

Device-to-Host (D2H): The device sends requests to the host, such as requests involving access to host memory. The host responds according to the coherence requirements.

The protocol uses defined request, response, and data transaction types. The exact transaction flow depends on the operation and the coherence state involved.

Practical example: Accelerator accessing host memory

Imagine an AI accelerator processing a dataset stored in host memory.

  1. The accelerator requests access to a memory location.
  2. The host coherence mechanism checks the current state of the requested data.
  3. The required data or coherence response is returned.
  4. The accelerator uses the data and may retain a coherent cached copy.
  5. Subsequent access and coherence operations follow the protocol rules.

This allows the accelerator and processor to work with shared data while maintaining the required coherence.

CXL.mem Protocol: Accessing Device-Attached Memory

CXL.mem provides a mechanism through which the host processor can access memory attached to a CXL device.

This is an important capability for systems that require additional memory capacity or memory resources located outside the host's directly attached DRAM.

Unlike CXL.cache, which allows a device to cache host memory, CXL.mem enables the host to access device-attached memory.

Important functions of CXL.mem

Host-to-Device Memory Requests

The host processor initiates memory requests targeting the memory attached to the CXL device. These requests are handled through the CXL.mem protocol.

Read Transactions

When the host needs information stored in device-attached memory, it issues a read request. The device processes the request and returns the requested data through the appropriate response flow.

Write Transactions

When the host needs to update device-attached memory, it issues a write operation. The device processes the request and handles the data according to the protocol requirements.

Memory Coherency

CXL.mem operates within the system's defined memory and coherence architecture. The host and device must follow the protocol rules to ensure correct memory access and data handling.

Practical example: Memory expansion

Consider a server that needs more memory capacity for a large application.

A CXL memory device is connected to the host and provides additional memory capacity.

  1. The host discovers and configures the memory device.
  2. The platform identifies the available device-attached memory resources.
  3. The operating system and platform configure the memory according to the supported system architecture.
  4. The processor issues memory requests targeting the configured region.
  5. CXL.mem carries the required read and write transactions between the host and device.

This approach allows a system to use memory resources beyond its directly attached memory modules.

Difference Between CXL.io, CXL.cache, and CXL.mem

All three protocols are important, but their purposes are different. Understanding these differences helps engineers identify which protocol handles a particular operation.

Comparison

CXL.io

CXL.cache

CXL.mem

Main purpose

Device I/O and management

Device caching of host memory

Host access to device memory

Primary requester

Host and supported I/O agents

Device

Host

Memory focus

Configuration and I/O operations

Host-attached memory

Device-attached memory

Coherency role

Does not provide the cache-coherence function of CXL.cache

Supports coherent device caching

Supports defined host access to device memory

Typical use

Enumeration and register access

Accelerator access to host data

Memory expansion


A useful way to remember the difference is:
  • CXL.io: Helps the host discover, configure, and manage the device.
  • CXL.cache: Allows the device to cache host memory coherently.
  • CXL.mem: Allows the host to access memory attached to the device.

These protocols complement one another and enable different CXL system configurations.

CXL Device Types and Protocol Support

CXL devices are commonly classified into three types based on the protocols they support and their intended system usage.

Device Type

Supported protocols

Typical application

Type 1

CXL.io and CXL.cache

Accelerators that access host memory

Type 2

CXL.io, CXL.cache, and CXL.mem

Accelerators with device-attached memory

Type 3

CXL.io and CXL.mem

Memory expansion devices


Type 1 Devices

Type 1 devices support CXL.io and CXL.cache. They can access and cache host memory coherently but do not provide host-managed device memory through CXL.mem.

A SmartNIC or an accelerator that primarily uses host memory is an illustrative use case.


Type 2 Devices

Type 2 devices support all three protocols: CXL.io, CXL.cache, and CXL.mem.

They can combine coherent access to host memory with access to device-attached memory. This makes them useful for accelerators that require both capabilities.


Type 3 Devices

Type 3 devices support CXL.io and CXL.mem. They are primarily designed to provide additional memory capacity to the host.

A CXL memory expander is a common example. It allows the platform to make device-attached memory available for system use.

The exact capabilities and configuration depend on the applicable CXL specification and device implementation.

CXL Transaction Flow: How the Protocols Work Together

Although the three protocols have different responsibilities, they operate through the CXL link to support complete system communication.

Consider a host processor connected to a Type 2 accelerator with device-attached memory.

  1. Device discovery: The host identifies the connected device using CXL.io.
  2. Configuration: The host accesses the device's configuration and control information.
  3. Host memory access: The accelerator requests access to host memory using CXL.cache.
  4. Coherence handling: The host and device exchange the required coherence requests, responses, and data.
  5. Device memory access: The host accesses the accelerator's attached memory using CXL.mem.
  6. Data processing: The accelerator processes the required information using its supported memory and compute resources.

This example demonstrates how the three protocols support different parts of a connected computing system.

CXL Protocol Verification: Important Scenarios

CXL verification requires checking protocol transactions, ordering rules, data integrity, and interactions between the host and connected device.

A verification environment should cover normal operation, boundary conditions, error handling, and different device configurations.

Important verification scenarios include:

CXL.io enumeration: Verify device discovery, configuration access, supported capabilities, and enumeration behaviour.

Configuration register access: Check valid and invalid register operations, access permissions, and expected responses.

CXL.cache transaction verification: Generate H2D and D2H requests, responses, and data transactions. Verify the expected coherence behaviour.

CXL.mem read and write verification: Generate host memory requests and check that the device returns correct data or processes writes correctly.

Transaction ordering: Verify that transactions follow the ordering requirements defined by the selected protocol and configuration.

Error handling: Exercise supported error conditions and check the expected reporting and recovery behaviour.

Reset and initialization: Verify device initialization, reset handling, and the ability to return to the required operational state.

Concurrent traffic: Generate multiple transactions to exercise protocol handling under different traffic conditions.

A robust verification plan should cover each protocol independently and then validate interactions between them.

Building a CXL Verification Environment

A structured verification environment helps engineers check protocol behaviour and identify failures efficiently.

A typical environment may include:
  • UVM sequences: Generate CXL.io, CXL.cache, and CXL.mem traffic.
  • Drivers: Apply transactions to the relevant interfaces.
  • Monitors: Observe protocol requests, responses, and data transfers.
  • Protocol checkers: Validate transaction formats, ordering, and protocol rules.
  • Scoreboards: Compare expected and observed data.
  • Functional coverage: Track protocol operations, transaction types, device configurations, and important scenarios.

SystemVerilog assertions can also be used to check specific protocol properties, while functional coverage helps identify scenarios that have not been exercised.

For engineers developing practical knowledge of these concepts, CXL training covers CXL architecture, transaction layers, CXL.io, CXL.cache, CXL.mem, link layers, and verification topics.

For additional background on high-speed interface concepts, PCIe Protocol Training provides coverage of PCIe architecture, transaction layers, data link layers, and physical-layer concepts. Engineers working on protocol checkers can also explore SystemVerilog coverage and assertions training.


Conclusion

CXL provides a flexible interconnect architecture that supports communication between host processors, accelerators, and memory devices. Its three protocols perform different but complementary functions.

CXL.io handles device discovery, configuration, register access, and I/O-related operations. CXL.cache enables devices to access and cache host memory coherently. CXL.mem allows the host processor to access memory attached to a CXL device.

Understanding the differences between these protocols, their transaction flows, and supported device types is essential for engineers working on modern SoC and high-speed interface designs. A structured verification approach using protocol monitors, scoreboards, assertions, and functional coverage helps validate correct behaviour across different CXL operations.

As CXL continues to support advanced memory and accelerator architectures, knowledge of CXL.io, CXL.cache, and CXL.mem will remain valuable for engineers involved in protocol design, implementation, and functional verification.

Share LinkedIn X WhatsApp