OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [modelsim_setup.py] - Blame information for rev 3

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

Line No. Rev Author Line
1 3 gdevic
#!/usr/bin/env python
2
#
3
# This script sets up the environment to run ModelSim on each module.
4
#
5
# It sets up a relative path to your specific directory mapping by creating
6
# a file "mgc_location_map". We use the loction mapping so all paths to source
7
# files are relative.
8
#
9
#-------------------------------------------------------------------------------
10
#  Copyright (C) 2014  Goran Devic
11
#
12
#  This program is free software; you can redistribute it and/or modify it
13
#  under the terms of the GNU General Public License as published by the Free
14
#  Software Foundation; either version 2 of the License, or (at your option)
15
#  any later version.
16
#
17
#  This program is distributed in the hope that it will be useful, but WITHOUT
18
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
20
#  more details.
21
#-------------------------------------------------------------------------------
22
import os
23
 
24
def setup():
25
    # Create mgc_location_map with relative path mapping
26
    # Assumes this directory hierarchy:
27
    # $ROOT/<block>/<module>/simulation/modelsim/work/<this script>.py
28
    with open("mgc_location_map", "w") as f:
29
        f.write("$ROOT\n")
30
        path = os.path.abspath("../../../.")
31
        f.write(os.path.dirname(path))
32
 
33
# Return to our current directory after each module has been visited
34
abspath = os.path.abspath(__file__)
35
dname = os.path.dirname(abspath)
36
 
37
# Visit each ModelSim project directory...
38
os.chdir("cpu/alu/simulation/modelsim")
39
setup()
40
os.chdir(dname)
41
 
42
os.chdir("cpu/bus/simulation/modelsim")
43
setup()
44
os.chdir(dname)
45
 
46
os.chdir("cpu/control/simulation/modelsim")
47
setup()
48
os.chdir(dname)
49
 
50
os.chdir("cpu/registers/simulation/modelsim")
51
setup()
52
os.chdir(dname)
53
 
54
os.chdir("cpu/toplevel/simulation/modelsim")
55
setup()
56
os.chdir(dname)
57
 
58
os.chdir("host/basic/simulation/modelsim")
59
setup()
60
os.chdir(dname)
61
 
62
os.chdir("host/basic/uart/modelsim")
63
setup()
64
os.chdir(dname)

powered by: WebSVN 2.1.0

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