Current tests assume hart IDs are contiguous and start at 0, how to support testing discontinuous Hart IDs?
|
f"-DNHARTS={len(self.harts)}", |
|
# Initialize stack pointer. |
|
la sp, stack_bottom |
|
# Give each hart STACK_SIZE of stack. |
|
# Assume hart IDs are contiguous and start at 0. |
|
li t1, STACK_SIZE |
|
csrr t0, CSR_MHARTID |
|
# Don't use mul instruction because not all harts support it. |
|
addi t0, t0, 1 |
|
1: |
|
add sp, sp, t1 |
|
addi t0, t0, -1 |
|
bnez t0, 1b |
|
stack_bottom: |
|
.fill NHARTS * STACK_SIZE/4, 4, 0x22446688 |
|
stack_top: |
|
static unsigned hart_count[NHARTS]; |
|
static unsigned interrupt_count[NHARTS]; |
|
uint32_t hartid = read_csr(mhartid); |
|
hart_count[hartid] = 0; |
|
interrupt_count[hartid] = 0; |
Current tests assume hart IDs are contiguous and start at 0, how to support testing discontinuous Hart IDs?
riscv-tests/debug/targets.py
Line 210 in b5ba870
riscv-tests/debug/programs/entry.S
Lines 61 to 72 in b5ba870
riscv-tests/debug/programs/entry.S
Lines 223 to 225 in b5ba870
riscv-tests/debug/programs/multicore.c
Lines 42 to 43 in b5ba870
riscv-tests/debug/programs/multicore.c
Lines 55 to 57 in b5ba870