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

Subversion Repositories tv80

[/] [tv80/] [trunk/] [scripts/] [irun] - Blame information for rev 116

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 116 ghutchis
#!/usr/bin/env python
2
# 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
 
22
import sys, os, getopt
23
 
24
def print_help ():
25
    print "Usage: run [-th] [-d ###] "
26
    print "  -t : instruction decode (trace)"
27
    print "  -d : enable dumping start at time ###"
28
    print "  -c : enable code coverage"
29
    print "  -h : option help (this list)"
30
    sys.exit(0)
31
 
32
# parse command line options
33
# t : instruction trace
34
# d : dump starting at
35
# h : help
36
(options, args) = getopt.getopt (sys.argv[1:], "thcd:")
37
if len(args) == 0:
38
    print_help()
39
testname = args[0]
40
 
41
simulator = "iverilog "
42
 
43
filelist = " -f env/tb.vf"
44
#filelist = " -f env/tb_zmem.vf"
45
testdef  = " +incdir+env -D DUMPFILE_NAME=\\\"logs/%s.lx2\\\" -D PROGRAM_FILE=\\\"tests/%s.vmem\\\"" % (testname, testname)
46
 
47
for option in options:
48
    if option[0] == "-t":
49
        print "Adding TV80_INSTRUCTION_DECODE"
50
        testdef += " -D TV80_INSTRUCTION_DECODE=1"
51
    elif option[0] == "-d":
52
        testdef += " -D DUMP_START=%s" % option[1]
53
    elif option[0] == "-h":
54
        print_help()
55
    else:
56
        print_help()
57
 
58
os.chdir ("tests")
59
os.system ("make %s.vmem" % testname)
60
os.chdir ("..")
61
 
62
command = simulator + filelist + testdef
63
 
64
print "command:",command
65
os.system (command)
66
os.system ("./a.out -lx2")
67
 

powered by: WebSVN 2.1.0

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