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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [verilator/] [backend/] [std/] [configure] - Blame information for rev 139

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 116 rfajardo
echo "Copying board specific SoC files from $BOARD_DIR to $BACKEND_DIR directory."
51
echo "__________________________________________________________________________"
52
echo ""
53
for file in "${BOARD_FILES[@]}"
54
do
55
    if [ $file != NONE ]
56
    then
57
        echo "Copying $file, to backend directory..."
58
        cp $BOARD_DIR/$file $BACKEND_DIR
59
    fi
60
done
61
echo ""
62
echo ""
63
 
64 97 rfajardo
echo "Generating project files for simulation and synthesis..."
65 116 rfajardo
echo "__________________________________________________________________________"
66
echo ""
67 97 rfajardo
make -C $MINSOC_DIR/prj
68
echo "Generation complete."
69
echo ""
70 116 rfajardo
echo ""
71 97 rfajardo
 
72 65 rfajardo
if [ $CONSTRAINT_FILE == 'NONE' ]
73
then
74
    echo "Skipping synthesis preparation. Standard implementation can only be simulated."
75 116 rfajardo
    echo ""
76
    echo ""
77 65 rfajardo
else
78 97 rfajardo
    echo "Device part for files under $SYNSRC_DIR will be patched and stored "
79 65 rfajardo
    echo "temporarily."
80 97 rfajardo
    echo "Afterwards, they are copied to $SYNSUPPORT_DIR."
81 65 rfajardo
    echo "__________________________________________________________________________"
82
    echo ""
83
    for file in "${SYN_FILES[@]}"
84
    do
85
        echo "Updating synthesis file, $file..."
86
        echo "Copying $file to synthesis directory..."
87
        echo ""
88
        sed "s/$FIND_PART/$DEVICE_PART/g" $SYNSRC_DIR/$file > TMPFILE
89
        sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYNSUPPORT_DIR/$file
90
        rm TMPFILE
91
    done
92
 
93 97 rfajardo
    echo "Updating Makefile file under $MAKEFILE_DIR..."
94
    echo "Copying Makefile to synthesis directory, $SYN_DIR..."
95 87 rfajardo
    echo ""
96
    sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$MAKEFILE > TMPFILE
97
    sed "s/$FIND_CONSTRAINT/$CONSTRAINT_FILE/g" TMPFILE > TMPFILE2 && mv TMPFILE2 $SYN_DIR/$MAKEFILE
98
    rm TMPFILE
99 105 rfajardo
    cp $MAKEFILE_DIR/setup.bat $SYN_DIR/setup.bat
100 116 rfajardo
    echo ""
101
    echo ""
102 65 rfajardo
fi
103
 
104 116 rfajardo
echo "Configuration done."

powered by: WebSVN 2.1.0

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