Skip to content

Replace the local interconnect with a software-configurable HCI (log) interconnect - #111

Open
luca24balboni wants to merge 2 commits into
mainfrom
lb/Collectives-Parametrize-Magiav4-HCI
Open

luca24balboni wants to merge 2 commits into
mainfrom
lb/Collectives-Parametrize-Magiav4-HCI

Conversation

@luca24balboni

@luca24balboni luca24balboni commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR replaces the local interconnect of magia_isle and makes the arbitration between accelerators and cores configurable from software. It also lets RedMulE access the TCDM at misaligned addresses.

New interconnect:
magia_hci_interconnect replaces local_interconnect, and HCI moves to 2.6.1.

Configurable arbitration:
A new control register (obi_slave_ctrl_hci) sets how the interconnect arbitrates between the wide side (RedMulE and iDMA) and the narrow side (cores).
It controls which side has priority and a programmable priority ratio.
At reset the policy is a fair 1:2 round-robin.

RedMulE misaligned access:
RedMulE can now access the TCDM at addresses that are not aligned to a bank word.
The new TileCfg.RedMule.MisalignedAccess enables it, and it is on by default.
When it is on, the RedMulE HCI port is one bank word (32 bit) wider, so it uses one more bank on the interconnect.

Tests and SW
New magia_stats.h, which now holds the cycle and time counter helpers previously in magia_tile_utils.h.
New test hci_arb_redmule_bench: a RedMulE run under the different arbitration policies.
matmul_compare_spatz_test updated.

@luca24balboni luca24balboni self-assigned this Sep 30, 2026
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4-HCI branch 6 times, most recently from 664bb7d to 950cee1 Compare October 7, 2026 14:07
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4-HCI branch 8 times, most recently from c3c7b8e to 95884cb Compare October 26, 2026 09:59
@luca24balboni
luca24balboni changed the base branch from main to lb/Collectives-Parametrize-Magiav4 October 26, 2026 11:08
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4-HCI branch from 6ec7f6c to fc4872e Compare November 4, 2026 11:16
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4 branch from 21ed3a4 to 3b40b77 Compare November 4, 2026 11:16
@FrancescoConti

Copy link
Copy Markdown
Member

Ciao, I will look at the code in more detail but one thign that I think should go here is the support for misaligned access in RedMulE. I thought we had that already, but it's disabled.

Claudio-generated instructions to enable it (I did not check the specific lines of code but generally speaking they check out):

  1. hw/tile/magia_redmule_wrap.sv
    • Add the parameter parameter int unsigned MisalignedAccessSupport = 1.
    • Change the default tcdm width from DW: DataW to DW: DataW + (MisalignedAccessSupport ? 32 : 0).
    • Pass .MisalignedAccessSupport ( MisalignedAccessSupport ) to redmule_top.
    • Keep the EXPECTED_DATAW check on DataW as it is: DataW stays the systolic-array width, which is what redmule_tiler checks.
  2. hw/tile/magia_isle.sv, lines 144–147: add localparam int unsigned RedmuleHciW = RedmuleDataW + 32;. Use it for the data width and the strobe width (RedmuleHciW/BWH) of tile_redmule_data_req_t and tile_redmule_data_rsp_t.
  3. hw/tile/magia_isle.sv, line 1228: change HCI_SIZE_PARAM(hci_redmule_if) from DW: RedmuleDataW to DW: RedmuleHciW.
  4. hw/tile/magia_isle.sv, around line 1665 (i_redmule_wrap): pass .MisalignedAccessSupport ( 1 ).
    • Keep .DataW ( RedmuleDataW ).
    • HCI_SIZE_PARAM(tcdm) already comes from hci_redmule_if, so it follows step 3.
    • The gen_no_redmule branch uses the same types and needs no change.

Maybe instead of defaulting to 1 we can expose this in a package parameter (with default 1 - I really see no reason to not support misaligned access).

@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4-HCI branch from fc4872e to bf4f4ec Compare November 9, 2026 11:47
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4 branch from 3b40b77 to 73caae8 Compare November 9, 2026 11:47
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4-HCI branch from bf4f4ec to 37bc98f Compare November 9, 2026 15:00
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4 branch 2 times, most recently from 2fb9b65 to 08f9a1e Compare November 11, 2026 09:05
@yvantor

yvantor commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Addressing #91

@yvantor yvantor added this to the magia-v4 milestone Nov 12, 2026
@yvantor yvantor linked an issue Nov 12, 2026 that may be closed by this pull request
Base automatically changed from lb/Collectives-Parametrize-Magiav4 to main November 12, 2026 09:00
@luca24balboni
luca24balboni force-pushed the lb/Collectives-Parametrize-Magiav4-HCI branch from 842213e to 54fb751 Compare November 12, 2026 10:29
@luca24balboni
luca24balboni marked this pull request as ready for review November 12, 2026 12:20

This branch has not been deployed

No deployments
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.

Local interconnect restructuring

3 participants