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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [altera_3c25_board/] [configure] - Blame information for rev 166

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

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