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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [nexys2_1200/] [configure] - Blame information for rev 165

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 165 rfajardo
#!/bin/bash
2
 
3
#new boards have to udpate this
4
BOARD=nexys2_1200                                               #this has to have the name of the directory this file is in
5
DEVICE_PART='XC3S1200E-FG320'
6
CONSTRAINT_FILE='nexys2_1200.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
SYNSRC_DIR=$MINSOC_DIR/prj/xilinx
14
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
15
MAKEFILE_DIR=$SYN_DIR/xilinx
16
 
17
SYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst)
18
MAKEFILE=Makefile
19
 
20
FIND_PART='DEVICE_PART'
21
FIND_CONSTRAINT='CONSTRAINT_FILE'
22
 
23
BOARD_DIR=$BACKEND_DIR/$BOARD
24
BOARD_FILES=(board.h orp.ld minsoc_defines.v minsoc_bench_defines.v gcc-opt.mk $CONSTRAINT_FILE)
25
 
26
in_minsoc=`pwd | grep minsoc/backend/${BOARD}$`
27
if [ -z $in_minsoc ]
28
then
29
        echo ""
30
        echo "                  !!!WARNING!!!"
31
        echo "This script cannot be run if not in a board directory inside minsoc/backend,"
32
        echo "because it relies on the directory structure of the minsoc system."
33
        echo ""
34
        echo "Possibly your minsoc directory is named differently, minsoc_trunk for example."
35
        echo "Its name must be minsoc only."
36
        echo ""
37
    exit 1
38
fi
39
 
40
echo ""
41
echo "This script sets up the SoC for simulations and synthesis."
42
echo ""
43
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
echo ""
48
echo ""
49
 
50
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
echo "Generating project files for simulation and synthesis..."
65
echo "__________________________________________________________________________"
66
echo ""
67
make -C $MINSOC_DIR/prj
68
echo "Generation complete."
69
echo ""
70
echo ""
71
 
72
if [ $CONSTRAINT_FILE == 'NONE' ]
73
then
74
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
75
    echo ""
76
    echo ""
77
else
78
    echo "Device part for files under $SYNSRC_DIR will be patched and stored "
79
    echo "temporarily."
80
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
81
    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
    echo "Updating Makefile file under $MAKEFILE_DIR..."
94
    echo "Copying Makefile to synthesis directory, $SYN_DIR..."
95
    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
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
100
    echo ""
101
    echo ""
102
fi
103
 
104
#Precompiling firmwares
105
echo "Precompiling delivered libraries and firmwares..."
106
make -C ../../sw/utils
107
make -C ../../sw/support
108
make -C ../../sw/drivers
109
make -C ../../sw/uart
110
make -C ../../sw/jsp
111
make -C ../../sw/eth
112
echo "done."
113
echo ""
114
echo ""
115
 
116
echo "Configuration done."

powered by: WebSVN 2.1.0

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