URL
https://opencores.org/ocsvn/minsoc/minsoc/trunk
Subversion Repositories minsoc
[/] [minsoc/] [trunk/] [backend/] [spartan3e_starter_kit_eth/] [configure] - Rev 168
Compare with Previous | Blame | View Log
#!/bin/bash#NON STANDARD SCRIPT, USE ANOTHER AS TEMPLATE, NON STANDARD PART IS MARKED AS COMMENT#new boards have to udpate thisBOARD=spartan3e_starter_kit_eth #this has to have the name of the directory this file is inDEVICE_PART='xc3s500e-4-fg320'CONSTRAINT_FILE='spartan3e_starter_kit_eth.ucf'#~new boards update#system workingsMINSOC_DIR=`pwd`/../..BACKEND_DIR=$MINSOC_DIR/backendSYN_DIR=$MINSOC_DIR/synSYNSRC_DIR=$MINSOC_DIR/prj/xilinxSYNSUPPORT_DIR=$SYN_DIR/buildSupportMAKEFILE_DIR=$SYN_DIR/xilinxSYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst)MAKEFILE=MakefileFIND_PART='DEVICE_PART'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 1fi#NON STANDARD SCRIPT PARTecho "THIS SCRIPT HAS A NON-STANDARD BEGINNING."echo "__________________________________________________________________________"echo "${BOARD} requires another configuration for or1200."echo ""echo "Otherwise, the design won't fit on your FPGA because of area restrictions. If you select no, you can manually copy the or1200_defines.v from this directory to minsoc/rtl/verilog/or1200/rtl/verilog later to overcome this safely."echo ""echo -n "This will modify the standard or1200_defines.v file. Proceed? [Y/n]: "read REPLY;if [ "$REPLY" = "y" ] || [ -z "$REPLY" ]thenecho ""echo "Backing up original or1200_defines.v as or1200_defines.bak..."echo "Copying or1200_defines.v, to or1200 implementation directory..."echo "(minsoc/rtl/verilog/or1200/rtl/verilog)"echo "__________________________________________________________________________"mv $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog/or1200_defines.v $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog/or1200_defines.bakcp $BOARD_DIR/or1200_defines.v $MINSOC_DIR/rtl/verilog/or1200/rtl/verilogfiecho ""echo "REGULAR SCRIPT STARTS NOW"echo "__________________________________________________________________________"#~NON STANDARD SCRIPT PARTecho ""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 ""echo ""echo "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 for files under $SYNSRC_DIR will be patched and stored "echo "temporarily."echo "Afterwards, they are copied to $SYNSUPPORT_DIR."echo "__________________________________________________________________________"echo ""for file in "${SYN_FILES[@]}"doecho "Updating synthesis file, $file..."echo "Copying $file to synthesis directory..."echo ""sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILEsed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$filerm TMPFILEdoneecho "Updating Makefile file under $MAKEFILE_DIR..."echo "Copying Makefile to synthesis directory, $SYN_DIR..."echo ""sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILEsed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILErm TMPFILEcp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.batecho ""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."
