V1.3.1 Choose the Mode

MediumImplement22 minIcarus Verilog · serverReview the topic

Pick with CPU, without CPU or a fast platform for each chip test. Then use a measured speed to see when software is too long for RTL.

Hardware context: ap_soc driven by its core, by a bus manager, or on a fast platform. Deciding which chip tests are firmware tests and which are bench tests.

One chip, three ways to drive it. For each test, enter the mode that suits it best.

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

SignalWidthRole
question8input of each check
Full specification
CodeMode
1With CPU: firmware on the real core
2Without CPU: a bus manager in the core's seat
3Fast platform: a virtual platform, emulator or FPGA prototype

Measured (laptop, the five-stage core alone in its bench, Verilator 5.032): 534 thousand cycles a second. The whole chip will be slower; this sheet uses 534 for the sums.

EntryYour decision
STACKCheck that start-up code sets the stack pointer before main.
SWEEPWrite and read back every register of every peripheral, the day the bus first works.
LINUXBoot an operating system to its login prompt.
HANDLERMeasure how many cycles pass from the timer interrupt to the first handler instruction.
BACK_TO_BACKHit the APB bridge with writes on every cycle, faster than any program could.
ILLEGALDrive a transfer size the core never produces and check the error response.
DRIVER_STACKRun the full UART driver suite of the software team: about 40 billion cycles.
WFI_WAKEPut the core to sleep with wfi and wake it with a GPIO edge.
EARLYTest the DMA registers in week two, before the core is integrated.
RUN_MODEA software test needs MCYCLES million cycles. At 534 thousand cycles a second, it may use at most 10 minutes on RTL. Enter 1 if it fits with the CPU on RTL, 3 if it needs a fast platform.

Examples

Example 1

STACK
Input
Check that start-up code sets the stack pointer before main.
Output
matches = 1

Only real instructions on the real core run start-up code.

Example 2

SWEEP
Input
Write and read back every register of every peripheral, the day the bus first works.
Output
matches = 1

Fast to write, no software needed, and it works before the boot code exists.

Example 3

LINUX
Input
Boot an operating system to its login prompt.
Output
matches = 1

Billions of instructions: far too long for RTL simulation.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For RUN_MODE, enter a constant expression using MCYCLES. Only this entry changes with the parameter. The supported integer range is 10 through 640, inclusive.

Hints

Hint 1

Instructions, traps and sleep need the core. Exact or illegal bus traffic needs a manager.

Hint 2

Billions of cycles do not fit in RTL simulation.

Hint 3

Seconds times cycles a second gives the cycle budget.

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 1 problem on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

STACK

Input
Check that start-up code sets the stack pointer before main.
Expected output
matches = 1

Only real instructions on the real core run start-up code.

Run samples executes all 3 public checks. Check all tests runs 14 checks on the server.

Icarus Verilog · server