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

Subversion Repositories minsoc

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

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 96 javieralso
SYN_FILES=(adbg_top.prj jtag_top.prj or1200_top.prj uart_top.prj minsoc_top.prj altera_virtual_jtag.prj)
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 97 rfajardo
echo "Generating project files for simulation and synthesis..."
56
make -C $MINSOC_DIR/prj
57
echo "Generation complete."
58
echo "__________________________________________________________________________"
59
echo ""
60
 
61 93 javieralso
if [ $CONSTRAINT_FILE == 'NONE' ]
62
then
63
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
64
else
65 97 rfajardo
    echo "Device part and family for files under $SYNSRC_DIR will patched and stored "
66 93 javieralso
    echo "temporarily."
67 97 rfajardo
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
68 93 javieralso
    echo "__________________________________________________________________________"
69
    echo ""
70 95 javieralso
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$PROJECT_FILE > TMPFILE
71 93 javieralso
    sed "s/$FIND_FAMILY/$FAMILY_PART/g" TMPFILE > TMPFILE2
72
    #sed "s/$FIND_VERSION/$SW_VERSION/g" TMPFILE> TMPFILE
73
    echo "Adding settings from constraint file..."
74
    cat $CONSTRAINT_FILE >> TMPFILE2
75
 
76 95 javieralso
    echo "Generating quartus settings from prj files in $SYNSRC_DIR"
77 93 javieralso
    for file in "${SYN_FILES[@]}"
78
    do
79
        echo "Adding settings from file $file..."
80
        cat $SYNSRC_DIR/$file >> TMPFILE2
81
    done
82 95 javieralso
    mv TMPFILE2 $SYNSUPPORT_DIR/$PROJECT_FILE
83 93 javieralso
    rm TMPFILE
84
    echo ""
85 95 javieralso
    echo "Generated quartus settings file in $SYNSUPPORT_DIR/$PROJECT_FILE"
86 93 javieralso
    echo ""
87
 
88 97 rfajardo
    echo "Copying Makefile from $MAKEFILE_DIR to synthesis directory, $SYN_DIR..."
89 93 javieralso
    cp $MAKEFILE_DIR/$MAKEFILE $SYN_DIR/$MAKEFILE
90 105 rfajardo
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
91 93 javieralso
    echo ""
92
 
93 97 rfajardo
    echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."
94 93 javieralso
    echo "__________________________________________________________________________"
95
    echo ""
96
    for file in "${BOARD_FILES[@]}"
97
    do
98
        if [ $file != NONE ]
99
        then
100
            echo "Copying $file, to backend directory..."
101
            cp $BOARD_DIR/$file $BACKEND_DIR
102
        fi
103
    done
104
    echo ""
105
    echo "Configuration done."
106 95 javieralso
    echo "For synthesis help go to $SYN_DIR and type \"make\"."
107 93 javieralso
fi
108
 

powered by: WebSVN 2.1.0

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