Skip to content

Conversation

Razer6
Copy link
Member

@Razer6 Razer6 commented Oct 8, 2025

This PR expands the address-matching capabilities of the xbar generation to support a more flexible matching scheme. Previously, the system was limited to power-of-2 address matching, which uses a bitmask and bitwise operations to check if an address falls within a device's range.

This change is necessary to support a wider range of address configurations, specifically for Darjeeling. The CTN memory in Darjeeling requires routing the address range 1-3 GB to an egress port. This specific range cannot be matched using the existing power-of-2 scheme because the base address and the required mask are overlapping. To handle this, the system needs to fall back to Top-of-Range (TOR) matching, a more generalized and computationally more expensive method.

tlgen and the xbar RTL templates already have support for TOR address matching. This PR enables the topgen tool to utilize this existing functionality. By doing so, it allows for more flexible address configurations beyond the power-of-2 constraint, addressing the specific needs of the Darjeeling project and similar future use cases.

To trigger the case, make the following change in top_darjeeling.hjson:

--- a/hw/top_darjeeling/data/top_darjeeling.hjson
+++ b/hw/top_darjeeling/data/top_darjeeling.hjson
@@ -629,7 +629,7 @@
           data_intg_passthru: "true",
           exec: "True",
           byte_write: "True",
-          size: "0x40000000",
+          size: "0x80000000",
         }
       }
     },

@andreaskurth
Copy link
Contributor

andreaskurth commented Oct 9, 2025

To trigger the case, make the following change in top_darjeeling.hjson:

--- a/hw/top_darjeeling/data/top_darjeeling.hjson
+++ b/hw/top_darjeeling/data/top_darjeeling.hjson
@@ -629,7 +629,7 @@
           data_intg_passthru: "true",
           exec: "True",
           byte_write: "True",
-          size: "0x40000000",
+          size: "0x80000000",
         }
       }
     },

Should we make that change in upstream Darjeeling, so that we can test support of the feature in upstream CI / nightlies? Or wouldn't this work because the Darjeeling-internal address map should stay as-is, while the CTN crossbar outside Darjeeling (after base address translation) has 1-3 GB as the addr range for the egress port?

@Razer6
Copy link
Member Author

Razer6 commented Oct 9, 2025

Should we make that change in upstream Darjeeling, so that we can test support of the feature in upstream CI / nightlies?

If we agree on the approach, I can make this change here. Edit: Added the commit to make the change here.

@Razer6 Razer6 requested review from a team as code owners October 9, 2025 07:23
@Razer6 Razer6 requested review from pamaury and removed request for a team October 9, 2025 07:23
Copy link
Contributor

@andreaskurth andreaskurth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with two suggestions for follow-up changes. Thanks @Razer6!

@Razer6 Razer6 requested review from andreaskurth and removed request for a team and pamaury October 9, 2025 08:12
Copy link
Contributor

@andreaskurth andreaskurth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks @Razer6!

@andreaskurth andreaskurth added this pull request to the merge queue Oct 9, 2025
Merged via the queue into lowRISC:master with commit ba301ee Oct 9, 2025
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants