Skip to content

Commit

Permalink
compliance flow for riscof
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedHassanUlHaq committed Sep 6, 2024
1 parent 95392fc commit 2e681b4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,10 @@ project/plugins/project/
hs_err_pid*

.venv
compliance/
compliance/

# Compliance
config.ini
nucleusrv/
spike/
riscof_work/
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,21 @@ asmtohex:

dv:
$(MAKE) asmtohex
$(MAKE) IMEM=assembly.hex sim
$(MAKE) IMEM=assembly.hex sim

modify_top:
(echo '/* verilator lint_off ASSIGNDLY */' && \
echo '/* verilator lint_off UNUSED */' && \
echo '/* verilator lint_off BLKSEQ */' && \
echo '/* verilator lint_off DECLFILENAME */' && \
echo '/* verilator lint_off EOFNEWLINE */' && \
echo '/* verilator lint_off WIDTH */' && \
cat Top.v) > temp && mv temp Top.v

sim-compliance:
sbt "runMain nucleusrv.components.NRVDriver $(IMEM) $(DMEM)"
make modify_top
@if [ ! -d obj_dir ]; then mkdir obj_dir; fi
verilator -Wall --cc Top.v --exe tb_Top.cpp > $(PTH)/ver_output.log 2>&1
make -C obj_dir -f VTop.mk VTop
@obj_dir/VTop > $(PTH)/trace.log 2>&1
9 changes: 9 additions & 0 deletions run_riscof.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

cd ../../../../../..
riscv64-unknown-elf-objcopy -O binary -j .text.init $1/my.elf $1/DUT-nucleusrv.text.bin
riscv64-unknown-elf-objcopy -O binary -j .data $1/my.elf $1/DUT-nucleusrv.data.bin
hexdump -v -e '"%08x\n"' $1/DUT-nucleusrv.text.bin > $1/DUT-nucleusrv.program.hex
hexdump -v -e '"%08x\n"' $1/DUT-nucleusrv.text.bin > $1/DUT-nucleusrv.data.hex
make sim-compliance IMEM=$1/DUT-nucleusrv.program.hex DMEM=$1/DUT-nucleusrv.data.hex PTH=$1
grep '^[a-f0-9]\+$' $1/trace.log > $1/DUT-nucleusrv.signature

0 comments on commit 2e681b4

Please sign in to comment.