diff options
| author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-14 11:42:19 -0700 | 
|---|---|---|
| committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-14 11:42:19 -0700 | 
| commit | 00711ba213dde8aa0a099d2b18d3da0a33e6af79 (patch) | |
| tree | 612f616ebbf8080b5dc9cb5d64a8062e9aa3a498 /fpga/usrp3/top/python | |
| parent | 5de0bfce3f03cc45a1eed93dc1b8df1b188b5040 (diff) | |
| download | uhd-00711ba213dde8aa0a099d2b18d3da0a33e6af79.tar.gz uhd-00711ba213dde8aa0a099d2b18d3da0a33e6af79.tar.bz2 uhd-00711ba213dde8aa0a099d2b18d3da0a33e6af79.zip  | |
fpga: updating b200 and x300 FPGA source code for latest images
Diffstat (limited to 'fpga/usrp3/top/python')
| -rwxr-xr-x | fpga/usrp3/top/python/batch-build | 45 | ||||
| -rw-r--r-- | fpga/usrp3/top/python/make_lvbitx.py | 70 | 
2 files changed, 45 insertions, 70 deletions
diff --git a/fpga/usrp3/top/python/batch-build b/fpga/usrp3/top/python/batch-build new file mode 100755 index 000000000..fcf9ac7f5 --- /dev/null +++ b/fpga/usrp3/top/python/batch-build @@ -0,0 +1,45 @@ +#!/bin/bash + +iterations=1 +directory="." +targets="" +name="" +outdir=${PWD} + +for arg in "$@"; do +   if [[ $arg == "--help" ]]; then +      echo "Usage: batch-build [options] targets" +      echo "Options:" +      echo "   --runs=N [1]            Build the specified targets N times" +      echo "   --dir=<dir> [.]         Makefile directory" +      echo "   --name=<name> [<empty>] Name of this batch job. Used as a prefix for build output" +      echo "   --help                  Print the message and exit" +      echo "" +      exit 0 +   elif [[ $arg =~ "--runs="([0-9]+) ]]; then +      iterations=${BASH_REMATCH[1]} +   elif [[ $arg =~ "--dir="(.+) ]]; then +      directory=${BASH_REMATCH[1]} +   elif [[ $arg =~ "--name="(.+) ]]; then +      name=${BASH_REMATCH[1]}"_" +   else +      targets=$targets$arg" " +   fi +done + +cd $directory >/dev/null 2>&1 +if [ $? -ne 0 ]; then +   echo "ERROR: Could not cd to $directory" +   exit +fi + +for i in $(seq 1 $iterations); do +   make $targets +   if [ $? -ne 0 ]; then +      echo "ERROR: Build Failed!!! Stopping batch build." +      exit +   fi +   cp -rf build ${outdir}/${name}batch-build_$(date +'%Y-%m-%d_%H-%M-%S') +   make clean +done + diff --git a/fpga/usrp3/top/python/make_lvbitx.py b/fpga/usrp3/top/python/make_lvbitx.py deleted file mode 100644 index 1b78e35e4..000000000 --- a/fpga/usrp3/top/python/make_lvbitx.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 Ettus Research LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program.  If not, see <http://www.gnu.org/licenses/>. -# - - -import xml.etree.ElementTree as et -import base64 -from optparse import OptionParser - - -def main(): -    parser = OptionParser() -    parser.add_option("-l", "--lvbitxfile", dest="lvbitxfile", -                  help="donor labview fpga bitfile", metavar="LVBITXFILE") - -    parser.add_option("-b", "--bitfile", dest="bitfile", -                  help="xilinx generated bitfile", metavar="BITFILE") - -    parser.add_option("-o", "--output", dest="outfile", -                  help="output labview fpga bitfile", metavar="OUTFILE") - -    parser.add_option("-s", "--signature", dest="signature", -                  help="output labview fpga bitfile signature", metavar="SIGNATURE", -                  default="ABCDEFG") - - -    (options, args) = parser.parse_args() - -    tree = et.parse(options.lvbitxfile) -    root = tree.getroot() -    bs = root.find('Bitstream') -    if bs is None: return - -    print('Found "%s" tag in "%s"...' % (bs.tag, options.lvbitxfile)) - -    print('Writing old bitfile content to "%s"...' % (options.bitfile+'.bak')) -    f_old = open(options.bitfile+'.bak', 'w') -    f_old.write(base64.b64decode(bs.text)) -    f_old.close() - - -    print('Reading new bitfile "%s"...' % options.bitfile) -    f = open(options.bitfile, 'r') -    newbs = base64.b64encode(f.read()) -    f.close() - - -    bs.text = newbs -    print('Saving new labview bitfile to  "%s"...' % options.outfile) -    tree.write(options.outfile, xml_declaration=True, encoding='utf-8') - -if __name__ == '__main__': -    try: -        main() -    except KeyboardInterrupt: -        pass  | 
