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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [spartan3e_starter_kit_eth/] [configure] - Blame information for rev 168

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 69 rfajardo
#!/bin/bash
2
 
3
#NON STANDARD SCRIPT, USE ANOTHER AS TEMPLATE, NON STANDARD PART IS MARKED AS COMMENT
4
 
5
#new boards have to udpate this
6
BOARD=spartan3e_starter_kit_eth                                         #this has to have the name of the directory this file is in
7
DEVICE_PART='xc3s500e-4-fg320'
8
CONSTRAINT_FILE='spartan3e_starter_kit_eth.ucf'
9
#~new boards update
10
 
11
#system workings
12
MINSOC_DIR=`pwd`/../..
13
BACKEND_DIR=$MINSOC_DIR/backend
14
SYN_DIR=$MINSOC_DIR/syn
15 85 rfajardo
SYNSRC_DIR=$MINSOC_DIR/prj/xilinx
16 69 rfajardo
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
17 85 rfajardo
MAKEFILE_DIR=$SYN_DIR/xilinx
18 69 rfajardo
 
19 85 rfajardo
SYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst)
20
MAKEFILE=Makefile
21 69 rfajardo
 
22
FIND_PART='DEVICE_PART'
23
FIND_CONSTRAINT='CONSTRAINT_FILE'
24
 
25
BOARD_DIR=$BACKEND_DIR/$BOARD
26
BOARD_FILES=(board.h orp.ld minsoc_defines.v minsoc_bench_defines.v gcc-opt.mk $CONSTRAINT_FILE)
27
 
28
in_minsoc=`pwd | grep minsoc/backend/${BOARD}$`
29
if [ -z $in_minsoc ]
30
then
31
        echo ""
32
        echo "                  !!!WARNING!!!"
33 85 rfajardo
        echo "This script cannot be run if not in a board directory inside minsoc/backend,"
34 69 rfajardo
        echo "because it relies on the directory structure of the minsoc system."
35
        echo ""
36 85 rfajardo
        echo "Possibly your minsoc directory is named differently, minsoc_trunk for example."
37
        echo "Its name must be minsoc only."
38
        echo ""
39 87 rfajardo
    exit 1
40 69 rfajardo
fi
41
 
42
#NON STANDARD SCRIPT PART
43
echo "THIS SCRIPT HAS A NON-STANDARD BEGINNING."
44
echo "__________________________________________________________________________"
45 141 rfajardo
echo "${BOARD} requires another configuration for or1200."
46 168 rfajardo
echo ""
47 69 rfajardo
 
48 168 rfajardo
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."
49 69 rfajardo
echo ""
50 168 rfajardo
 
51
echo -n "This will modify the standard or1200_defines.v file. Proceed? [Y/n]: "
52
read REPLY;
53
if [ "$REPLY" = "y" ] || [ -z "$REPLY" ]
54
then
55
        echo ""
56
        echo "Backing up original or1200_defines.v as or1200_defines.bak..."
57
        echo "Copying or1200_defines.v, to or1200 implementation directory..."
58
        echo "(minsoc/rtl/verilog/or1200/rtl/verilog)"
59
        echo "__________________________________________________________________________"
60
        mv $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog/or1200_defines.v $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog/or1200_defines.bak
61
        cp $BOARD_DIR/or1200_defines.v $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog
62
fi
63 69 rfajardo
echo ""
64
echo "REGULAR SCRIPT STARTS NOW"
65
echo "__________________________________________________________________________"
66
#~NON STANDARD SCRIPT PART
67
 
68
echo ""
69 97 rfajardo
echo "This script sets up the SoC for simulations and synthesis."
70 69 rfajardo
echo ""
71 97 rfajardo
echo "In order to do so, SoC board's specific files for firmware compilation, "
72
echo "testbench generation and synthesis are configured."
73
echo "Firmware and testbench looks for board specific files under $BACKEND_DIR."
74
echo "Synthesis work under $SYN_DIR."
75 69 rfajardo
echo ""
76 97 rfajardo
echo ""
77 69 rfajardo
 
78 141 rfajardo
echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."
79
echo "__________________________________________________________________________"
80
echo ""
81
for file in "${BOARD_FILES[@]}"
82
do
83
    if [ $file != NONE ]
84
    then
85
        echo "Copying $file, to backend directory..."
86
        cp $BOARD_DIR/$file $BACKEND_DIR
87
    fi
88
done
89
echo ""
90
echo ""
91
 
92 97 rfajardo
echo "Generating project files for simulation and synthesis..."
93 141 rfajardo
echo "__________________________________________________________________________"
94
echo ""
95 97 rfajardo
make -C $MINSOC_DIR/prj
96
echo "Generation complete."
97
echo ""
98 141 rfajardo
echo ""
99 97 rfajardo
 
100 69 rfajardo
if [ $CONSTRAINT_FILE == 'NONE' ]
101
then
102
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
103 141 rfajardo
    echo ""
104
    echo ""
105 69 rfajardo
else
106 97 rfajardo
    echo "Device part for files under $SYNSRC_DIR will be patched and stored "
107 69 rfajardo
    echo "temporarily."
108 97 rfajardo
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
109 69 rfajardo
    echo "__________________________________________________________________________"
110
    echo ""
111
    for file in "${SYN_FILES[@]}"
112
    do
113
        echo "Updating synthesis file, $file..."
114
        echo "Copying $file to synthesis directory..."
115
        echo ""
116
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
117
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
118
        rm TMPFILE
119
    done
120
 
121 97 rfajardo
    echo "Updating Makefile file under $MAKEFILE_DIR..."
122
    echo "Copying Makefile to synthesis directory, $SYN_DIR..."
123 85 rfajardo
    echo ""
124
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
125
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
126
    rm TMPFILE
127 105 rfajardo
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
128 141 rfajardo
    echo ""
129
    echo ""
130 69 rfajardo
fi
131
 
132 142 rfajardo
#Precompiling firmwares
133
echo "Precompiling delivered libraries and firmwares..."
134 144 rfajardo
make -C ../../sw/utils
135
make -C ../../sw/support
136
make -C ../../sw/drivers
137
make -C ../../sw/uart
138 158 rfajardo
make -C ../../sw/jsp
139 144 rfajardo
make -C ../../sw/eth
140 142 rfajardo
echo "done."
141
echo ""
142
echo ""
143
 
144 141 rfajardo
echo "Configuration done."

powered by: WebSVN 2.1.0

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