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

Subversion Repositories tv80

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

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 2 ghutchis
 
41 115 ghutchis
#simulator = "vcs +v2k -full64 -R -I +define+VCS=1 "
42
simulator = "iverilog "
43 2 ghutchis
 
44 115 ghutchis
#filelist = " -f env/tb.vf"
45
filelist = " -f env/tb_zmem.vf"
46
#testdef  = " +incdir+env -l logs/%s.log +define+DUMPFILE_NAME=\\\"logs/%s.dump\\\" +define+PROGRAM_FILE=\\\"tests/%s.vmem\\\"" % (testname, testname, testname)
47
testdef  = " +incdir+env -D DUMPFILE_NAME=\\\"logs/%s.dump\\\" -D PROGRAM_FILE=\\\"tests/%s.vmem\\\"" % (testname, testname)
48
 
49 38 ghutchis
for option in options:
50 44 ghutchis
    if option[0] == "-t":
51 38 ghutchis
        print "Adding TV80_INSTRUCTION_DECODE"
52
        testdef += " +define+TV80_INSTRUCTION_DECODE=1"
53 44 ghutchis
    elif option[0] == "-d":
54
        testdef += " +define+DUMP_START=%s" % option[1]
55 112 ghutchis
    elif option[0] == "-c":
56
        # enable VCS code coverage
57
        testdef += " -cm line+branch -cm_dir cov/"+testname+" -cm_hier env/cov.vf"
58 38 ghutchis
    elif option[0] == "-h":
59
        print_help()
60
    else:
61
        print_help()
62
 
63 2 ghutchis
os.chdir ("tests")
64
os.system ("make %s.vmem" % testname)
65
os.chdir ("..")
66
 
67
command = simulator + filelist + testdef
68
 
69
print "command:",command
70
os.system (command)
71 115 ghutchis
os.system ("./a.out")
72 2 ghutchis
 

powered by: WebSVN 2.1.0

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