Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ebreak properly #60

Merged
merged 1 commit into from
Sep 30, 2022
Merged

Implement ebreak properly #60

merged 1 commit into from
Sep 30, 2022

Conversation

Risheng1128
Copy link
Collaborator

This commit adds the instruction c.ebreak into rv32emu.

Input the following command, and the c.ebreak test will pass.

make arch-test RISCV_DEVICE=C

src/emulate.c Outdated Show resolved Hide resolved
@jserv jserv changed the title Add the instruction c.ebreak Implement ebreak instruction properly Sep 29, 2022
@jserv jserv self-requested a review September 29, 2022 03:22
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change README.md to reflect the results of RISC-V Architecture Tests.

@jserv
Copy link
Contributor

jserv commented Sep 29, 2022

Check the article How to Write a Git Commit Message to summarize this change.

@jserv jserv changed the title Implement ebreak instruction properly Implement ebreak properly Sep 29, 2022
@Risheng1128
Copy link
Collaborator Author

For the consistent prototype with other exception handlers. I redeclare the rv_except_breakpoint.

- void rv_except_breakpoint(struct riscv_t *rv)
+ static void rv_except_breakpoint(struct riscv_t *rv, uint32_t old_pc)

Add the new function breakpoint_handler and change README.md.

src/riscv.h Outdated Show resolved Hide resolved
@jserv
Copy link
Contributor

jserv commented Sep 29, 2022

Check privilege item in RISC-V Architecture Tests as well.

@Risheng1128
Copy link
Collaborator Author

privilege instuction test result:

Check ebreak                    ... FAIL 
Check ecall                     ... FAIL 
Check misalign1-jalr-01         ... OK 
Check misalign2-jalr-01         ... OK 
Check misalign-beq-01           ... OK 
Check misalign-bge-01           ... OK 
Check misalign-bgeu-01          ... OK 
Check misalign-blt-01           ... OK 
Check misalign-bltu-01          ... OK 
Check misalign-bne-01           ... OK 
Check misalign-jal-01           ... OK 
Check misalign-lh-01            ... OK 
Check misalign-lhu-01           ... OK 
Check misalign-lw-01            ... FAIL 
Check misalign-sh-01            ... OK 
Check misalign-sw-01            ... FAIL

@jserv
Copy link
Contributor

jserv commented Sep 30, 2022

privilege instruction test result:
Check ebreak ... FAIL
Check ecall ... FAIL

Create a new issue regarding privilege instruction regressions.

Add the breakpoint exception handler which triggers
a breakpoint exception when the c.ebreak instruction
is executed.
@Risheng1128
Copy link
Collaborator Author

Risheng1128 commented Sep 30, 2022

Rename the function:

- void breakpoint_handler(struct riscv_t *rv);
+ void ebreak_handler(struct riscv_t *rv);

@jserv jserv merged commit 93952a1 into sysprog21:master Sep 30, 2022
@jserv
Copy link
Contributor

jserv commented Sep 30, 2022

Thank @Risheng1128 for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants