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

Subversion Repositories radiohdl

[/] [radiohdl/] [trunk/] [quartus/] [run_qsys_pro] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 danv
#!/bin/bash -eu
2
# -------------------------------------------------------------------------- #
3
#
4
# Copyright (C) 2010
5
# ASTRON (Netherlands Institute for Radio Astronomy) 
6
# JIVE (Joint Institute for VLBI in Europe) 
7
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
8
#
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation, either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program.  If not, see .
21
#
22
# -------------------------------------------------------------------------- #
23
 
24
# Run this tool with the commandline arguments:
25
#   run_qsys buildset design_name
26
# example:
27
#   run_qsys unb2 unb2_minimal_qsys
28
 
29
# read generic functions/definitions
30
. ${RADIOHDL_GEAR}/generic.sh
31
 
32
if [ $# -ne 2 ] && [ $# -ne 3 ]; then
33
    hdl_error $0 "Syntax: run_qsys   []"
34
fi
35
 
36
buildset=$1
37
project=$2
38
qsysfile=${3:+$3}
39
 
40
# read in the configuration based on the user arguments
41
. ${RADIOHDL_GEAR}/quartus/set_quartus ${buildset}
42
 
43
# search for existing project directory
44
PRJS="${RADIOHDL_BUILD_DIR}"
45
PRJ=
46
for prj in ${PRJS}
47
    do
48
        if [ -d "${prj}/${buildset}/quartus/${project}" ]; then
49
            PRJ=${prj}
50
        fi
51
    done
52
if [ -z "${project}" -o -z "${PRJ}" ]; then
53
    hdl_error $0 "Please enter a valid project name"
54
fi
55
 
56
# Fconstruct the name of quartusdir and check if it exists
57
quartusdir="${PRJ}/${buildset}/quartus/${project}"
58
hdl_exec $0 msg=no test -d ${quartusdir}
59
 
60
# The QSYS file is optional. If it is omitted choose the first
61
# one we find. Let user know we do this
62
set +e
63
if [ -z "${qsysfile}" ]; then
64
    qsysfile=$(ls ${quartusdir}/*qsys 2>/dev/null | sed -n 1p)
65
    if [ -z "${qsysfile}" ]; then
66
        hdl_error $0 "No QSYS files found in ${quartusdir}"
67
    fi
68
fi
69
set -e
70
qsysfile=`basename ${qsysfile}`
71
qsysfilebase=`basename ${qsysfile} .qsys`
72
if [ "${3:+$3}" != "${qsysfile}" ]; then
73
    hdl_info $0 "SELECTING DEFAULT QSYS FILE ${qsysfile} (${qsysfilebase})"
74
fi
75
if [ ! -f "${quartusdir}/${qsysfile}" ]; then
76
    hdl_error $0 "QSYS file '${qsysfile}' not found in ${quartusdir}"
77
fi
78
 
79
# Great. Having asserted our preconditions, let's do it!
80
# note: we want hdl_exec to display a slightly different msg
81
#       AND ip-generate returns exitcode 4 on succesfull completion
82
#           rather than the standard 0 ...
83
cd ${quartusdir}
84
txt="Generating QSYS PRO system for project ${project}."
85
 
86
# Note: ip-generate does NOT look in user_components.ipx in the users home directory!
87
 
88
hdl_info $0 "generating QSYS PRO system for unb2b project"
89
hdl_exec $0 msg="${txt}" expect=0 qsys-generate ${quartusdir}/${qsysfile} \
90
            --search-path=${quartusdir}/ip/${qsysfilebase},$ \
91
            --synthesis=VHDL \
92
            --block-symbol-file \
93
            --quartus-project=${quartusdir}/${project}.qpf
94
cp ${quartusdir}/${qsysfilebase}/${qsysfilebase}.sopcinfo ${quartusdir}
95
cp ${quartusdir}/${qsysfilebase}/${qsysfilebase}.bsf ${quartusdir}
96
cp ${quartusdir}/${qsysfilebase}/${qsysfilebase}.qip ${quartusdir}
97
hdl_info $0 "QSYS generated successfully."
98
 
99
# Additionally build the UNBOS App here as well:
100
. ${RADIOHDL_GEAR}/set_hdllib_variable ${buildset} ${project} nios2_app_userflags
101
if [ -n "${nios2_app_userflags}" ]; then
102
    hdl_info $0 "Additionally building the UNBOS App."
103
    ${RADIOHDL_GEAR}/quartus/run_app_clean ${buildset} ${project}
104
    ${RADIOHDL_GEAR}/quartus/run_app ${buildset} ${project} --userflags=${nios2_app_userflags}
105
fi
106
 

powered by: WebSVN 2.1.0

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