Exemple #1
0
                            NOERR=True)
    proc = next(gen)
    # watch the log file to determine when
    # the simulation ends
    sim_done = watch_log(log)
    if proc:
        proc.kill()
    return 0, not sim_done  # relog.get_stats(SIM_LOG)


def main(files, params):
    top = params.get("TOP_MODULE")
    print(top)
    if not top:
        for file in files:
            print(file)
            if file.endswidth(".asc"):
                top = file
                break
    if top:
        stats = run(top)
        return stats
    else:
        relog.error("No asc file detected")
    return 0, 0


if __name__ == "__main__":
    files, params = utils.get_sources(relog.filter_stream(sys.stdin), None)
    main(files, params)
Exemple #2
0
    flags = " ".join(chain([gen], Config.ncsim.get("flags").split()))
    # run simulation
    relog.step("Running simulation")
    executor.sh_exec("xrun %s -f %s" % (flags, SRCS),
                     PARSER_LOG,
                     MAX_TIMEOUT=300)


def run_lint(files, params):
    Config.add_config(os.path.join(TOOLS_DIR, "tools.config"))
    WAVE_FORMAT = Config.xcellium.get("format")
    DEFAULT_TMPDIR = utils.get_tmp_folder("lint")
    SRCS = os.path.join(DEFAULT_TMPDIR, "srcs.list")
    PARSER_LOG = os.path.join(DEFAULT_TMPDIR, "parser.log")
    SIM_LOG = os.path.join(DEFAULT_TMPDIR, "sim.log")
    WAVE = os.path.join(DEFAULT_TMPDIR, "run.%s" % WAVE_FORMAT)
    # generate scripts
    gen = prepare(files, params)
    flags = " ".join(chain([gen, "-hal"], Config.ncsim.get("flags").split()))
    # lint
    executor.sh_exec("xrun %s -f %s" % (flags, SRCS),
                     PARSER_LOG,
                     MAX_TIMEOUT=300)


if __name__ == "__main__":
    # create the list of sources
    PARAMS, MIMES, FILES = utils.get_sources(relog.filter_stream(sys.stdin),
                                             None)
    run_sim(FILES, PARAMS)