Skip to content

Commit

Permalink
Merge pull request #8 from scalable-arch/HanumKo_Goldenmodel
Browse files Browse the repository at this point in the history
GoldenModel_update
  • Loading branch information
sg05060 authored Oct 5, 2024
2 parents d4d424b + e148e4c commit 736c61f
Show file tree
Hide file tree
Showing 19 changed files with 532 additions and 2,403 deletions.
3 changes: 3 additions & 0 deletions actions/action.sim_vivado
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

source /tools/Xilinx/Vivado/2024.1/settings64.sh

cd ${VPU_HOME}/sw/C/Goldenmodel/
./gen.sh

vivado -mode tcl -source ${ACTION_HOME}/sim_vivado/sim_vivado.tcl
Binary file added sw/C/Goldenmodel/GoldenModel
Binary file not shown.
35 changes: 35 additions & 0 deletions sw/C/Goldenmodel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Makefile to compile and run GoldenModel with LD_LIBRARY_PATH set

# Variables
CC = gcc
CFLAGS = -I./header
LDFLAGS = -L./library -lIp_floating_point_v7_1_bitacc_cmodel -lgmp -lmpfr
TARGET = GoldenModel
SRC = ./bitacc_Cmodel/Golden_Model_first.c
INPUT_DIR = ./test_vector
INPUT_FILE = bf16_numbers.txt
INPUT_FILE_POSITIVE = bf16_numbers_only_positive.txt
OUTPUT_DIR = $(VPU_HOME)/sim/testvector
LIBRARY_PATH = ./library

# Default target to build and run the program
all: $(TARGET)

# Compile the program
$(TARGET): $(SRC)
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LDFLAGS)

# Run the program with the input files and output directory
run: $(TARGET)
@if [ -z "$(VPU_HOME)" ]; then \
echo "Error: VPU_HOME 환경 변수가 설정되지 않았습니다."; \
exit 1; \
fi
mkdir -p $(OUTPUT_DIR)
cp $(INPUT_DIR)/$(INPUT_FILE) $(OUTPUT_DIR)
cp $(INPUT_DIR)/$(INPUT_FILE_POSITIVE) $(OUTPUT_DIR)
LD_LIBRARY_PATH=$(LIBRARY_PATH):$$LD_LIBRARY_PATH ./$(TARGET) -input $(INPUT_DIR)/$(INPUT_FILE) -positive_input $(INPUT_DIR)/$(INPUT_FILE_POSITIVE) -output $(OUTPUT_DIR)

# Clean up the compiled binary
clean:
rm -f $(TARGET)
Loading

0 comments on commit 736c61f

Please sign in to comment.