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

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [verilator/] [prj/] [scripts/] [altvhdprj.sh] - Diff between revs 110 and 139

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 110 Rev 139
#!/bin/bash
#!/bin/bash
 
 
#system workings
#system workings
MINSOC_DIR=`pwd`/..
MINSOC_DIR=`pwd`/..
 
 
PROJECT=$1
PROJECT=$1
OUTPUT=$2
OUTPUT=$2
 
 
ENV=`uname -o`
ENV=`uname -o`
 
 
function adaptpath
function adaptpath
{
{
    if [ "$ENV" == "Cygwin" ]
    if [ "$ENV" == "Cygwin" ]
    then
    then
        local cygpath=`cygpath -w $1`
        local cygpath=`cygpath -w $1`
        local result=`echo $cygpath | sed 's/\\\\/\\//g'`
        local result=`echo $cygpath | sed 's/\\\\/\\//g'`
        echo "$result"
        echo "$result"
    else
    else
        echo "$1"
        echo "$1"
    fi
    fi
}
}
 
 
if [ ! -f $PROJECT ]
if [ ! -f $PROJECT ]
then
then
    echo "Unexistent project file."
    echo "Unexistent project file."
    exit 1
    exit 1
fi
fi
 
 
if [ -z "$OUTPUT" ]
if [ -z "$OUTPUT" ]
then
then
    echo "Second argument should be the destintion file for the file and directory inclusions."
    echo "Second argument should be the destintion file for the file and directory inclusions."
    exit 1
    exit 1
fi
fi
echo -n "" > $OUTPUT
echo -n "" > $OUTPUT
 
 
source $PROJECT
source $PROJECT
 
 
for dir in "${PROJECT_DIR[@]}"
for dir in "${PROJECT_DIR[@]}"
do
do
    adapted_dir=`adaptpath $MINSOC_DIR/$dir`
    adapted_dir=`adaptpath $MINSOC_DIR/$dir`
    echo "set_global_assignment -name SEARCH_PATH $adapted_dir" >> $OUTPUT
    echo "set_global_assignment -name SEARCH_PATH $adapted_dir" >> $OUTPUT
done
done
 
 
for file in "${PROJECT_SRC[@]}"
for file in "${PROJECT_SRC[@]}"
do
do
    FOUND=0
    FOUND=0
 
 
    for dir in "${PROJECT_DIR[@]}"
    for dir in "${PROJECT_DIR[@]}"
    do
    do
        if [ -f $MINSOC_DIR/$dir/$file ]
        if [ -f $MINSOC_DIR/$dir/$file ]
        then
        then
            adapted_file=`adaptpath $MINSOC_DIR/$dir/$file`
            adapted_file=`adaptpath $MINSOC_DIR/$dir/$file`
            echo "set_global_assignment -name VHDL_FILE $adapted_file" >> $OUTPUT
            echo "set_global_assignment -name VHDL_FILE $adapted_file" >> $OUTPUT
            FOUND=1
            FOUND=1
            break
            break
        fi
        fi
    done
    done
 
 
    if [ $FOUND != 1 ]
    if [ $FOUND != 1 ]
    then
    then
        echo "FILE NOT FOUND: $file"
        echo "FILE NOT FOUND: $file"
        exit 1
        exit 1
    fi
    fi
done
done
 
 

powered by: WebSVN 2.1.0

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