Пример #1
0
 def setUp(self):
     self.gs = gen_sdb.GenSDB()
     self.user_paths = utils.get_user_verilog_dir()
Пример #2
0
def init(args, status):
    s = status
    #base_path = site_manager.DEFAULT_USER_BASE
    base_path = utils.get_user_project_dir()
    sm = site_manager.SiteManager(status)
    paths_dict = sm.get_paths_dict()

    #Check if the base that is in the paths dictionary exists or the user is forcing a new dictionary
    if (not os.path.exists(paths_dict["nysa_user_base"])) or args.force or args.reset:
        if s: s.Important("User base directory doesn't exists or a force or reset is detected")
        #base_path = paths_dict["nysa_user_base"]
        #base_path = site_manager.DEFAULT_USER_BASE
        base_path = utils.get_user_project_dir()
        #This is uniitializes nysa base
        if args.output is not None:
            base_path = os.path.expanduser(args.output[0])

        paths_dict["nysa_user_base"] = base_path

    elif args.output is not None:
        if args.output[0] != paths_dict["nysa_user_base"]:
            if s: s.Error("Specifying an output directory when one already exists!, use -F or -R to force a new directory")
            sys.exit(-1)
     
    paths_dict["nysa_user_base"] = base_path
    if s: s.Debug("Paths dict:\n%s" % json.dumps(paths_dict, sort_keys = True, indent = 2, separators=(",", ": ")))

    #Check to see if the final directory has been generated
    #Verilog Path
    #vpath = os.path.join(base_path, utils.USER_BASE_VERILOG_DIR)
    vpath = utils.get_user_verilog_dir()
    #Examples Path
    #epath = os.path.join(base_path, utils.USER_BASE_EXAMPLES_DIR)
    epath = utils.get_user_examples_dir()
    #Dev Path
    #dev_path = os.path.join(base_path, utils.USER_BASE_DEV_DIR)
    dev_path = utils.get_user_dev_dir()
    #Apps Path
    #app_path = os.path.join(base_path, utils.USER_BASE_APPS_DIR)
    app_path = utils.get_user_app_dir()
    #Ibuilder projects
    #user_ibuilder_path = os.path.join(base_path, utils.USER_BASE_IBUILDER_DIR)
    user_ibuilder_path = utils.get_user_ibuilder_project_dir()
    #Cbuilder projects
    #user_cbuilder_path = os.path.join(base_path, utils.USER_BASE_CBUILDER_DIR)
    user_cbuilder_path = utils.get_user_cbuilder_project_dir()

    if not os.path.exists(base_path):
        if s: s.Important("Generating nysa base directory")
        os.makedirs(base_path)
    if not os.path.exists(vpath):
        #Make the verilog directory
        if s: s.Important("Generating verilog directory")
        vpath = os.path.join(base_path, "verilog")
        os.makedirs(vpath)
    if not os.path.exists(epath):
        #Make the examples directory
        if s: s.Important("Generating examples directory")
        epath = os.path.join(base_path, "examples")
        os.makedirs(epath)
    if not os.path.exists(dev_path):
        #make the dev directory
        if s: s.Important("Generating dev directory")
        dev_path = os.path.join(base_path, "dev")
        os.makedirs(dev_path)
    if not os.path.exists(app_path):
        #Make the application directory
        if s: s.Important("Generating apps directory")
        app_path = os.path.join(base_path, "apps")
        os.makedirs(app_path)
    if not os.path.exists(user_ibuilder_path):
        #Make the user ibuilder project directory
        if s: s.Important("Generating user ibuilder directory")
        os.makedirs(user_ibuilder_path)

    if not os.path.exists(user_cbuilder_path):
        #Make the user cbuilder probject directory
        if s: s.Important("Generating user cbuilder directory")
        os.makedirs(user_cbuilder_path)

    #Adding Default Verilog Packages
    sm.install_verilog_module()
    #Adding Default boards
    sm.install_remote_board_package()
    sm.install_cocotb()
Пример #3
0
 def setUp(self):
     self.gs = gen_sdb.GenSDB()
     self.user_paths = utils.get_user_verilog_dir()