Budget a preview path as buffers move into or out of shared memory.
Hardware context: Camera preview pipeline. Multimedia subsystem planning
This exercise processes 4 million active pixels each second. A raw pixel occupies one byte, a processed pixel three. Count only payload crossing the shared-memory port. Use decimal MB/s.
This worksheet uses named constants. The first three entries show how to record your decisions.
Replace each unresolved value of 255 with your result.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
A spill writes a buffer and reads it back once. A direct stream bypasses memory. Ignore headers, blanking, compression and cache traffic. Count padding only where specified. Each ticket starts fresh.
| Entry | Your decision |
|---|---|
| RAW_WRITE | Write one raw buffer each frame. |
| RGB_WRITE | Write one processed buffer each frame. |
| SCAN | Read the processed buffer once for scanout. |
| DIRECT | Stream every stage directly, including scanout. |
| PREVIEW | Stream raw, then spill the processed buffer. |
| BOTH | Spill both raw and processed buffers. |
| FANOUT | Spill both. A second consumer also reads the processed buffer once. |
| HALF | Spill both, but discard alternate whole frames before either spill. |
| STRIDE | Spill processed only. Pad each 12-byte group to 16 bytes on both transfers. |
| PORT_MBPS | Spill raw once. Write processed once, then read it READERS times. |
Examples
Example 1
RAW WRITE- Input
Write one raw buffer each frame.
- Output
matches = 1
Four million one-byte writes cost 4 MB/s. (mb_per_s = 4)
Example 2
RGB WRITE- Input
Write one processed buffer each frame.
- Output
matches = 1
Each processed pixel costs three bytes to store. (mb_per_s = 12)
Example 3
SCAN- Input
Read the processed buffer once for scanout.
- Output
matches = 1
Scanout reads the same twelve million bytes each second. (mb_per_s = 12)
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For PORT_MBPS, enter a constant expression using READERS. Only this entry changes with the parameter. The supported integer range is 0 through 6, inclusive.
Hints
Hint 1
Mark only arrows crossing memory.
Hint 2
Use the format and rate at that edge.
Hint 3
Include reads and writes in the total.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
14 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 2 problems on this path