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

Subversion Repositories tv80

[/] [tv80/] [trunk/] [scripts/] [run] - Blame information for rev 112

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ghutchis
#!/usr/bin/env python
2 5 ghutchis
# Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
3
#
4
# Permission is hereby granted, free of charge, to any person obtaining a
5
# copy of this software and associated documentation files (the "Software"),
6
# to deal in the Software without restriction, including without limitation
7
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
# and/or sell copies of the Software, and to permit persons to whom the
9
# Software is furnished to do so, subject to the following conditions:
10
#
11
# The above copyright notice and this permission notice shall be included
12
# in all copies or substantial portions of the Software.
13
#
14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 2 ghutchis
 
22 38 ghutchis
import sys, os, getopt
23 2 ghutchis
 
24 38 ghutchis
def print_help ():
25 44 ghutchis
    print "Usage: run [-th] [-d ###] "
26
    print "  -t : instruction decode (trace)"
27
    print "  -d : enable dumping start at time ###"
28 112 ghutchis
    print "  -c : enable code coverage"
29 38 ghutchis
    print "  -h : option help (this list)"
30
    sys.exit(0)
31
 
32
# parse command line options
33 44 ghutchis
# t : instruction trace
34
# d : dump starting at
35 38 ghutchis
# h : help
36 112 ghutchis
(options, args) = getopt.getopt (sys.argv[1:], "thcd:")
37 38 ghutchis
if len(args) == 0:
38
    print_help()
39
testname = args[0]
40 112 ghutchis
simulator = "vcs +v2k -full64 -R -I +vcs+lic+wait "
41 2 ghutchis
 
42
filelist = " -f env/tb.vf"
43
testdef  = " +incdir+env -l logs/%s.log +define+DUMPFILE_NAME=\\\"logs/%s.dump\\\" +define+PROGRAM_FILE=\\\"tests/%s.vmem\\\"" % (testname, testname, testname)
44
 
45 38 ghutchis
for option in options:
46 44 ghutchis
    if option[0] == "-t":
47 38 ghutchis
        print "Adding TV80_INSTRUCTION_DECODE"
48
        testdef += " +define+TV80_INSTRUCTION_DECODE=1"
49 44 ghutchis
    elif option[0] == "-d":
50
        testdef += " +define+DUMP_START=%s" % option[1]
51 112 ghutchis
    elif option[0] == "-c":
52
        # enable VCS code coverage
53
        testdef += " -cm line+branch -cm_dir cov/"+testname+" -cm_hier env/cov.vf"
54 38 ghutchis
    elif option[0] == "-h":
55
        print_help()
56
    else:
57
        print_help()
58
 
59 2 ghutchis
os.chdir ("tests")
60
os.system ("make %s.vmem" % testname)
61
os.chdir ("..")
62
 
63
command = simulator + filelist + testdef
64
 
65
print "command:",command
66
os.system (command)
67
 

powered by: WebSVN 2.1.0

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