GCC=g++
|
GCC=g++
|
|
|
SCC=schroot -c centos5-i386 ~/bin/synphonycc_fpga
|
SCC=schroot -c centos5-i386 ~/bin/synphonycc_fpga
|
SCC_SCRIPTS=./scc_scripts
|
SCC_SCRIPTS=./scc_scripts
|
SYNTH_SRC=./synth_src
|
SYNTH_SRC=./synth_src
|
|
|
|
|
|
|
|
|
|
|
all: fpt_connect6 test_golden
|
all: fpt_connect6 test_golden
|
|
|
fpt_connect6: ${SYNTH_SRC}/main.cpp util.o connect6.o connect6_synth.o state.o threats.o
|
fpt_connect6: ${SYNTH_SRC}/main.cpp util.o connect6.o connect6_synth.o state.o threats.o
|
${GCC} -o connect6 ${SYNTH_SRC}/main.cpp util.o connect6.o connect6_synth.o state.o threats.o -lpthread -lm -g -pg
|
${GCC} -o connect6 ${SYNTH_SRC}/main.cpp util.o connect6.o connect6_synth.o state.o threats.o -lpthread -lm -g -pg
|
|
|
connect6_synth.o: ${SYNTH_SRC}/connect6_synth.cpp ${SYNTH_SRC}/connect6_synth.h
|
connect6_synth.o: ${SYNTH_SRC}/connect6_synth.cpp ${SYNTH_SRC}/connect6_synth.h
|
${GCC} -c -g -pg ${SYNTH_SRC}/connect6_synth.cpp
|
${GCC} -c -g -pg ${SYNTH_SRC}/connect6_synth.cpp
|
connect6.o: ${SYNTH_SRC}/connect6.cpp ${SYNTH_SRC}/connect6.h
|
connect6.o: ${SYNTH_SRC}/connect6.cpp ${SYNTH_SRC}/connect6.h
|
${GCC} -c -g -pg ${SYNTH_SRC}/connect6.cpp
|
${GCC} -c -g -pg ${SYNTH_SRC}/connect6.cpp
|
|
|
util.o: ${SYNTH_SRC}/util.cpp ${SYNTH_SRC}/util.h
|
util.o: ${SYNTH_SRC}/util.cpp ${SYNTH_SRC}/util.h
|
${GCC} -c -g -pg ${SYNTH_SRC}/util.cpp
|
${GCC} -c -g -pg ${SYNTH_SRC}/util.cpp
|
state.o:${SYNTH_SRC}/state.cpp ${SYNTH_SRC}/shared.h
|
state.o:${SYNTH_SRC}/state.cpp ${SYNTH_SRC}/shared.h
|
${GCC} -c -g -pg ${SYNTH_SRC}/state.cpp
|
${GCC} -c -g -pg ${SYNTH_SRC}/state.cpp
|
|
|
threats.o:${SYNTH_SRC}/threats.cpp ${SYNTH_SRC}/shared.h
|
threats.o:${SYNTH_SRC}/threats.cpp ${SYNTH_SRC}/shared.h
|
${GCC} -c -g -pg ${SYNTH_SRC}/threats.cpp
|
${GCC} -c -g -pg ${SYNTH_SRC}/threats.cpp
|
|
|
|
|
test_golden:
|
test_golden:
|
./connect6 -player L
|
./connect6 -player L
|
|
|
clean:
|
clean:
|
rm -f *.o connect6 gmon.out myboard.txt
|
rm -f *.o connect6 gmon.out myboard.txt
|
|
|
|
|
|
|
|
|
#first the c/c++ source should be compiled
|
#first the c/c++ source should be compiled
|
fpga: synth altera_synth test
|
fpga: synth altera_synth test
|
cp cp ./rtl_package/synth/altera_fpga/run/DE2.sof ../DEMO
|
cp cp ./rtl_package/synth/altera_fpga/run/DE2.sof ../DEMO
|
|
|
synth: all imp_connect
|
synth: imp_connect.tag
|
imp_window:
|
imp_window.tag:
|
#sed -s 's/\\TCAB_NAME/threat_window/g' main.cpp.base >main.cpp
|
#sed -s 's/\\TCAB_NAME/threat_window/g' main.cpp.base >main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
${SCC} ${SCC_SCRIPTS}/run_imp_window.tcl
|
${SCC} ${SCC_SCRIPTS}/run_imp_window.tcl
|
imp_line: imp_window
|
echo "Done" > imp_window.tag
|
|
imp_line.tag: imp_window.tag
|
#sed -s 's/\\TCAB_NAME/threat_line/g' main.cpp.base >main.cpp
|
#sed -s 's/\\TCAB_NAME/threat_line/g' main.cpp.base >main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
${SCC} ${SCC_SCRIPTS}/run_imp_line.tcl
|
${SCC} ${SCC_SCRIPTS}/run_imp_line.tcl
|
imp_marks:
|
echo "Done" > imp_line.tag
|
|
imp_marks.tag:
|
#sed -s 's/\\TCAB_NAME/ai_mraks/g' main.cpp.base >main.cpp
|
#sed -s 's/\\TCAB_NAME/ai_mraks/g' main.cpp.base >main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
${SCC} ${SCC_SCRIPTS}/run_imp_marks.tcl
|
${SCC} ${SCC_SCRIPTS}/run_imp_marks.tcl
|
imp_threat: imp_line imp_marks
|
echo "Done" > imp_marks.tag
|
|
imp_threat.tag: imp_line.tag imp_marks.tag
|
#sed -s 's/\\TCAB_NAME/ai_threats/g' main.cpp.base >main.cpp
|
#sed -s 's/\\TCAB_NAME/ai_threats/g' main.cpp.base >main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
${SCC} ${SCC_SCRIPTS}/run_imp_threat.tcl
|
${SCC} ${SCC_SCRIPTS}/run_imp_threat.tcl
|
imp_adjacent:
|
echo "Done" > imp_threat.tag
|
|
imp_adjacent.tag:
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
cp ${SYNTH_SRC}/main.cpp.base ${SYNTH_SRC}/main.cpp
|
#sed -s 's/\\TCAB_NAME/ai_adjacent/g' main.cpp.base >main.cpp
|
#sed -s 's/\\TCAB_NAME/ai_adjacent/g' main.cpp.base >main.cpp
|
${SCC} ${SCC_SCRIPTS}/run_imp_adjacent.tcl
|
${SCC} ${SCC_SCRIPTS}/run_imp_adjacent.tcl
|
imp_connect: imp_threat imp_adjacent
|
echo "Done" > imp_adjacent.tag
|
|
imp_connect.tag: imp_threat.tag imp_adjacent.tag
|
sed -s 's/\\TCAB_NAME/connect6ai_synth/g' ${SYNTH_SRC}/main.cpp.base >${SYNTH_SRC}/main.cpp
|
sed -s 's/\\TCAB_NAME/connect6ai_synth/g' ${SYNTH_SRC}/main.cpp.base >${SYNTH_SRC}/main.cpp
|
${SCC} ${SCC_SCRIPTS}/run_imp_connect.tcl
|
${SCC} ${SCC_SCRIPTS}/run_imp_connect.tcl
|
|
echo "Done" > imp_connect.tag
|
|
|
altera_synth:
|
altera_synth:
|
cp -r ./imp_connect/rtl_package/ ./
|
cp -r ./imp_connect/rtl_package/ ./
|
cp DE2/do_synth ./rtl_package/synth/altera_fpga/
|
cp DE2/do_synth ./rtl_package/synth/altera_fpga/
|
cp DE2/quartus.tcl ./rtl_package/synth/altera_fpga/
|
cp DE2/quartus.tcl ./rtl_package/synth/altera_fpga/
|
cp DE2/constraints.sdc ./rtl_package/synth/altera_fpga/
|
cp DE2/constraints.sdc ./rtl_package/synth/altera_fpga/
|
echo -e 'all:\n\t./do_synth' > ./rtl_package/synth/altera_fpga/makefile
|
echo -e 'all:\n\t./do_synth' > ./rtl_package/synth/altera_fpga/makefile
|
make -C ./rtl_package/synth/altera_fpga/
|
make -C ./rtl_package/synth/altera_fpga/
|
|
|
test:
|
test:
|
../scripts/serial_port_setup.sh
|
../scripts/serial_port_setup.sh
|
rm -f ./test.result
|
rm -f ./test.result
|
for i in `seq 1 100` ; do ../connect6 -port /dev/ttyS0 -player L >> test.result 2>&1; done
|
for i in `seq 1 100` ; do ../connect6 -port /dev/ttyS0 -player L >> test.result 2>&1; done
|
#grep "FPGA has won" ./test.result | wc -l
|
#grep "FPGA has won" ./test.result | wc -l
|
#grep "AI has won" ./test.result | wc -l
|
#grep "AI has won" ./test.result | wc -l
|
#grep "TIE" ./test.result | wc -l
|
#grep "TIE" ./test.result | wc -l
|
python ../scripts/esult.py
|
python ../scripts/esult.py
|
pgm:
|
pgm:
|
cp ./rtl_package/synth/altera_fpga/run/DE2.sof ./
|
cp ./rtl_package/synth/altera_fpga/run/DE2.sof ./
|
quartus_pgm -c USB-Blaster -m jtag -o "p;DE2.sof"
|
quartus_pgm -c USB-Blaster -m jtag -o "p;DE2.sof"
|
|
|
|
|
prof:
|
prof:
|
valgrind --tool=callgrind ./connect6 -player L
|
valgrind --tool=callgrind ./connect6 -player L
|
kcachegrind
|
kcachegrind
|
|
|
altera_clean:
|
altera_clean:
|
rm -rf ./rtl_package/
|
rm -rf ./rtl_package/
|
|
|
ultraclean: altera_clean
|
ultraclean: altera_clean
|
rm -rf imp_line imp_marks imp_threat imp_choose imp_adjacent imp_connect imp_window Logs
|
rm -rf *.tag imp_line imp_marks imp_threat imp_choose imp_adjacent imp_connect imp_window Logs
|
|
|