Newer
Older
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import fileinput
import sys
import time
import os
from connection import Connection
import random
import string
import global_mod
from helper_classes import Manifest, ManifestParser
def main():
global_mod.t0 = time.time()
parser.add_option("--manifest-help", action="store_true",
dest="manifest_help", help="print manifest file variables description")
parser.add_option("-k", "--make", dest="make", action="store_true",
default=None, help="Generate a Makefile (simulation/synthesis)")
parser.add_option("-f", "--fetch", action="store_true", dest="fetch",
help="fetch and/or update remote modules listed in Manifet")
parser.add_option("--ise-proj", action="store_true", dest="ise_proj",
help="create an ise project including list of project files")
parser.add_option("-l", "--synthesize-locally", dest="local",
action="store_true", help="perform a local synthesis")
parser.add_option("-r", "--synthesize-remotelly", dest="remote",
action="store_true", help="perform a remote synthesis")
parser.add_option("-v", "--verbose", dest="verbose", action="store_true",
default="false", help="verbose mode")
parser.add_option("--ipcore", dest="ipcore", action="store_true",
default="false", help="generate a pseudo ip-core")
parser.add_option("--nodel", dest="nodel", action="store_true",
default="false", help="don't delete intermediate makefiles")
parser.add_option("--synth-server", dest="synth_server",
default=None, help="use given SERVER for remote synthesis", metavar="SERVER")
parser.add_option("--synth-user", dest="synth_user",
default=None, help="use given USER for remote synthesis", metavar="USER")
parser.add_option("--py", dest="arbitrary_code",
default="", help="add arbitrary code to all manifests' evaluation")
(options, args) = parser.parse_args()
global_mod.options = options
if options.manifest_help == True:
ManifestParser().help()
quit()
elif os.path.exists("Manifest.py"):
global_mod.top_module = Module(manifest=top_manifest, parent=None, source="local", fetchto=".")
global_mod.global_target = global_mod.top_module.target
p.echo("No manifest found. At least an empty one is needed")
global_mod.modules_pool = ModulePool(global_mod.top_module)
global_mod.ssh = Connection(ssh_user=options.synth_user, ssh_server=options.synth_server)
ssh = global_mod.ssh
from action_runner import ActionRunner
action_runner = ActionRunner(modules_pool=pool, connection=ssh)
if global_mod.options.fetch == True:
action_runner.fetch()
elif global_mod.options.local == True:
action_runner.run_local_synthesis()
elif global_mod.options.remote == True:
action_runner.run_remote_synthesis()
elif global_mod.options.make == True:
action_runner.generate_makefile()
elif global_mod.options.ise_proj == True:
action_runner.generate_ise_project(top_mod=tm)
if __name__ == "__main__":
main()