Skip to content

docs: add Pipe+FIFO+Dram architecture composition example - #2

Merged
chenshih1 merged 3 commits into
masterfrom
cursor/compose-pipe-fifo-dram-e0b1
Aug 27, 2026
Merged

chenshih1 merged 3 commits into
masterfrom
cursor/compose-pipe-fifo-dram-e0b1

Conversation

@chenshih1

Copy link
Copy Markdown
Owner

Summary

Architecture DES modeling already had Clock/Component/FIFO/Pipe and a cycle-accurate Dram, but nothing showed how they wire together. The existing examples drive Dram from a Component and a raw deque; the README constructed FIFO/Pipe and never connected them.

This PR adds the missing composition template only — not a cache/NoC/CPU model.

Changes

  • examples/pipe_fifo_dram.py: 1 GHz copy engine on two clocks (host + DRAM tCK). Issue Pipe backpressures into a bounded issue FIFO; the FIFO pumps Dram.read; a compute Pipe stalls on Dram.write backpressure. Drained with run_until_idle() from outside the pipeline (no nested flush()).
  • tests/test_des.py: the same wiring — Pipe→FIFO→Dram reads, and a store Pipe that retries until Dram.write accepts.
  • Docs after PR perf: coalesce empty DRAM ticks and fix drive() drain accounting #1 / 0.5.0 drift: README hardware snippet now pumps the FIFO into Dram; docs/quickstart.rst Python floor is 3.10 (was still 3.8); scripts/build_pgo.py trains on benchmarks/bench.py (the 0.5.0 rename) and includes the new example.

Testing

  • ruff check pyramulator/ tests/ benchmarks/ examples/ passes
  • ruff format --check pyramulator/ tests/ benchmarks/ examples/ passes
  • mypy pyramulator/ passes
  • pytest passes (193 tests, 97% coverage)
  • python examples/pipe_fifo_dram.py runs (256-line copy, DRAM pending 0)
  • sphinx-build -W succeeds

Changelog

Yes — [Unreleased] in CHANGELOG.md.

Open in Web Open in Cursor 

@chenshih1
chenshih1 marked this pull request as ready for review August 27, 2026 11:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fc504b3. Configure here.

Comment thread examples/pipe_fifo_dram.py Resolved
Comment thread examples/pipe_fifo_dram.py Resolved
cursoragent and others added 3 commits August 27, 2026 12:30
The public primitives existed but no example or test wired Pipe and
FIFO to Dram. Add a copy-engine example, composition tests, and fix
stale docs (quickstart Python 3.8, README snippet, PGO bench path).

Co-authored-by: chenshih <chenshih1@users.noreply.github.com>
A completed load still occupies a compute slot after _reads_inflight
drops, so max_outstanding does not keep compute_pipe.put from failing.
Call put outside assert (python -O would skip it and drop stores),
reserve a slot at issue time, and hold completions that find the pipe full.

Co-authored-by: chenshih <chenshih1@users.noreply.github.com>
Pipe._deliver still counts the current item in in_flight until the
consumer returns True, so _fill_issue from _on_issue saw can_put()
false on a full pipe (including 1-slot). Schedule a zero-delay refill
after occupancy drops so the copy cannot stall with _produced < n_lines.

Co-authored-by: chenshih <chenshih1@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/compose-pipe-fifo-dram-e0b1 branch from 1cc51af to 6576ba2 Compare August 27, 2026 12:31
@chenshih1
chenshih1 merged commit e4d6f30 into master Aug 27, 2026
9 checks passed
@chenshih1 chenshih1 mentioned this pull request Aug 27, 2026
6 tasks done
@chenshih1
chenshih1 deleted the cursor/compose-pipe-fifo-dram-e0b1 branch August 27, 2026 13:48
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