OculusISA is an LLM-based framework designed to automatically generate and execute test cases for RISC-V emulators. The workflow is notebook-driven and focuses on instruction-level and register-level behavioral exploration under different RISC-V extension configurations.
- Installation Guide (INSTALL.md)
- OculusISA Workflow (WORKFLOW.md)
- Generate Rules for Instructions
- Generate Rules for Registers
- Generate Test Cases
- Run Test Cases on RISC-V Emulators
- LLM Configuration
- Open
4_INSTRUCTION.ipynbfor the old system. To try the new system, open4_INSTRUCTION_NEW.ipynb. - Edit this to use specific instructions only:
### CHANGE HERE ###
LIST_INSTRUCTION_WANTED = ['CSRRWI', 'ADDIW']
IS_USING_EVERYTHING = False # Set this to True if you want to use all possible instructions
### CHANGE HERE ###- Run all cells from the first cell to the last.
- The final output will be in
4_INSTRUCTION/1_OUTPUT/6_INSTRUCTION_TOTAL.txt. - The final output will contain RISC-V instruction rules.
- You can view the LLM conversation history in the following folder:
4_INSTRUCTION/2_HISTORY.
- Open
5_REGISTER.ipynbfor the old system. To try the new system, open5_REGISTER_NEW.ipynb. - Edit this for using specific registers only:
### CHANGE HERE ###
LIST_REGISTER_WANTED = ['mcounteren', 'mseccfg']
IS_USING_EVERYTHING = False # Set this to True if you want to use all possible registers
### CHANGE HERE ###- Run all cells from the first cell to the last.
- The final output will be in
5_REGISTER/1_OUTPUT/8_REGISTER_TOTAL.txt. - The final output will contain RISC-V register rules.
- You can view the LLM conversation history in the following folder:
5_REGISTER/2_HISTORY.
- Open
6_TEST_CASE.ipynb. - Edit this to use specific instructions or registers with selected rule pairs only:
### CHANGE ###
LIST_WANT = [('mcause', [1, 2])] # Example: use only mcause with its 1st and 2nd rules
IS_USING_EVERYTHING = True # Set this to True if you want to use all instruction and register rule pairs
### CHANGE ###- Run all cells from the first cell to the last.
- The final output will be in
6_TEST_CASE/3_TEST_CASE_REVISED_3.txt. - The final output will contain RISC-V assembly test cases.
- You can view the LLM conversation history in the following file:
6_TEST_CASE/4_HISTORY_TEST_CASE.txt. - The final output will be automatically copied to:
7_EMULATOR/1_QEMU_XV6/TEXT/1_QEMU_XV6_INPUT.txt7_EMULATOR/2_QEMU/TEXT/1_QEMU_INPUT.txt7_EMULATOR/3_SPIKE/TEXT/1_SPIKE_INPUT.txt7_EMULATOR/4_RVVM/TEXT/1_RVVM_INPUT.txt7_EMULATOR/5_RENODE/TEXT/1_RENODE_INPUT.txt
- Open
7_EMULATOR/1_QEMU_XV6/QEMU_XV6.ipynb. - Run all cells from the first cell to the last.
- The final output will be in:
7_EMULATOR/1_QEMU_XV6/TEXT/2_QEMU_XV6_RUN.txt7_EMULATOR/1_QEMU_XV6/TEXT/3_QEMU_XV6_CHECK.txt
- Currently, 5 emulators are available in the
7_EMULATORdirectory:- QEMU with xv6 -
7_EMULATOR/1_QEMU_XV6 - QEMU without xv6 -
7_EMULATOR/2_QEMU - Spike without xv6 -
7_EMULATOR/3_SPIKE - RVVM without xv6 -
7_EMULATOR/4_RVVM - Renode without xv6 -
7_EMULATOR/5_RENODE
- QEMU with xv6 -
- We use QEMU with xv6 in the steps above.
- The final output will contain QEMU logs that show discrepancies between QEMU register results and the LLM-expected register results, indicating which test cases trigger specification mismatches in QEMU.
- Tip: To identify which rule generated a particular test case, check
6_TEST_CASE/4_HISTORY_TEST_CASE.txtand match it with the corresponding test case number in7_EMULATOR/1_QEMU_XV6/TEXT/2_QEMU_XV6_RUN.txt.
This project can use different LLM setups. By default, we use the following setup:
- Model:
gpt-oss:120b - Runtime:
ollama - Context window:
16384 - Temperature:
1.0(recommended in the gpt-oss documentation)