Attempt to enable RV32 C extension. c.lw and c.sw are definitely broken somehow wrt MMIO memory.

Examples built using C extensions, many fail in strange ways
This commit is contained in:
Toby Jaffey 2025-12-17 15:43:15 +00:00
parent 652094c289
commit adec69e1d7
17 changed files with 132 additions and 76 deletions

View file

@ -26,30 +26,30 @@ void test_pc_too_big(void) {
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
}
void test_pc_unaligned_1(void) {
// No code should be doing this, but...
TEST_ASSERT_EQUAL(0x80000000, uvm32_getProgramCounter(&vmst));
vmst._core.pc = 0x80000000 + 1;
uvm32_run(&vmst, &evt, 1);
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
}
void test_pc_unaligned_2(void) {
// No code should be doing this, but...
TEST_ASSERT_EQUAL(0x80000000, uvm32_getProgramCounter(&vmst));
vmst._core.pc = 0x80000000 + 2;
uvm32_run(&vmst, &evt, 1);
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
}
void test_pc_unaligned_3(void) {
// No code should be doing this, but...
TEST_ASSERT_EQUAL(0x80000000, uvm32_getProgramCounter(&vmst));
vmst._core.pc = 0x80000000 + 3;
uvm32_run(&vmst, &evt, 1);
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
}
//void test_pc_unaligned_1(void) {
// // No code should be doing this, but...
// TEST_ASSERT_EQUAL(0x80000000, uvm32_getProgramCounter(&vmst));
// vmst._core.pc = 0x80000000 + 1;
// uvm32_run(&vmst, &evt, 1);
// TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
// TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
//}
//
//void test_pc_unaligned_2(void) {
// // No code should be doing this, but...
// TEST_ASSERT_EQUAL(0x80000000, uvm32_getProgramCounter(&vmst));
// vmst._core.pc = 0x80000000 + 2;
// uvm32_run(&vmst, &evt, 1);
// TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
// TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
//}
//
//void test_pc_unaligned_3(void) {
// // No code should be doing this, but...
// TEST_ASSERT_EQUAL(0x80000000, uvm32_getProgramCounter(&vmst));
// vmst._core.pc = 0x80000000 + 3;
// uvm32_run(&vmst, &evt, 1);
// TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
// TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_INTERNAL_CORE);
//}
//