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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Symbol | Address |
|---|---|
| __data_load | 0x00000288 |
| __data_start | 0x80000000 |
| __data_end | 0x80000008 |
| __bss_start | 0x80000008 |
| __bss_end | 0x80000058 |
| __stack_top | 0x80010000 |
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.
| Entry | Your decision |
|---|---|
| DATA_WORDS | Words the .data copy moves. |
| BSS_WORDS | Words the .bss clear stores. |
| FIRST_COPY_FROM | Address the first .data word is copied from. |
| LAST_CLEAR_AT | Address of the last word the clear loop stores. |
| SRAM_COPY_STORES | Copy stores the same program makes in the SRAM layout. |
| IMAGE_BSS_BYTES | Bytes the image holds for .bss. |
| FREE_BYTES | Bytes between the end of .bss and the top of the stack, for the stack to grow into. |
| CLEAR_RECORDS | Records the clear loop retires for this .bss. |
| FIRST_STATUS | The first value the ROM image writes to TB_STATUS. |
| RECORDS | Another 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