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

CV32E40Pv2 Verification update Week 17 PR #2417

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e9cf73d
Added new illegal cases for SIMD instructions.
Apr 18, 2024
80a7b26
Merge pull request #231 from XavierAubert/cv32e40p/dev_dd_pgo
Apr 18, 2024
655141c
Cleanup for vcs compatibility.
Apr 19, 2024
f7a9520
Changed bsp compilation march option to avoid HWloop use.
Apr 19, 2024
ec525a5
Merge pull request #232 from XavierAubert/cv32e40p/dev_dd_pgo
Apr 19, 2024
f86c88e
Updated cv.shuffle.sci.h Imm6 values to comply with v1.8.0 RTL
Apr 19, 2024
aacb81d
Merge pull request #233 from XavierAubert/cv32e40p/dev_dd_pgo
Apr 19, 2024
5ff8f8c
Reverted fixed march for bsp and added CFG_FLAGS.
Apr 21, 2024
286b54e
Added Hardware Loop 0 CSRs save and restore (conditionned by PULP def…
Apr 21, 2024
5ebaefe
Added CFG_FLAGS.
Apr 21, 2024
6ece203
Removed damn tabulations.
Apr 21, 2024
a3bde00
Merge pull request #234 from XavierAubert/cv32e40p/dev_dd_pgo
Apr 21, 2024
c5fd7ae
Add license header on new test .S file
dd-BeeNee Apr 22, 2024
ae11942
Merge pull request #235 from XavierAubert/cv32e40p/dev_bnl_ww17
dd-BeeNee Apr 22, 2024
95ea5cf
v2 plans back-annotation
XavierAubert Apr 22, 2024
43b56da
Create CV32E40Pv2_test_list.xlsx
XavierAubert Apr 22, 2024
06617fd
Merge pull request #236 from XavierAubert/cv32e40p/xau_vplans
dd-BeeNee Apr 24, 2024
20140c6
Add license header
dd-baoshan Apr 25, 2024
820a057
Fix incorrect skip_sim inputs
dd-baoshan Apr 25, 2024
d352c17
Merge pull request #237 from XavierAubert/cv32e40p/bsm-update_tb_file…
dd-baoshan Apr 25, 2024
b4fad3c
Setting all mhpm csr to volatile in Imperas_dv_wrap
Apr 26, 2024
208c5aa
Merge pull request #238 from XavierAubert/cv32e40p/dev_dd_mhpmcounters
YoannPruvost Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cv32e40p/bsp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ RISCV ?= $(CV_SW_TOOLCHAIN)
RISCV_EXE_PREFIX ?= $(RISCV)/bin/riscv32-unknown-elf-
RISCV_GCC = $(RISCV_EXE_PREFIX)gcc
RISCV_AR = $(RISCV_EXE_PREFIX)ar
CFG_CFLAGS = $(CFG_CFLAGS)
SRC = crt0.S handlers.S syscalls.c vectors.S
OBJ = crt0.o handlers.o syscalls.o vectors.o
LIBCV-VERIF = libcv-verif.a
Expand All @@ -14,10 +15,10 @@ $(LIBCV-VERIF): $(OBJ)
$(RISCV_AR) rcs $@ $(OBJ)

%.o : %.c
$(RISCV_GCC) $(CFLAGS) -c $< -o $@
$(RISCV_GCC) $(CFLAGS) $(CFG_CFLAGS) -c $< -o $@

%.o : %.S
$(RISCV_GCC) $(CFLAGS) -c $< -o $@
$(RISCV_GCC) $(CFLAGS) $(CFG_CFLAGS) -c $< -o $@

clean:
rm -f $(OBJ) $(LIBCV-VERIF)
Expand Down
208 changes: 112 additions & 96 deletions cv32e40p/bsp/handlers.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,158 +66,174 @@

/* exception handling */
__no_irq_handler:
la a0, no_exception_handler_msg
jal ra, puts
j __no_irq_handler
la a0, no_exception_handler_msg
jal ra, puts
j __no_irq_handler

m_software_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_timer_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_external_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast0_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast1_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast2_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast3_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast4_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast5_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast6_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast7_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast8_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast9_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast10_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast11_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast12_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast13_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast14_irq_handler:
j __no_irq_handler
j __no_irq_handler

m_fast15_irq_handler:
j __no_irq_handler
j __no_irq_handler

u_sw_irq_handler:
/* While we are still using puts in handlers, save all caller saved
regs. Eventually, some of these saves could be deferred. */
addi sp,sp,-64
sw ra, 0(sp)
sw a0, 4(sp)
sw a1, 8(sp)
sw a2, 12(sp)
sw a3, 16(sp)
sw a4, 20(sp)
sw a5, 24(sp)
sw a6, 28(sp)
sw a7, 32(sp)
sw t0, 36(sp)
sw t1, 40(sp)
sw t2, 44(sp)
sw t3, 48(sp)
sw t4, 52(sp)
sw t5, 56(sp)
sw t6, 60(sp)
csrr t0, mcause
li t1, EXCEPTION_ILLEGAL_INSN
beq t0, t1, handle_illegal_insn
li t1, EXCEPTION_ECALL_M
beq t0, t1, handle_ecall
li t1, EXCEPTION_BREAKPOINT
beq t0, t1, handle_ebreak
j handle_unknown
/* While we are still using puts in handlers, save all caller saved
regs. Eventually, some of these saves could be deferred. */
addi sp,sp,-76
MikeOpenHWGroup marked this conversation as resolved.
Show resolved Hide resolved
sw ra, 0(sp)
sw a0, 4(sp)
sw a1, 8(sp)
sw a2, 12(sp)
sw a3, 16(sp)
sw a4, 20(sp)
sw a5, 24(sp)
sw a6, 28(sp)
sw a7, 32(sp)
sw t0, 36(sp)
sw t1, 40(sp)
sw t2, 44(sp)
sw t3, 48(sp)
sw t4, 52(sp)
sw t5, 56(sp)
sw t6, 60(sp)
#ifdef PULP
csrr t6, 0xCC0
sw t6, 64(sp)
csrr t6, 0xCC1
sw t6, 68(sp)
csrr t6, 0xCC2
sw t6, 72(sp)
#endif
csrr t0, mcause
li t1, EXCEPTION_ILLEGAL_INSN
beq t0, t1, handle_illegal_insn
li t1, EXCEPTION_ECALL_M
beq t0, t1, handle_ecall
li t1, EXCEPTION_BREAKPOINT
beq t0, t1, handle_ebreak
j handle_unknown

handle_ecall:
jal ra, handle_syscall
j end_handler_incr_mepc
jal ra, handle_syscall
j end_handler_incr_mepc

handle_ebreak:
/* TODO support debug handling requirements. */
la a0, ebreak_msg
jal ra, puts
j end_handler_incr_mepc
/* TODO support debug handling requirements. */
la a0, ebreak_msg
jal ra, puts
j end_handler_incr_mepc

handle_illegal_insn:
la a0, illegal_insn_msg
jal ra, puts
j end_handler_incr_mepc
la a0, illegal_insn_msg
jal ra, puts
j end_handler_incr_mepc

handle_unknown:
la a0, unknown_msg
jal ra, puts
/* We don't know what interrupt/exception is being handled, so don't
increment mepc. */
j end_handler_ret
la a0, unknown_msg
jal ra, puts
/* We don't know what interrupt/exception is being handled, so don't
increment mepc. */
j end_handler_ret

end_handler_incr_mepc:
csrr t0, mepc
lb t1, 0(t0)
li a0, 0x3
and t1, t1, a0
/* Increment mepc by 2 or 4 depending on whether the instruction at mepc
is compressed or not. */
bne t1, a0, end_handler_incr_mepc2
addi t0, t0, 2
csrr t0, mepc
lb t1, 0(t0)
li a0, 0x3
and t1, t1, a0
/* Increment mepc by 2 or 4 depending on whether the instruction at mepc
is compressed or not. */
bne t1, a0, end_handler_incr_mepc2
addi t0, t0, 2
end_handler_incr_mepc2:
addi t0, t0, 2
csrw mepc, t0
addi t0, t0, 2
csrw mepc, t0
end_handler_ret:
lw ra, 0(sp)
lw a0, 4(sp)
lw a1, 8(sp)
lw a2, 12(sp)
lw a3, 16(sp)
lw a4, 20(sp)
lw a5, 24(sp)
lw a6, 28(sp)
lw a7, 32(sp)
lw t0, 36(sp)
lw t1, 40(sp)
lw t2, 44(sp)
lw t3, 48(sp)
lw t4, 52(sp)
lw t5, 56(sp)
lw t6, 60(sp)
addi sp,sp,64
mret
#ifdef PULP
lw t6, 64(sp)
cv.start 0, t6
lw t6, 68(sp)
cv.end 0, t6
lw t6, 72(sp)
cv.count 0, t6
#endif
lw ra, 0(sp)
lw a0, 4(sp)
lw a1, 8(sp)
lw a2, 12(sp)
lw a3, 16(sp)
lw a4, 20(sp)
lw a5, 24(sp)
lw a6, 28(sp)
lw a7, 32(sp)
lw t0, 36(sp)
lw t1, 40(sp)
lw t2, 44(sp)
lw t3, 48(sp)
lw t4, 52(sp)
lw t5, 56(sp)
lw t6, 60(sp)
addi sp,sp,76
mret

.section .rodata
illegal_insn_msg:
.string "CV32E40P BSP: illegal instruction exception handler entered\n"
.string "CV32E40P BSP: illegal instruction exception handler entered\n"
ecall_msg:
.string "CV32E40P BSP: ecall exception handler entered\n"
.string "CV32E40P BSP: ecall exception handler entered\n"
ebreak_msg:
.string "CV32E40P BSP: ebreak exception handler entered\n"
.string "CV32E40P BSP: ebreak exception handler entered\n"
unknown_msg:
.string "CV32E40P BSP: unknown exception handler entered\n"
.string "CV32E40P BSP: unknown exception handler entered\n"
no_exception_handler_msg:
.string "CV32E40P BSP: no exception handler installed\n"
.string "CV32E40P BSP: no exception handler installed\n"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading