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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [spartan3e_starter_kit/] [configure] - Blame information for rev 96

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

Line No. Rev Author Line
1 64 rfajardo
#!/bin/bash
2
 
3 66 rfajardo
#NON STANDARD SCRIPT, USE ANOTHER AS TEMPLATE, NON STANDARD PART IS MARKED AS COMMENT
4
 
5 64 rfajardo
#new boards have to udpate this
6
BOARD=spartan3e_starter_kit                                             #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.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 64 rfajardo
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
17 85 rfajardo
MAKEFILE_DIR=$SYN_DIR/xilinx
18 64 rfajardo
 
19 85 rfajardo
SYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst)
20
MAKEFILE=Makefile
21 64 rfajardo
 
22
FIND_PART='DEVICE_PART'
23
FIND_CONSTRAINT='CONSTRAINT_FILE'
24
 
25
BOARD_DIR=$BACKEND_DIR/$BOARD
26 69 rfajardo
BOARD_FILES=(board.h orp.ld minsoc_defines.v minsoc_bench_defines.v gcc-opt.mk $CONSTRAINT_FILE)
27 64 rfajardo
 
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 64 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 64 rfajardo
fi
41
 
42 66 rfajardo
#NON STANDARD SCRIPT PART
43
echo "THIS SCRIPT HAS A NON-STANDARD BEGINNING."
44
echo "__________________________________________________________________________"
45
echo "Spartan3E Starter Kit requires another configuration for or1200_r3."
46
echo "or1200_r1 should work fine, roll back this for minsoc release-1.0."
47
 
48 64 rfajardo
echo ""
49 66 rfajardo
echo "Copying or1200_defines.v, to or1200 implementation directory..."
50
echo "(minsoc/rtl/verilog/or1200/rtl/verilog)"
51
echo "__________________________________________________________________________"
52
cp $BOARD_DIR/or1200_defines.v $MINSOC_DIR/rtl/verilog/or1200/rtl/verilog
53
echo ""
54
echo "REGULAR SCRIPT STARTS NOW"
55
echo "__________________________________________________________________________"
56
#~NON STANDARD SCRIPT PART
57
 
58
echo ""
59 64 rfajardo
echo "Configuring SoC board's specific files for firmware compilation, "
60
echo "testbench generation and synthesis."
61
echo "Firmware and testbench looks for board specific files under minsoc/backend."
62
echo "Synthesis work under minsoc/syn."
63
echo ""
64
echo ""
65
 
66
if [ $CONSTRAINT_FILE == 'NONE' ]
67
then
68
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
69
else
70 86 rfajardo
    echo "Device part for files under minsoc/prj/xilinx will be patched and stored "
71 64 rfajardo
    echo "temporarily."
72
    echo "Afterwards, they are copied to minsoc/syn/buildSupport."
73
    echo "__________________________________________________________________________"
74
    echo ""
75
    for file in "${SYN_FILES[@]}"
76
    do
77
        echo "Updating synthesis file, $file..."
78
        echo "Copying $file to synthesis directory..."
79
        echo ""
80
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
81
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
82
        rm TMPFILE
83
    done
84
 
85 85 rfajardo
    echo "Updating Makefile file..."
86
    echo "Copying Makefile to synthesis directory..."
87
    echo ""
88
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
89
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
90
    rm TMPFILE
91 64 rfajardo
fi
92
echo ""
93
echo ""
94
 
95
 
96
echo "Copying board specific SoC files to backend directory."
97
echo "__________________________________________________________________________"
98
echo ""
99
for file in "${BOARD_FILES[@]}"
100
do
101
    if [ $file != NONE ]
102
    then
103
        echo "Copying $file, to backend directory..."
104
        cp $BOARD_DIR/$file $BACKEND_DIR
105
    fi
106
done
107
echo ""
108
echo ""

powered by: WebSVN 2.1.0

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