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

Subversion Repositories tv80

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

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 38 ghutchis
    print "  -h : option help (this list)"
29
    sys.exit(0)
30
 
31
# parse command line options
32 44 ghutchis
# t : instruction trace
33
# d : dump starting at
34 38 ghutchis
# h : help
35 44 ghutchis
(options, args) = getopt.getopt (sys.argv[1:], "thd:")
36 38 ghutchis
if len(args) == 0:
37
    print_help()
38
testname = args[0]
39 89 ghutchis
simulator = "vcs +v2k -full64 -R -I +define+VCS=1 "
40 2 ghutchis
 
41
filelist = " -f env/tb.vf"
42
testdef  = " +incdir+env -l logs/%s.log +define+DUMPFILE_NAME=\\\"logs/%s.dump\\\" +define+PROGRAM_FILE=\\\"tests/%s.vmem\\\"" % (testname, testname, testname)
43
 
44 38 ghutchis
for option in options:
45 44 ghutchis
    if option[0] == "-t":
46 38 ghutchis
        print "Adding TV80_INSTRUCTION_DECODE"
47
        testdef += " +define+TV80_INSTRUCTION_DECODE=1"
48 44 ghutchis
    elif option[0] == "-d":
49
        testdef += " +define+DUMP_START=%s" % option[1]
50 38 ghutchis
    elif option[0] == "-h":
51
        print_help()
52
    else:
53
        print_help()
54
 
55 2 ghutchis
os.chdir ("tests")
56
os.system ("make %s.vmem" % testname)
57
os.chdir ("..")
58
 
59
command = simulator + filelist + testdef
60
 
61
print "command:",command
62
os.system (command)
63
 

powered by: WebSVN 2.1.0

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