Ejemplo n.º 1
0
    except OSError:
        print "Cannot find repository at " + LOCAL
        sys.exit(-2)

    log = os.popen("git log -5").read()
    p.write(log)

    p.close()

    sys.exit(-3)


if __name__ == "__main__":
    # We must clone the repository before parsing any arguments
    remove_cached_files()
    git_clone()

    # now we can import the globals which sets up everything
    import globals
    globals.parse_args()
    # Update our local copy to the correct tech name for the email
    #globals TECH_NAME
    TECH_NAME = globals.OPTS.tech_name

    try:
        (tests, results) = regress()
        email_results(tests, results)
    except:
        email_failure(sys.exc_info())
    sys.exit(0)
            0, '\nFound ' + str(len(key_positions)) + ' carriage returns in ' +
            str(file_name) + ' (lines ' +
            ",".join(str(x) for x in line_numbers) + ')')
    f.close()
    return len(key_positions)


def check_print_output(file_name):
    """Check if any files (except debug.py) call the _print_ function. We should
    use the debug output with verbosity instead!"""
    file = open(file_name, "r+b")
    line = file.read()
    # skip comments with a hash
    line = re.sub(r'#.*', '', line)
    # skip doc string comments
    line = re.sub(r'\"\"\"[^\"]*\"\"\"', '', line, flags=re.S | re.M)
    count = len(re.findall("\s*print\s+", line))
    if count > 0:
        debug.info(
            0, "\nFound " + str(count) + " _print_ calls " + str(file_name))

    return (count)


# instantiate a copy of the class to actually run the test
if __name__ == "__main__":
    (OPTS, args) = globals.parse_args()
    del sys.argv[1:]
    header(__file__, OPTS.tech_name)
    unittest.main()
Ejemplo n.º 3
0
#
"""
SRAM Compiler

The output files append the given suffixes to the output name:
a spice (.sp) file for circuit simulation
a GDS2 (.gds) file containing the layout
a LEF (.lef) file for preliminary P&R (real one should be from layout)
a Liberty (.lib) file for timing analysis/optimization
"""

import sys
import datetime
import globals as g

(OPTS, args) = g.parse_args()

# Check that we are left with a single configuration file as argument.
if len(args) != 1:
    print(g.USAGE)
    sys.exit(2)

# These depend on arguments, so don't load them until now.
import debug

# Parse config file and set up all the options
g.init_openram(config_file=args[0], is_unit_test=False)

# Ensure that the right bitcell exists or use the parameterised one
g.setup_bitcell()