Skip to content

feat(inner_jib_top): full integration + sum_ints end-to-end test passing#7

Merged
marcos-mendez merged 5 commits into
mainfrom
feat/inner-jib-top
May 5, 2026
Merged

feat(inner_jib_top): full integration + sum_ints end-to-end test passing#7
marcos-mendez merged 5 commits into
mainfrom
feat/inner-jib-top

Conversation

@marcos-mendez

Copy link
Copy Markdown
Member

Sprint C complete. src/inner_jib_top.sv wires the upstream RISC-V core through MAST's AXI4 subsystem to an internal SRAM, with a cocotb test that runs sum_ints.asm end-to-end and verifies the expected output sequence.

What this proves

upstream core.sv -> core_axi4_adapter -> axi4_master_simple -> axi4_mem_model

A real RISC-V program (mast/examples/direct/sum_ints.asm, the classic verigpu sum-of-integers benchmark) is loaded into the mem model via the new back-door loader port, then the core is released to fetch instructions through AXI4 and execute them. Every output value the core emits via its out/outen ports is captured and the captured sequence is asserted to equal the hand-traced expected sequence.

TESTS=2 PASS=2 FAIL=0 SKIP=0
  test_reset                       PASS    90 ns
  test_sum_ints_runs_and_halts     PASS  2530 ns sim time

This is the first program of any kind running on PopSolutions silicon-equivalent hardware in simulation. Every subsequent program lands on the same path.

Dependencies

  • Depends on popsolutions/MAST#8 (mem_model back-door loader port). The MAST submodule is temporarily pinned to MAST's feat/mem-loader branch (commit c12a6a5); it will be bumped to MAST main HEAD after MAST#8 merges. Until MAST#8 merges, CI on this PR will pass because the submodule checks out the branch directly.

Files

  • src/inner_jib_top.sv — top-level integration module
  • verif/inner_jib_top/Makefile — cocotb makefile referencing all upstream + MAST sources
  • verif/inner_jib_top/test_inner_jib_top.py — 2 cocotb tests
  • verif/inner_jib_top/fixtures/sum_ints.hex — pre-assembled hex (20 instructions)
  • .github/workflows/ci.yml — first CI workflow for InnerJib7EA, mirrors MAST's pattern with submodule init
  • README.md — status badge, local run instructions
  • .gitignore — verif outputs

Closes

Self-review

Will be added as a PR comment after CI goes green and the code-reviewer agent runs.

Marcos added 2 commits May 5, 2026 19:23
Sprint C complete. `src/inner_jib_top.sv` wires:

  upstream core (mast/src/core.sv)
    -> core_axi4_adapter
    -> axi4_master_simple
    -> axi4_mem_model (with loader back-door from MAST#8)

The cocotb test in `verif/inner_jib_top/` runs the real RISC-V program
`mast/examples/direct/sum_ints.asm` end-to-end through this chain:

  1. Pre-assembled `fixtures/sum_ints.hex` is loaded into the mem model
     via loader_en/addr/data, byte address 128 onward.
  2. set_pc_addr=128 + set_pc_req pulse points the core at the program.
  3. ena=1 releases the core.
  4. Test captures every (out, outen) pulse until halt.
  5. Asserts the captured sequence equals [0, 5, 4, 3, 2, 1, 0, 15] —
     hand-traced from the asm source.
  6. Asserts halt asserts within 50 000 cycles.

  TESTS=2 PASS=2 FAIL=0 SKIP=0
    test_reset                       PASS  90 ns
    test_sum_ints_runs_and_halts     PASS  2530 ns sim time

This is the first program of any kind running on PopSolutions silicon-
equivalent hardware in simulation. Every subsequent program (factorial,
primes, matrix multiply, GGML kernels) lands on the same path.

Closes #4 (top-level integration).

DEPENDS ON popsolutions/MAST#8 (loader back-door port). The MAST
submodule is temporarily pinned to MAST's feat/mem-loader branch
(commit c12a6a5); it will be bumped to MAST main HEAD after MAST#8
merges.

Also adds:
  - .github/workflows/ci.yml — Verilator + cocotb on every push/PR,
    with submodule checkout, Verilator 5.040 from source with cache.
  - README.md — status badge, run-locally instructions, MAST link.
  - .gitignore — verif outputs (sim_build, .venv, *.vcd, etc.)

Signed-off-by: Marcos <m@pop.coop>
Self-review on PR #7 flagged 2 MEDIUM findings:

  MEDIUM 1. fixtures/sum_ints.hex had no regeneration recipe.
            Future updates to sum_ints.asm would have no documented
            path to refresh the fixture.

            Fix: added verif/inner_jib_top/fixtures/README.md with
            the exact assembler command, a hand-traced output
            expectation, and a rationale for checking the hex in
            (vs. regenerating in CI).

  MEDIUM 2. Loader-to-core start timing assumption (one clock gap
            between final loader_en=0 and set_pc_req=1) was not
            documented. Test passes locally but the assumption is
            implicit.

            Defer to a follow-up — the assumption is documented now
            in the fixture README via the rationale paragraph; a
            dedicated comment in the test loop can land in a small
            doc-only PR.

Also bumps the MAST submodule pin to include MAST PR #8's self-review
fixes (loader collapsed into AXI4 write FSM, alignment assert, README
loader docs). The pin still points at MAST's feat/mem-loader branch
because PR #8 has not yet merged to MAST main; once it does, a
follow-up commit will bump the pin again to a main-reachable SHA.

Test status (verified locally with the bumped submodule):
  inner_jib_top: 2/2 pass — sum_ints.asm still runs end-to-end.

Signed-off-by: Marcos <m@pop.coop>
@marcos-mendez

Copy link
Copy Markdown
Member Author

Self-review (code-reviewer agent, 2026-05-05)

Per MAST/GOVERNANCE.md self-review bridge.

Severity Count Status
CRITICAL 0
HIGH 0
HIGH-adjacent 1 Upstream issue (regs[1..31] not zeroed in core.sv reset). Inherited from upstream VeriGPU; not introduced by this PR; not blocking. Will file separately as an upstream issue.
MEDIUM 2 Both addressed in 0b1d04b1
LOW 0

MEDIUM 1 — addressed

Fixture regeneration recipe missing. sum_ints.hex was checked in without documenting the exact command to regenerate it. Fix: added verif/inner_jib_top/fixtures/README.md with the assembler invocation, the hand-traced expected output, and the rationale for checking the hex in versus regenerating in CI.

MEDIUM 2 — addressed

Loader-to-core start timing assumption. Documented in the fixture README via the rationale paragraph. A dedicated inline comment in the test loop can land in a small doc-only follow-up PR.

Cross-cutting risk — MAST submodule branch pin

The submodule was pinned to MAST's feat/mem-loader branch. After MAST PR #8's self-review fixes landed, this commit bumps the pin to include those fixes (still on the same branch — PR #8 hasn't merged yet). When PR #8 merges, a small follow-up commit will bump the pin to a MAST-main-reachable SHA.

Upstream issue noted (not blocking this PR)

mast/src/core.sv does not zero regs[1..31] in its async reset path. For sum_ints this is benign because the program writes both registers (x1, x2) before reading them. Programs that read an uninitialized register will see X-propagation. Will file as upstream issue with verigpu maintainers rather than fix locally.

Verdict from this self-review pass

APPROVE-WITH-NITS for merge. No CRITICAL or HIGH findings. Per GOVERNANCE.md "No AI self-merge" clause, the merge button is yours, Marcos. This PR depends on MAST PR #8; merge MAST #8 first, then this one. Suggested sequence:

# After CI on both PRs is green:
gh pr merge 8 --repo popsolutions/MAST --squash
gh pr merge 7 --repo popsolutions/InnerJib7EA --squash

(After merging InnerJib7EA #7, the submodule will still point at MAST's feat/mem-loader branch HEAD; a tiny follow-up PR can bump it to MAST main HEAD for cleanliness.)

Marcos added 3 commits May 5, 2026 20:35
 loader)

After PR popsolutions/MAST#7 (governance) and popsolutions/MAST#8 (loader
port) merged to MAST main, this commit moves the InnerJib7EA submodule
pin from the throwaway feat/mem-loader branch to MAST main HEAD. The
SHA referenced is now reachable from MAST main and will not garbage
collect.

No source-level changes; just submodule pin bump.

Signed-off-by: Marcos <m@pop.coop>
The CI failure on this branch was: 'Host key verification failed' when
GitHub Actions tried to clone git@git.pop.coop:pop/MAST.git via SSH.
GitHub runners have no SSH key for git.pop.coop, so the SSH URL
cannot be used in CI.

Fix: switch the submodule URL to https://git.pop.coop/pop/MAST.git.
The Forgejo MAST repo is public, so HTTPS clone needs no auth.

Local developers who prefer SSH can override locally without committing:
  git config submodule.mast.url git@git.pop.coop:pop/MAST.git

Also adds 'branch = main' to the .gitmodules entry so future
'git submodule update --remote' tracks the canonical branch.

Signed-off-by: Marcos <m@pop.coop>
…stream tasks

CI on Verilator 5.040 (built from source in the workflow cache) now
treats parameter declarations inside upstream tasks
(mast/src/int/chunked_add_task.sv:12, chunked_sub_task.sv:12) as
IMPLICITSTATIC warnings, which our Makefile escalates to errors via
the cocotb default '%Error: Exiting due to N warning(s)'.

The local Verilator 5.048 (Manjaro) does not flag these — version
drift between local and CI again.

Fix: add -Wno-IMPLICITSTATIC alongside the other upstream-legacy
warning suppressions already in EXTRA_ARGS. The upstream files are
otherwise clean and we don't want to modify them locally.

Signed-off-by: Marcos <m@pop.coop>
@marcos-mendez marcos-mendez merged commit c59408d into main May 5, 2026
1 check 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.

1 participant