URL
https://opencores.org/ocsvn/minsoc/minsoc/trunk
Subversion Repositories minsoc
[/] [minsoc/] [trunk/] [backend/] [de2_115_board/] [configure] - Rev 158
Compare with Previous | Blame | View Log
#!/bin/bash#new boards have to udpate thisBOARD=de2_115_board #this has to have the name of the directory this file is inDEVICE_PART=EP4CE115F29C7CONSTRAINT_FILE='de2_115_board.ucf'FAMILY_PART="Cyclone IV E"#~new boards update#system workingsMINSOC_DIR=`pwd`/../..BACKEND_DIR=$MINSOC_DIR/backendSYN_DIR=$MINSOC_DIR/synSYNSRC_DIR=$MINSOC_DIR/prj/alteraSYNSUPPORT_DIR=$SYN_DIR/buildSupportMAKEFILE_DIR=$SYN_DIR/alteraPROJECT_FILE=minsoc_top.qsfSYN_FILES=(adbg_top.vprj jtag_top.vprj or1200_top.vprj uart_top.vprj minsoc_top.vprj altera_virtual_jtag.vhdprj)MAKEFILE=MakefileFIND_PART='DEVICE_PART'FIND_FAMILY='FAMILY_PART'FIND_VERSION='SW_VERSION'FIND_CONSTRAINT='CONSTRAINT_FILE'BOARD_DIR=$BACKEND_DIR/$BOARDBOARD_FILES=(board.h orp.ld minsoc_defines.v minsoc_bench_defines.v gcc-opt.mk $CONSTRAINT_FILE)in_minsoc=`pwd | grep minsoc/backend/${BOARD}$`if [ -z $in_minsoc ]thenecho ""echo " !!!WARNING!!!"echo "This script cannot be run if not in a board directory inside minsoc/backend,"echo "because it relies on the directory structure of the minsoc system."echo ""echo "Possibly your minsoc directory is named differently, minsoc_trunk for example."echo "Its name must be minsoc only."echo ""exit 1fiecho ""echo "This script sets up the SoC for simulations and synthesis."echo ""echo "In order to do so, SoC board's specific files for firmware compilation, "echo "testbench generation and synthesis are configured."echo "Firmware and testbench looks for board specific files under $BACKEND_DIR."echo "Synthesis work under $SYN_DIR."echo ""echo ""echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."echo "__________________________________________________________________________"echo ""for file in "${BOARD_FILES[@]}"doif [ $file != NONE ]thenecho "Copying $file, to backend directory..."cp $BOARD_DIR/$file $BACKEND_DIRfidoneecho "Generating project files for simulation and synthesis..."echo "__________________________________________________________________________"echo ""make -C $MINSOC_DIR/prjecho "Generation complete."echo ""echo ""if [ $CONSTRAINT_FILE == 'NONE' ]thenecho "Skipping synthesis preparation. Standard implementation can only be simulated."echo ""echo ""elseecho "Device part and family for files under $SYNSRC_DIR will patched and stored "echo "temporarily."echo "Afterwards, they are copied to $SYNSUPPORT_DIR."echo "__________________________________________________________________________"echo ""sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$PROJECT_FILE > TMPFILEsed "s/$FIND_FAMILY/$FAMILY_PART/g" TMPFILE > TMPFILE2#sed "s/$FIND_VERSION/$SW_VERSION/g" TMPFILE> TMPFILEecho "Adding settings from constraint file..."cat $CONSTRAINT_FILE >> TMPFILE2echo "Generating quartus settings from prj files in $SYNSRC_DIR"for file in "${SYN_FILES[@]}"doecho "Adding settings from file $file..."cat $SYNSRC_DIR/$file >> TMPFILE2donemv TMPFILE2 $SYNSUPPORT_DIR/$PROJECT_FILErm TMPFILEecho ""echo "Generated quartus settings file in $SYNSUPPORT_DIR/$PROJECT_FILE"echo ""echo "Copying Makefile from $MAKEFILE_DIR to synthesis directory, $SYN_DIR..."cp $MAKEFILE_DIR/$MAKEFILE $SYN_DIR/$MAKEFILEcp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.batecho "For synthesis help go to $SYN_DIR and type \"make\"."echo ""echo ""fi#Precompiling firmwaresecho "Precompiling delivered libraries and firmwares..."make -C ../../sw/utilsmake -C ../../sw/supportmake -C ../../sw/driversmake -C ../../sw/uartmake -C ../../sw/jspmake -C ../../sw/ethecho "done."echo ""echo ""echo "Configuration done."
