V0.4.1 Read the Memory Image

EasyImplement12 minIcarus Verilog · serverReview the topic

Use the symbols of a linked chip test to work out what its start-up code must copy, clear and leave free. Then time the clear.

Hardware context: The firmware kit's start-up code and linker script on ap_soc v1.5, in the ROM and SRAM layouts. Bringing up start-up code on a new chip.

The lab program of lesson V0.4, linked by the firmware kit for the ROM layout (riscv64-unknown-elf-gcc (14.2.0+19) 14.2.0). Its symbols are below. Enter each answer as a number.

This worksheet uses named constants. The first three entries show how to record your decisions.

Replace each unresolved value of 4294967295 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
SymbolAddress
__data_load0x00000288
__data_start0x80000000
__data_end0x80000008
__bss_start0x80000008
__bss_end0x80000058
__stack_top0x80010000

For each word, the kit's clear loop retires four instructions: a test, a store, an add and a jump. One more test ends the loop.

EntryYour decision
DATA_WORDSWords the .data copy moves.
BSS_WORDSWords the .bss clear stores.
FIRST_COPY_FROMAddress the first .data word is copied from.
LAST_CLEAR_ATAddress of the last word the clear loop stores.
SRAM_COPY_STORESCopy stores the same program makes in the SRAM layout.
IMAGE_BSS_BYTESBytes the image holds for .bss.
FREE_BYTESBytes between the end of .bss and the top of the stack, for the stack to grow into.
CLEAR_RECORDSRecords the clear loop retires for this .bss.
FIRST_STATUSThe first value the ROM image writes to TB_STATUS.
RECORDSAnother program has BYTES bytes of .bss. How many records does the kit's clear loop retire?

Examples

Example 1

DATA WORDS
Input
Words the .data copy moves.
Output
matches = 1

(0x8000_0008 - 0x8000_0000) / 4 = 2.

Example 2

BSS WORDS
Input
Words the .bss clear stores.
Output
matches = 1

(0x8000_0058 - 0x8000_0008) / 4 = 20.

Example 3

FIRST COPY FROM
Input
Address the first .data word is copied from.
Output
matches = 1

The load address of .data, __data_load, in ROM.

Constraints and Contract

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

Hints

Hint 1

A section's size is end minus start; divide by 4 for words.

Hint 2

__bss_end is the first address after .bss.

Hint 3

Each pass of a loop retires every instruction in its body.

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

Report a problem with this page

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

DATA WORDS

Input
Words the .data copy moves.
Expected output
matches = 1

(0x8000_0008 - 0x8000_0000) / 4 = 2.

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

Icarus Verilog · server