OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [spartan3a_dsp_kit/] [configure] - Blame information for rev 151

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 64 rfajardo
#!/bin/bash
2
 
3
#new boards have to udpate this
4
BOARD=spartan3a_dsp_kit                                         #this has to have the name of the directory this file is in
5
DEVICE_PART='xc3sd1800a-4-fg676'
6
CONSTRAINT_FILE='spartan3a_dsp_kit.ucf'
7
#~new boards update
8
 
9
#system workings
10
MINSOC_DIR=`pwd`/../..
11
BACKEND_DIR=$MINSOC_DIR/backend
12
SYN_DIR=$MINSOC_DIR/syn
13 85 rfajardo
SYNSRC_DIR=$MINSOC_DIR/prj/xilinx
14 64 rfajardo
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
15 85 rfajardo
MAKEFILE_DIR=$SYN_DIR/xilinx
16 64 rfajardo
 
17 85 rfajardo
SYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst)
18
MAKEFILE=Makefile
19 64 rfajardo
 
20
FIND_PART='DEVICE_PART'
21
FIND_CONSTRAINT='CONSTRAINT_FILE'
22
 
23
BOARD_DIR=$BACKEND_DIR/$BOARD
24 69 rfajardo
BOARD_FILES=(board.h orp.ld minsoc_defines.v minsoc_bench_defines.v gcc-opt.mk $CONSTRAINT_FILE)
25 64 rfajardo
 
26
in_minsoc=`pwd | grep minsoc/backend/${BOARD}$`
27
if [ -z $in_minsoc ]
28
then
29
        echo ""
30
        echo "                  !!!WARNING!!!"
31 85 rfajardo
        echo "This script cannot be run if not in a board directory inside minsoc/backend,"
32 64 rfajardo
        echo "because it relies on the directory structure of the minsoc system."
33
        echo ""
34 85 rfajardo
        echo "Possibly your minsoc directory is named differently, minsoc_trunk for example."
35
        echo "Its name must be minsoc only."
36
        echo ""
37 141 rfajardo
    exit 1
38 64 rfajardo
fi
39
 
40
echo ""
41 97 rfajardo
echo "This script sets up the SoC for simulations and synthesis."
42 64 rfajardo
echo ""
43 97 rfajardo
echo "In order to do so, SoC board's specific files for firmware compilation, "
44
echo "testbench generation and synthesis are configured."
45
echo "Firmware and testbench looks for board specific files under $BACKEND_DIR."
46
echo "Synthesis work under $SYN_DIR."
47 64 rfajardo
echo ""
48 97 rfajardo
echo ""
49 64 rfajardo
 
50 141 rfajardo
echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."
51
echo "__________________________________________________________________________"
52
echo ""
53
for file in "${BOARD_FILES[@]}"
54
do
55
    if [ $file != NONE ]
56
    then
57
        echo "Copying $file, to backend directory..."
58
        cp $BOARD_DIR/$file $BACKEND_DIR
59
    fi
60
done
61
echo ""
62
echo ""
63
 
64 97 rfajardo
echo "Generating project files for simulation and synthesis..."
65 141 rfajardo
echo "__________________________________________________________________________"
66
echo ""
67 97 rfajardo
make -C $MINSOC_DIR/prj
68
echo "Generation complete."
69
echo ""
70 141 rfajardo
echo ""
71 97 rfajardo
 
72 64 rfajardo
if [ $CONSTRAINT_FILE == 'NONE' ]
73
then
74
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
75 141 rfajardo
    echo ""
76
    echo ""
77 64 rfajardo
else
78 97 rfajardo
    echo "Device part for files under $SYNSRC_DIR will be patched and stored "
79 64 rfajardo
    echo "temporarily."
80 97 rfajardo
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
81 64 rfajardo
    echo "__________________________________________________________________________"
82
    echo ""
83
    for file in "${SYN_FILES[@]}"
84
    do
85
        echo "Updating synthesis file, $file..."
86
        echo "Copying $file to synthesis directory..."
87
        echo ""
88
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
89
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
90
        rm TMPFILE
91
    done
92
 
93 97 rfajardo
    echo "Updating Makefile file under $MAKEFILE_DIR..."
94
    echo "Copying Makefile to synthesis directory, $SYN_DIR..."
95 85 rfajardo
    echo ""
96
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
97
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
98
    rm TMPFILE
99 105 rfajardo
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
100 141 rfajardo
    echo ""
101
    echo ""
102 64 rfajardo
fi
103
 
104 142 rfajardo
#Precompiling firmwares
105
echo "Precompiling delivered libraries and firmwares..."
106 144 rfajardo
make -C ../../sw/utils
107
make -C ../../sw/support
108
make -C ../../sw/drivers
109
make -C ../../sw/uart
110
make -C ../../sw/eth
111 142 rfajardo
echo "done."
112
echo ""
113
echo ""
114
 
115 141 rfajardo
echo "Configuration done."

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.