Skip to content

MAGIA-V3 Realignment#47

Open
Dequino wants to merge 136 commits into
mainfrom
ad/magia-v3
Open

MAGIA-V3 Realignment#47
Dequino wants to merge 136 commits into
mainfrom
ad/magia-v3

Conversation

@Dequino

@Dequino Dequino commented Jul 13, 2026

Copy link
Copy Markdown
Member

Realignment process for the SDK on the new MAGIA RTL architecture version, including support for the PULP Cluster and using the OpenHW toolchain for the CV32E40P cores.

This PR also includes a redesign and cleanup of the repository, including changing "magia_v1" and "magia_v2" into the real targets (CV32E40X and CV32E40P) to avoid confusion.

New CI tests for pulp cluster will also be added, alognside APIs for managing and running the cluster.

TheSSDGuy and others added 30 commits April 13, 2026 14:44
  - Fix RedMulE register offsets in tile_ctrl.h (X=0x2C, MCFG0=0x20, etc.)
    to match gvsoc LightRedmule req_v2 interface; removes computation errors
    in test_mm_os
  - Restore mcfg_reg1 format bits and MCFG2 write in redmule_isa_utils.h
  - Re-add mhartid guard on BSS clear in crt0.S to prevent hart races
  - Include base magia tests for magia_v3 in all TEST_MAPPINGS branches
…cate task symbols

  Redesign the PULP cluster software interface to align with the new GVSoC
  cluster_regs model:

  API changes (magia_pulp_utils.h):
  - pulp_init(binary) drops the nb_cores argument; broadcasts CLK_EN and
    busy-waits until all PULP cores signal READY
  - pulp_run_task(task, core_mask) accepts a one-hot core bitmask, sets
    nb_cores_to_wait = popcount(mask) internally, writes the mask to PULP_START,
    then polls until PULP_START is cleared by the cores' ACK

  pulp_crt0.S rewritten with a two-phase completion protocol:
  1. ACK phase (before task): each woken hart writes 0 to PULP_START;
     cluster_regs counts ACKs and clears the register, unblocking the CV32 poll
  2. DONE phase (after task): each hart writes 1 to PULP_DONE after the task
     returns; cluster_regs counts DONEs and fires the DONE IRQ to the CV32 event
     unit, waking eu_pulp_wait()

  Task symbol deduplication:
  - Rename hello_task → hello_pulp_task / hello_spatz_task in all test sources
    to avoid HELLO_TASK name collision in combined Spatz+PULP tests
  - Remove stale FIRST_TASK_NAME overrides from CMakeLists (default now matches
    the renamed function names)
  - Update extract_pulp_symbols.sh grep pattern to match renamed symbols
Adds tests/spatz_pulp_on_magia/multi_task — a test that exercises two sequential Spatz tasks and four sequential PULP task dispatches on different core pairs within the same run.

  Spatz tasks (fp16 RVV):
    1. vec_add: vfadd.vv on A+B → C
    2. vec_relu: vfmax.vf(0) on X → Y

  PULP tasks (int32, one pair of cores each):
    1. vec_sum   — cores 0+1  (mask=0x03): parallel partial sums
    2. vec_dot   — cores 2+3  (mask=0x0C): parallel partial dot product
    3. vec_scale — cores 4+5  (mask=0x30): element-wise multiply by scalar
    4. vec_absmax — cores 6+7 (mask=0xC0): parallel absolute maximum

Each PULP task uses pair_local_id = GET_PULP_LOCAL_ID(hartid) % 2 to split work between the two dispatched cores. CV32 verifies all results before proceeding to the next dispatch.
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.

3 participants