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

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [backend/] [std/] [configure] - Blame information for rev 133

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

Line No. Rev Author Line
1 65 rfajardo
#!/bin/bash
2
 
3
#new boards have to udpate this
4
BOARD=std                                               #this has to have the name of the directory this file is in
5
DEVICE_PART='NONE'
6
CONSTRAINT_FILE='NONE'
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 87 rfajardo
SYNSRC_DIR=$MINSOC_DIR/prj/xilinx
14 65 rfajardo
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
15 87 rfajardo
MAKEFILE_DIR=$SYN_DIR/xilinx
16 65 rfajardo
 
17 87 rfajardo
SYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst)
18
MAKEFILE=Makefile
19 65 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 65 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 65 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 87 rfajardo
    exit 1
38 65 rfajardo
fi
39
 
40
echo ""
41 97 rfajardo
echo "This script sets up the SoC for simulations and synthesis."
42 65 rfajardo
echo ""
43 97 rfajardo
echo "In order to do so, SoC board's specific files for firmware compilation, "
44
echo "testbench generation and synthesis are configured."
45
echo "Firmware and testbench looks for board specific files under $BACKEND_DIR."
46
echo "Synthesis work under $SYN_DIR."
47 65 rfajardo
echo ""
48 97 rfajardo
echo ""
49 65 rfajardo
 
50 97 rfajardo
echo "Generating project files for simulation and synthesis..."
51
make -C $MINSOC_DIR/prj
52
echo "Generation complete."
53
echo "__________________________________________________________________________"
54
echo ""
55
 
56 65 rfajardo
if [ $CONSTRAINT_FILE == 'NONE' ]
57
then
58
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
59
else
60 97 rfajardo
    echo "Device part for files under $SYNSRC_DIR will be patched and stored "
61 65 rfajardo
    echo "temporarily."
62 97 rfajardo
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
63 65 rfajardo
    echo "__________________________________________________________________________"
64
    echo ""
65
    for file in "${SYN_FILES[@]}"
66
    do
67
        echo "Updating synthesis file, $file..."
68
        echo "Copying $file to synthesis directory..."
69
        echo ""
70
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
71
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
72
        rm TMPFILE
73
    done
74
 
75 97 rfajardo
    echo "Updating Makefile file under $MAKEFILE_DIR..."
76
    echo "Copying Makefile to synthesis directory, $SYN_DIR..."
77 87 rfajardo
    echo ""
78
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
79
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
80
    rm TMPFILE
81 105 rfajardo
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
82 65 rfajardo
fi
83
echo ""
84
echo ""
85
 
86
 
87 97 rfajardo
echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."
88 65 rfajardo
echo "__________________________________________________________________________"
89
echo ""
90
for file in "${BOARD_FILES[@]}"
91
do
92
    if [ $file != NONE ]
93
    then
94
        echo "Copying $file, to backend directory..."
95
        cp $BOARD_DIR/$file $BACKEND_DIR
96
    fi
97
done
98
echo ""
99
echo ""

powered by: WebSVN 2.1.0

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