Decide where each knob of a test must live. Then work out what reusing one image saves against a rebuild for each run.
Hardware context: Knobs of one firmware image written by the bench through apcc's symbol table. Deciding where knobs must live and what reuse saves.
A regression runs one C test with many seeds. Each run is 8,000 cycles long. A run on the live server costs 28 ms before its first cycle, to start the bench and reset. Then its cycles run at 80,000 a second. A rebuild adds a compile and link of 515 ms. These are costs measured on the live server (stage E8, facts 27.13). Round down.
This worksheet uses named constants. The first three entries show how to record your decisions.
Replace each unresolved value of 65535 with your result.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Code | What happens to a symbol-table write |
|---|---|
| 1 | .data: the write is kept |
| 2 | .bss: start-up code clears the write |
| 3 | folded into the code: nothing reads the write |
| 4 | kept: written after start-up code |
| Entry | Your decision |
|---|---|
| REUSE_MS | Milliseconds of one run that reuses the image. |
| REBUILD_MS | Milliseconds of one run that rebuilds first. |
| SAVED_S | Seconds saved over 1,000 seeds by reusing one image. |
| KNOB_A | "volatile unsigned rounds = 4;" written by the bench before the first instruction. |
| KNOB_B | "volatile unsigned mode = 0;" written before the first instruction. |
| KNOB_C | "const unsigned count = 8;" written before the first instruction. |
| KNOB_D | "volatile unsigned late;" written after a hand-shake in main. |
| KNOB_E | "volatile unsigned seed __attribute__((section(".data"))) = 0;" written before the first instruction. |
| REUSE_AT | Milliseconds of one run that reuses the image, when a run is RUN_K thousand cycles long. |
Examples
Example 1
REUSE MS- Input
Milliseconds of one run that reuses the image.
- Output
matches = 1
28 + 8,000 × 1,000 / 80,000 = 128.
Example 2
REBUILD MS- Input
Milliseconds of one run that rebuilds first.
- Output
matches = 1
515 + 128.
Example 3
SAVED S- Input
Seconds saved over 1,000 seeds by reusing one image.
- Output
matches = 1
1,000 rebuilds of 515 ms.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For REUSE_AT, enter a constant expression using RUN_K. Only this entry changes with the parameter. The supported integer range is 8 through 400, inclusive.
Hints
Hint 1
A first value other than 0: .data. None or 0: .bss. const: folded.
Hint 2
Before start-up code, .bss loses it; after, nothing does.
Hint 3
A rebuild adds the compile to every run.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
13 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