Unlocking Host Managed Device Memory with Rambus CXL 2.0 Controller

Updated on Jun 26,2024

Unlocking Host Managed Device Memory with Rambus CXL 2.0 Controller

Table of Contents

  1. Introduction
  2. Setting Up the Rambus CXL 2.0 Controller
  3. Verifying CXL Device Links and Configuration
  4. Accessing Configuration Space via CXL.IO
  5. Mapping CXL.Mem as HDM
  6. Read and Write Operations on CXL.MEM
  7. Memory Access between Host and Device via CXL.MEM
  8. Replicating Operations and Checking Memory Instantiation in the FPGA
  9. Observing Relevant Signals and Capture Window
  10. Conclusion

📦 Setting Up the Rambus CXL 2.0 Controller

In this article, we will explore the setup and usage of the Rambus CXL 2.0 controller using the CXL.MEM protocol to access the Host Managed Device Memory (HDM). The setup includes a control PC with multiple tools, such as a serial console client, the Intel debugger, and the FPGA programming tool. The server host is powered by Intel's pre-production Xeon CPU, codenamed Sapphire Rapids, which supports CXL. The motherboard of the Sapphire Rapids platform comes with a COM port for BIOS, a new AFI and MIP port, and a CPU debug interface connected through CXL interconnects. To begin, let's verify the CXL device links and configuration.

👀 Verifying CXL Device Links and Configuration

To ensure proper functionality, it is essential to verify that the CXL device links up, gets enumerated, and is configured by the host. We can access the configuration space via the CXL.IO and perform tests and debugging using the UEFI shell. By executing commands in the UEFI shell, we can establish that the CXL link is up and running. We can also identify the Rambus vendor ID, the CXL 2.0 controller device, and its corresponding bus device and function. Next, we can access the configuration space using the "pci-6b0000" command and check if the vendor ID and device IDs are as expected.

The configuration space also provides information about the CXL status, including the enabled protocols like CXL.IO.MEM.CACHE and the number of HTMs (Host Translation Units). By examining specific addresses in the configuration space, we can determine the CXL type (Type 2, Type 3, etc.) and the supported protocols. With this verification complete, we can now move forward to accessing the CXL.MEM and mapping it as HDM.

🗺 Mapping CXL.MEM as HDM

The memory located on the CXL device can be mapped as HDM. By examining the specified address in the configuration space, we can identify the CXL.MEM HDM region. In the demonstration, the HDM is mapped at a particular address. This mapping allows us to establish a connection between the host and the device via CXL.MEM, enabling memory access. Having mapped the CXL.MEM as HDM, we can proceed to perform various read and write operations on it.

📝 Read and Write Operations on CXL.MEM

With the CXL.MEM mapped as HDM, we can now execute read and write operations on it. Using commands such as "dmxxx," we can read specific addresses within the HDM region. In the demonstration, we observe that all the data reads back as 0, which is expected since the HDM is initialized with this value in our device. We can then perform write operations by using the "mm" command followed by the address and data to be written. By subsequently reading back the same address using the "dmemem" command, we observe that the values we just wrote are returned successfully.

💻 Memory Access between Host and Device via CXL.MEM

In this demonstration, we have showcased how CXL.MEM facilitates memory access between the host and the device using the UEFI shell. The read and write operations conducted with the CXL.MEM allow data transfer and manipulation between the two entities. The ability to access HDM via CXL.MEM opens up possibilities for various applications and functionalities. With the memory access validated, let us replicate these operations and ensure the proper instantiation of memory in the FPGA attached to the CXL.MEM interface.

🔄 Replicating Operations and Checking Memory Instantiation in the FPGA

To confirm that we have indeed reached the memory instantiated in the FPGA via the CXL.MEM interface, we have implemented probes on the memory interface signals. These probes enable us to observe the relevant signals during the execution of read and write operations. The trigger for these probes is connected to the right enable signal, with a capture window of 8. With the proper setup in place, we can replicate the read and write operations.

By writing 4 bytes at a specific address, we can observe that the trigger is activated 4 times, indicating the successful execution of write operations. The values written at their respective byte positions (0, 1, 2, 3, and 4) are captured. This demonstration provides evidence that we are successfully reaching the HDM memory region in the FPGA using CXL.MEM. The ability to replicate and observe these operations allows for further validation and fine-tuning of the system.

🎯 Observing Relevant Signals and Capture Window

During the replication of read and write operations, it is crucial to pay attention to the relevant signals and the capture window. These signals provide insights into the functioning and interaction of the different components involved. By carefully observing and analyzing the signals, we can identify any potential issues or areas that require optimization.

In our demonstration, a capture window of 8 allows us to capture the necessary data and analyze it effectively. By visualizing the captured write operations, we can validate the consistency of the data and ensure that the expected values are written to and read from the memory. This level of observation and analysis helps in fine-tuning the system for optimal performance.

📝 Conclusion

The Rambus CXL 2.0 controller, along with the CXL.MEM protocol, offers a powerful solution for accessing and manipulating Host Managed Device Memory (HDM). In this article, we explored the setup process and verified the CXL device links and configuration. We also discussed the mapping of CXL.MEM as HDM, performed read and write operations on CXL.MEM, and demonstrated memory access between the host and the device. Lastly, we replicated the operations to check memory instantiation in the FPGA and observed relevant signals and the capture window. These steps highlight the capabilities and advantages of using the Rambus CXL 2.0 controller with the CXL.MEM protocol.

Highlights

  • Setting up the Rambus CXL 2.0 controller for HDM access
  • Verifying CXL device links and configuration
  • Mapping CXL.MEM as HDM for memory access
  • Read and write operations on CXL.MEM
  • Memory access between host and device via CXL.MEM
  • Replicating operations and checking FPGA memory instantiation
  • Observing relevant signals and utilizing the capture window

FAQ

Q: What is the purpose of the Rambus CXL 2.0 controller? The Rambus CXL 2.0 controller enables access and manipulation of Host Managed Device Memory (HDM) using the CXL.MEM protocol.

Q: What tools are required for setting up the Rambus CXL 2.0 controller? The setup for the Rambus CXL 2.0 controller requires a control PC with tools such as a serial console client, the Intel debugger, and the FPGA programming tool.

Q: How is memory access established between the host and the device? Memory access between the host and the device is established using the CXL.MEM protocol.

Q: Can the read and write operations be replicated for validation? Yes, the read and write operations can be replicated to ensure proper instantiation and functioning of memory in the FPGA.

Q: What is the significance of observing relevant signals and the capture window? Observing relevant signals and the capture window allows for analysis and optimization of the system, ensuring optimal performance and functionality.

Most people like