Sort the parts of the dual-hart ap_soc into those each hart owns and those both harts share.
Hardware context: ap_soc dual-hart option. Multicore boot and inter-processor interrupts
The dual-hart option of ap_soc adds a second hart to the same chip. Some state is copied once per hart; some exists once and both harts reach it over the bus.
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
| Code | Meaning |
|---|---|
| 1 | One copy per hart. Each hart has its own. |
| 2 | One copy for the chip. Both harts use the same one. |
ap_clint keeps one time counter for the chip, and one timer compare register and one msip bit per hart. These are ap_soc design choices, as is the msip word for hart h at byte offset 4 × h.
| Entry | Your decision |
|---|---|
| REGISTERS | The integer registers and the program counter |
| SRAM_DATA | The 64 KiB SRAM |
| CONSOLE | UART0 |
| MSIP | The software-interrupt request bit in ap_clint |
| TIME | The time counter in ap_clint |
| COMPARE | The timer compare register in ap_clint |
| HART_ID | The hart id a hart reads at reset |
| SLEEP | Whether a hart is asleep in wfi |
| DMA_REGS | The channel registers of the DMA controller |
| RESERVATION | The reservation that a load-reserved records |
| LOCK_WORD | The lock word of a spin lock |
| MSIP_OFFSET | Byte offset inside ap_clint of the msip word for hart HART. |
Examples
Example 1
REGISTERS- Input
The integer registers and the program counter
- Output
matches = 1
Each hart runs its own instruction stream, so each needs its own registers and program counter.
Example 2
SRAM DATA- Input
The 64 KiB SRAM
- Output
matches = 1
Both harts reach the same SRAM over the AHB fabric. That is what makes it shared memory.
Example 3
CONSOLE- Input
UART0
- Output
matches = 1
There is one UART0 on the chip. Both harts write the same transmit register.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For MSIP_OFFSET, enter a constant expression using HART. Only this entry changes with the parameter. The supported integer range is 0 through 1, inclusive.
Hints
Hint 1
If each hart changes it on its own, it needs one copy per hart.
Hint 2
If one hart writes and another must read it, it is shared.
Hint 3
Its counter is shared; its compare and msip registers are per hart.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
12 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