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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [rc-1.0/] [backend/] [spartan3a_dsp_kit/] [configure] - Blame information for rev 174

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 116 rfajardo
    exit 1
38 64 rfajardo
fi
39
 
40 118 rfajardo
#NON STANDARD SCRIPT PART
41
echo "THIS SCRIPT HAS A NON-STANDARD BEGINNING."
42
echo "__________________________________________________________________________"
43
echo "${BOARD} requires another configuration for or1200_rel1."
44
 
45 64 rfajardo
echo ""
46 118 rfajardo
echo "Copying or1200_defines.v, to or1200 implementation directory..."
47
echo "(minsoc/rtl/verilog/or1200/rtl/verilog)"
48
echo "__________________________________________________________________________"
49
cp $BOARD_DIR/or1200_defines.v $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog
50
echo ""
51
echo "REGULAR SCRIPT STARTS NOW"
52
echo "__________________________________________________________________________"
53
#~NON STANDARD SCRIPT PART
54
 
55
echo ""
56 97 rfajardo
echo "This script sets up the SoC for simulations and synthesis."
57 64 rfajardo
echo ""
58 97 rfajardo
echo "In order to do so, SoC board's specific files for firmware compilation, "
59
echo "testbench generation and synthesis are configured."
60
echo "Firmware and testbench looks for board specific files under $BACKEND_DIR."
61
echo "Synthesis work under $SYN_DIR."
62 64 rfajardo
echo ""
63 97 rfajardo
echo ""
64 64 rfajardo
 
65 116 rfajardo
echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."
66
echo "__________________________________________________________________________"
67
echo ""
68
for file in "${BOARD_FILES[@]}"
69
do
70
    if [ $file != NONE ]
71
    then
72
        echo "Copying $file, to backend directory..."
73
        cp $BOARD_DIR/$file $BACKEND_DIR
74
    fi
75
done
76
echo ""
77
echo ""
78
 
79 97 rfajardo
echo "Generating project files for simulation and synthesis..."
80 116 rfajardo
echo "__________________________________________________________________________"
81
echo ""
82 97 rfajardo
make -C $MINSOC_DIR/prj
83
echo "Generation complete."
84
echo ""
85 116 rfajardo
echo ""
86 97 rfajardo
 
87 64 rfajardo
if [ $CONSTRAINT_FILE == 'NONE' ]
88
then
89
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
90 116 rfajardo
    echo ""
91
    echo ""
92 64 rfajardo
else
93 97 rfajardo
    echo "Device part for files under $SYNSRC_DIR will be patched and stored "
94 64 rfajardo
    echo "temporarily."
95 97 rfajardo
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
96 64 rfajardo
    echo "__________________________________________________________________________"
97
    echo ""
98
    for file in "${SYN_FILES[@]}"
99
    do
100
        echo "Updating synthesis file, $file..."
101
        echo "Copying $file to synthesis directory..."
102
        echo ""
103
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
104
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
105
        rm TMPFILE
106
    done
107
 
108 97 rfajardo
    echo "Updating Makefile file under $MAKEFILE_DIR..."
109
    echo "Copying Makefile to synthesis directory, $SYN_DIR..."
110 85 rfajardo
    echo ""
111
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
112
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
113
    rm TMPFILE
114 105 rfajardo
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
115 116 rfajardo
    echo ""
116
    echo ""
117 64 rfajardo
fi
118
 
119 143 rfajardo
#Precompiling firmwares
120
echo "Precompiling delivered libraries and firmwares..."
121
make -C ../../sw/utils
122
make -C ../../sw/support
123
make -C ../../sw/drivers
124
make -C ../../sw/uart
125
make -C ../../sw/eth
126
echo "done."
127
echo ""
128
echo ""
129
 
130 116 rfajardo
echo "Configuration done."

powered by: WebSVN 2.1.0

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