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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [verilator/] [backend/] [altera_3c25_board/] [configure] - Blame information for rev 96

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
FAMILY_PART="Cyclone III"
7
CONSTRAINT_FILE='altera_3c25_board.ucf'
8
PROJECT_FILE=minsoc_top.qsf
9
#SW_VERSION=`quartus_map -v | grep Version`
10
#~new boards update
11
 
12
#system workings
13
MINSOC_DIR=`pwd`/../..
14
BACKEND_DIR=$MINSOC_DIR/backend
15
SYN_DIR=$MINSOC_DIR/syn
16
SYNSRC_DIR=$MINSOC_DIR/prj/altera
17
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
18
MAKEFILE_DIR=$SYN_DIR/altera
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
echo "Configuring SoC board's specific files for firmware compilation, "
47
echo "testbench generation and synthesis."
48
echo "Firmware and testbench looks for board specific files under minsoc/backend."
49
echo "Synthesis work under minsoc/syn."
50
echo ""
51
echo ""
52
 
53
if [ $CONSTRAINT_FILE == 'NONE' ]
54
then
55
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
56
else
57 95 javieralso
    echo "Device part and family for qsf file under $MAKEFILE_DIR will patched and stored "
58 93 javieralso
    echo "temporarily."
59
    echo "Afterwards, they are copied to minsoc/syn/buildSupport."
60
    echo "__________________________________________________________________________"
61
    echo ""
62 95 javieralso
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$PROJECT_FILE > TMPFILE
63 93 javieralso
    sed "s/$FIND_FAMILY/$FAMILY_PART/g" TMPFILE > TMPFILE2
64
    #sed "s/$FIND_VERSION/$SW_VERSION/g" TMPFILE> TMPFILE
65
    echo "Adding settings from constraint file..."
66
    cat $CONSTRAINT_FILE >> TMPFILE2
67
 
68 95 javieralso
    echo "Generating quartus settings from prj files in $SYNSRC_DIR"
69 93 javieralso
    for file in "${SYN_FILES[@]}"
70
    do
71
        echo "Adding settings from file $file..."
72
        cat $SYNSRC_DIR/$file >> TMPFILE2
73
    done
74 95 javieralso
    mv TMPFILE2 $SYNSUPPORT_DIR/$PROJECT_FILE
75 93 javieralso
    rm TMPFILE
76
    echo ""
77 95 javieralso
    echo "Generated quartus settings file in $SYNSUPPORT_DIR/$PROJECT_FILE"
78 93 javieralso
    echo ""
79
 
80
    echo "Copying Makefile to synthesis directory..."
81
    cp $MAKEFILE_DIR/$MAKEFILE $SYN_DIR/$MAKEFILE
82
    echo ""
83
 
84
    echo "Copying board specific SoC files to backend directory."
85
    echo "__________________________________________________________________________"
86
    echo ""
87
    for file in "${BOARD_FILES[@]}"
88
    do
89
        if [ $file != NONE ]
90
        then
91
            echo "Copying $file, to backend directory..."
92
            cp $BOARD_DIR/$file $BACKEND_DIR
93
        fi
94
    done
95
    echo ""
96
    echo "Configuration done."
97 95 javieralso
    echo "For synthesis help go to $SYN_DIR and type \"make\"."
98 93 javieralso
fi
99
 

powered by: WebSVN 2.1.0

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