Use cycles measured on the real ap_rv32 to decide when the CRC engine pays, and which way of attaching it wins.
Hardware context: A CRC engine of ap_soc attached as a register-mapped subordinate, a stream fed by the DMA and a bus manager, beside the real ap_rv32. Accelerator integration and offload decisions
These are the windows that the real five-stage ap_rv32 read from mcycle for the programs of lesson S9.8. The engine takes one word in each cycle. Every way gives the same CRC.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Words | Software CRC | Software sum | Register-mapped | Stream via DMA | Bus manager |
|---|---|---|---|---|---|
| 1 | 269 | 11 | 14 | 18 | 16 |
| 2 | 532 | 18 | 22 | 18 | 16 |
| 3 | 795 | 25 | 30 | 23 | 16 |
| 16 | 4214 | 116 | 134 | 48 | 31 |
| 64 | 16838 | 452 | 518 | 143 | 76 |
For 16 words the lab counted bus transfers. Register-mapped: 34 by the processor. Stream: 13 by the processor and 32 by the DMA. Bus manager: 8 by the processor and 16 by the engine.
Enter a way as 1 software, 2 register-mapped, 3 stream via DMA, 4 bus manager. Enter ratios cut down to a whole number.
| Entry | Your decision |
|---|---|
| FASTEST_16 | For a CRC of 16 words, which way is fastest? |
| SPEEDUP_16 | How many times faster than the software CRC is that way, for 16 words? |
| RM_PER_WORD | How many cycles does each extra word cost the register-mapped way? Use 16 and 64 words. |
| MGR_FLOOR | The fewest cycles that the bus manager way ever needs, from the table. |
| CRC_BREAK_EVEN | From how many words on does the bus manager beat the software CRC? |
| SUM_BREAK_EVEN | From how many words on would the bus manager beat a software sum? |
| RM_VS_SUM | Does the register-mapped way ever beat the software sum? 1 yes, 0 no. |
| FREE_TRANSFERS | For 16 words, how many bus transfers does the processor save with the bus manager, against the register-mapped way? |
| DMA_TRANSFERS | For 16 words, how many bus transfers do the DMA and the engine make together in the stream way? |
| STREAM_VS_MGR | For 64 words, how many cycles does the stream way lose against the bus manager? |
| SUM_OR_ENGINE | A plain sum of N words takes software 7 × N + 4 cycles. The bus manager takes 16 for N up to 5, and 21 for 8. Which is faster: 1 software, 2 the engine? |
Examples
Example 1
FASTEST 16- Input
For a CRC of 16 words, which way is fastest?
- Output
matches = 1
31 cycles, against 48, 134 and 4214.
Example 2
SPEEDUP 16- Input
How many times faster than the software CRC is that way, for 16 words?
- Output
matches = 1
4214 / 31 = 135.9.
Example 3
RM PER WORD- Input
How many cycles does each extra word cost the register-mapped way? Use 16 and 64 words.
- Output
matches = 1
(518 − 134) / 48 = 8: the processor loads the word and stores it into DATA.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For SUM_OR_ENGINE, enter a constant expression using N. Only this entry changes with the parameter. The supported integer range is 1 through 8, inclusive.
Hints
Hint 1
Every hardware way pays a fixed set-up before the first word.
Hint 2
Software pays the work; the register-mapped way pays the moving; the engine pays one cycle.
Hint 3
Light work, like a sum, leaves little for the engine to win.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
11 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