Skip to content

Commit

Permalink
test also mcause
Browse files Browse the repository at this point in the history
  • Loading branch information
bieganski committed Aug 17, 2024
1 parent 64ec7eb commit bf5dc21
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions mtkcpu/tests/test_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,33 +284,6 @@
]

EXDI = [
# MemTestCase(
# name="TEST test TEST",
# source_type=MemTestSourceType.RAW,
# source=f"""
# start:
# la x5, trap
# csrw mtvec, x5
# li x1, 0b1000 # mstatus.mie
# csrw mstatus, x1
# li x1, 0b10000000 # mie.mtie
# csrw mie, x1
# loop:
# j loop
# trap:
# csrr x1, mepc
# addi x1, x1, 4
# csrw mepc, x1
# mret
# addi x2, x0, 10
# """,
# out_reg=2,
# out_val=20,
# timeout=100,
# mem_init=MemoryContents.empty(),
# reg_init=RegistryContents.fill(),
# ),

MemTestCase(
name="timer interrupt",
source_type=MemTestSourceType.RAW,
Expand All @@ -330,10 +303,11 @@
loop:
j loop
trap:
addi x15, x0, 123
csrr x14, mcause
andi x15, x14, 0xff
""",
out_reg=15,
out_val=123,
out_val=IrqCause.M_TIMER_INTERRUPT,
timeout=2000,
mem_init=MemoryContents.empty(),
reg_init=RegistryContents.fill(),
Expand Down

0 comments on commit bf5dc21

Please sign in to comment.