Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile.apps
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
html:
cat Makefile | sed 's/^\([^#]\)/ \1/g' | markdown_py > Makefile.html
.PHONY: html

## 1. Basic Setup and Checks
SPEC=~/dev/SPEC2006/cpu2006-1.2/

### Default to create elf
ifeq ($(MAKECMDGOALS),)
Expand Down
12 changes: 12 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

export SPEC=~/dev/SPEC2006/cpu2006-1.2/
echo "SPEC="$SPEC

export SPEC_LITE=`pwd`
echo "SPEC_LITE="$SPEC_LITE

export ARCH=riscv64
export CROSS_COMPILE=riscv64-unknown-linux-gnu-
echo "ARCH="$ARCH
echo "CROSS_COMPILE"=$CROSS_COMPILE
31 changes: 31 additions & 0 deletions scripts/collect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

if [ "$#" -ne 1 ]; then
echo "Illegal number of parameters"
exit
fi

toolchain_name=$1

# Create a directory to store the build results
mkdir -p cpu2006_build

# Loop over the build directories found by the find command
find . -name "build" | while read build_dir; do
# Extract benchmark name using string manipulation (removing the initial number and dot)
benchmark_name=$(basename $(dirname "$build_dir") | sed 's/^[0-9]*\.//')

# Construct the desired name for the target file
new_name="${benchmark_name}_base.${toolchain_name}"

# Identify the target file. We're assuming it's the only non-directory item directly under the build directory.
target_file=$(find "$build_dir" -maxdepth 1 -type f ! -name "*.log")

# If target_file isn't empty, copy it to the cpu2006_build directory with the new name
if [ -n "$target_file" ]; then
echo copying $target_file to cpu2006_build/$new_name
cp "$target_file" "cpu2006_build/$new_name"
fi
done


31 changes: 31 additions & 0 deletions scripts/src_copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo "SPEC="$SPEC
#SPEC=~/dev/SPEC2006/cpu2006-1.2
SPEC_BM=$SPEC/benchspec/CPU2006
echo "SPEC_BM="$SPEC_BM

cases=$(find $SPEC_BM -maxdepth 1 -type d -name '[0-9]*' -exec basename {} \;)
echo "$cases"

# TEST_DIR=~/dev/checkpoint/CPU2006LiteWrapper/scripts/test_copy_dir
# for case in $cases; do
# mkdir -p $TEST_DIR/$case/src
# echo "Ready to copy $SPEC_BM/$case/src into "
# cp -r $SPEC_BM/$case/src $TEST_DIR/$case

# if [ "$case" = "400.perlbench" ]; then
# break
# fi
# done

cur_dir=`pwd`
cd ..
SPEC_LITE=`pwd`
cd $cur_dir
echo "SPEC_LITE="$SPEC_LITE
for case in $cases; do
mkdir -p $SPEC_LITE/$case/src
echo "Ready to copy $SPEC_BM/$case/src into $SPEC_LITE/$case"
cp -r $SPEC_BM/$case/src $SPEC_LITE/$case
done