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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [spartan3a_dsp_kit/] [configure] - Blame information for rev 85

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 64 rfajardo
        exit 1
38
fi
39
 
40
echo ""
41
echo "Configuring SoC board's specific files for firmware compilation, "
42
echo "testbench generation and synthesis."
43
echo "Firmware and testbench looks for board specific files under minsoc/backend."
44
echo "Synthesis work under minsoc/syn."
45
echo ""
46
echo ""
47
 
48
if [ $CONSTRAINT_FILE == 'NONE' ]
49
then
50
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
51
else
52
    echo "Device part for files under minsoc/syn/src will be patched and stored "
53
    echo "temporarily."
54
    echo "Afterwards, they are copied to minsoc/syn/buildSupport."
55
    echo "__________________________________________________________________________"
56
    echo ""
57
    for file in "${SYN_FILES[@]}"
58
    do
59
        echo "Updating synthesis file, $file..."
60
        echo "Copying $file to synthesis directory..."
61
        echo ""
62
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
63
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
64
        rm TMPFILE
65
    done
66
 
67 85 rfajardo
    echo "Updating Makefile file..."
68
    echo "Copying Makefile to synthesis directory..."
69
    echo ""
70
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
71
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
72
    rm TMPFILE
73 64 rfajardo
fi
74
echo ""
75
echo ""
76
 
77
 
78
echo "Copying board specific SoC files to backend 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 ""

powered by: WebSVN 2.1.0

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