Skip to content

Commit

Permalink
add pmp_random test
Browse files Browse the repository at this point in the history
  • Loading branch information
wsipak committed Jan 10, 2025
1 parent 6a3733c commit dfef4fd
Show file tree
Hide file tree
Showing 15 changed files with 751 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-regression-cache-wayback-0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
matrix:
bus: ["axi", "ahb"]
test: ["hello_world", "hello_world_dccm", "cmark", "cmark_dccm", "cmark_iccm", "dhry", "ecc",
"csr_misa", "csr_access", "csr_mstatus", "csr_mseccfg", "modesw", "insns", "irq", "perf_counters", "pmp", "write_unaligned",
"csr_misa", "csr_access", "csr_mstatus", "csr_mseccfg", "modesw", "insns", "irq", "perf_counters",
"pmp", "pmp_random", "write_unaligned",
"icache", "bitmanip"]
coverage: ["branch", "toggle"] #TODO: add functional coverage
priv: ["0", "1"]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-regression-cache-wayback-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
matrix:
bus: ["axi", "ahb"]
test: ["hello_world", "hello_world_dccm", "cmark", "cmark_dccm", "cmark_iccm", "dhry", "ecc",
"csr_misa", "csr_access", "csr_mstatus", "csr_mseccfg", "modesw", "insns", "irq", "perf_counters", "pmp", "write_unaligned",
"csr_misa", "csr_access", "csr_mstatus", "csr_mseccfg", "modesw", "insns", "irq", "perf_counters",
"pmp", "pmp_random", "write_unaligned",
"icache", "bitmanip"]
coverage: ["branch", "toggle"] #TODO: add functional coverage
priv: ["0", "1"]
Expand Down
1 change: 1 addition & 0 deletions testbench/tests/pmp_random/crt0.s
1 change: 1 addition & 0 deletions testbench/tests/pmp_random/fault.c
1 change: 1 addition & 0 deletions testbench/tests/pmp_random/fault.h
29 changes: 29 additions & 0 deletions testbench/tests/pmp_random/generate_random.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -e

outfile=random_data.h
iterations=100

printf '// This file was generated with generate_random.sh\n\n' > $outfile

echo "#define RANDOM_ITERATIONS $iterations" >> $outfile
echo 'const uint32_t rand_address [] = {' >> $outfile

# generate random data in hex, fold each 8 hex digits, prepend '0x', append ','
tr -dc 'A-F0-9' < /dev/urandom | dd bs=1 count=$((8 * $iterations)) 2>/dev/null | \
fold -w8 | \
sed 's/^/ 0x/' | \
sed 's/$/,/' >> $outfile
echo >> $outfile
echo '};' >> $outfile

echo 'const uint32_t rand_config [] = {' >> $outfile
# generate random data in hex, fold each 8 hex digits, prepend '0x', append ','
tr -dc 'A-F0-9' < /dev/urandom | dd bs=1 count=$((8 * $iterations)) 2>/dev/null | \
fold -w8 | \
sed 's/^/ 0x/' | \
sed 's/$/,/' >> $outfile
echo >> $outfile
echo '};' >> $outfile

Loading

0 comments on commit dfef4fd

Please sign in to comment.