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

Subversion Repositories minsoc

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

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 85 rfajardo
SYNSRC_DIR=$SYN_DIR/xilinx
14 65 rfajardo
SYNSUPPORT_DIR=$SYN_DIR/buildSupport
15
 
16 85 rfajardo
SYN_FILES=(ethmac.xst uart_top.xst adbg_top.xst or1200_top.xst minsoc_top.xst Makefile)
17 65 rfajardo
 
18
FIND_PART='DEVICE_PART'
19
FIND_CONSTRAINT='CONSTRAINT_FILE'
20
 
21
BOARD_DIR=$BACKEND_DIR/$BOARD
22 69 rfajardo
BOARD_FILES=(board.h orp.ld minsoc_defines.v minsoc_bench_defines.v gcc-opt.mk $CONSTRAINT_FILE)
23 65 rfajardo
 
24
in_minsoc=`pwd | grep minsoc/backend/${BOARD}$`
25
if [ -z $in_minsoc ]
26
then
27
        echo ""
28
        echo "                  !!!WARNING!!!"
29 85 rfajardo
        echo "This script cannot be run if not in a board directory inside minsoc/backend,"
30 65 rfajardo
        echo "because it relies on the directory structure of the minsoc system."
31
        echo ""
32 85 rfajardo
        echo "Possibly your minsoc directory is named differently, minsoc_trunk for example."
33
        echo "Its name must be minsoc only."
34
        echo ""
35 65 rfajardo
fi
36
 
37
echo ""
38
echo "Configuring SoC board's specific files for firmware compilation, "
39
echo "testbench generation and synthesis."
40
echo "Firmware and testbench looks for board specific files under minsoc/backend."
41
echo "Synthesis work under minsoc/syn."
42
echo ""
43
echo ""
44
 
45
if [ $CONSTRAINT_FILE == 'NONE' ]
46
then
47
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
48
else
49
    echo "Device part for files under minsoc/syn/src will be patched and stored "
50
    echo "temporarily."
51
    echo "Afterwards, they are copied to minsoc/syn/buildSupport."
52
    echo "__________________________________________________________________________"
53
    echo ""
54
    for file in "${SYN_FILES[@]}"
55
    do
56
        echo "Updating synthesis file, $file..."
57
        echo "Copying $file to synthesis directory..."
58
        echo ""
59
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
60
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
61
        rm TMPFILE
62
    done
63
 
64
    echo "Moving Makefile back from minsoc/syn/buildSupport to minsoc/syn..."
65
    mv $SYNSUPPORT_DIR/Makefile $SYN_DIR
66
fi
67
echo ""
68
echo ""
69
 
70
 
71
echo "Copying board specific SoC files to backend directory."
72
echo "__________________________________________________________________________"
73
echo ""
74
for file in "${BOARD_FILES[@]}"
75
do
76
    if [ $file != NONE ]
77
    then
78
        echo "Copying $file, to backend directory..."
79
        cp $BOARD_DIR/$file $BACKEND_DIR
80
    fi
81
done
82
echo ""
83
echo ""

powered by: WebSVN 2.1.0

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