| 138 | u.msr(EHID4_EL1, v) |
| 139 | |
| 140 | def test_cpu(cpu, mask): |
| 141 | global rnd_idx |
| 142 | |
| 143 | total_aop = total_ptr = 0 |
| 144 | p.memset64(data_buf_addr, 0x5555555555555555, SIZE_DATA_ARRAY) |
| 145 | p.memset64(aop_addr, 0x5555555555555555, PAGE_SIZE) |
| 146 | for i in range(REPETITIONS): |
| 147 | test_offset = L2_LINE_SIZE * rnd_idx |
| 148 | test_addr = data_buf_addr + test_offset |
| 149 | |
| 150 | p.write64(aop_addr, test_addr | mask | REGION_RWX_EL0) |
| 151 | p.dc_civac(aop_addr, L2_LINE_SIZE) |
| 152 | # p.dc_civac(data_buf_addr, SIZE_DATA_ARRAY) |
| 153 | |
| 154 | elapsed = p.smp_call_sync_el0(cpu, util.test | REGION_RWX_EL0, aop_addr | REGION_RWX_EL0, test_addr | REGION_RWX_EL0, 7 << 60) |
| 155 | time_aop = elapsed >> 32 |
| 156 | time_ptr = elapsed & 0xffffffff |
| 157 | total_aop += time_aop |
| 158 | total_ptr += time_ptr |
| 159 | |
| 160 | rnd_idx = prng(rnd_idx) |
| 161 | |
| 162 | return total_aop, total_ptr |
| 163 | |
| 164 | |
| 165 | print("ECore plain:", test_cpu(TEST_ECORE, 0)) |