Example #1
0
 def list_components(self, libraryname=None):
     """ Return a list with all library components
     """
     if libraryname is None:
         libraryname = self.lib_name
     official_component_type = self.official_libraries()
     componentlist = []
     if libraryname in official_component_type:
         componentlist =\
             sy.list_dir(SETTINGS.path +
                         LIBRARYPATH + "/" +
                         libraryname)
     elif libraryname in self.personnal_libraries():
         componentlist =\
             sy.list_dir(self.get_pers_lib_path(libraryname))
     elif libraryname in self.get_component_lib_name():
         componentlist =\
             sy.list_dir(self.get_component_lib_path(libraryname))
     return componentlist
Example #2
0
 def list_components(self, libraryname=None):
     """ Return a list with all library components
     """
     if libraryname is None:
         libraryname = self.lib_name
     official_component_type = self.official_libraries()
     componentlist = []
     if libraryname in official_component_type:
         componentlist =\
             sy.list_dir(SETTINGS.path +
                         LIBRARYPATH + "/" +
                         libraryname)
     elif libraryname in self.personnal_libraries():
         componentlist =\
             sy.list_dir(self.get_pers_lib_path(libraryname))
     elif libraryname in self.get_component_lib_name():
         componentlist =\
             sy.list_dir(self.get_component_lib_path(libraryname))
     return componentlist
Example #3
0
 def complete_selectprojecttree(self, text, line, begidx, endidx):
     """complete selectprojecttree command directories """
     path = line.split(" ")[1]
     if path.find("/") == -1:  # sub
         path = ""
     elif text.split() == "":  # sub/sub/
         path = "/".join(path) + "/"
     else:  # sub/sub
         path = "/".join(path.split("/")[0:-1]) + "/"
     listdir = sy.list_dir(path)
     return self.completelist(line, text, listdir)
Example #4
0
 def complete_selectprojecttree(self, text, line, begidx, endidx):
     """complete selectprojecttree command directories """
     path = line.split(" ")[1]
     if path.find("/") == -1:  # sub
         path = ""
     elif text.split() == "":  # sub/sub/
         path = "/".join(path) + "/"
     else:  # sub/sub
         path = "/".join(path.split("/")[0:-1]) + "/"
     listdir = sy.list_dir(path)
     return self.completelist(line, text, listdir)
Example #5
0
 def copy_bsp_drivers(self):
     """ delete all directories under POD dir, then copy
     drivers in."""
     bspdir = self.get_bsp_dir()
     if bspdir is None:
         raise PodError("Set directory before", 0)
     # deleting all directory in POD dir
     sy.del_all_dir(bspdir)
     for directory in \
             sy.list_dir(self.project.projectpath + DRIVERSPATH + "/"):
         sy.cp_dir(self.project.projectpath + DRIVERSPATH + "/" + directory,
                   self.get_bsp_dir())
Example #6
0
 def complete_load(self, text, line, begidx, endidx):
     """ complete load command with files under directory """
     path = line.split(" ")[1]
     if path.find("/") == -1:  # sub
         path = ""
     elif text.split() == "":  # sub/sub/
         path = "/".join(path) + "/"
     else:  # sub/sub
         path = "/".join(path.split("/")[0:-1]) + "/"
     listdir = sy.list_dir(path)
     listfile = sy.list_file_type(path, XMLEXT[1:])
     listfile.extend(listdir)
     return self.completelist(line, text, listfile)
Example #7
0
 def copy_bsp_drivers(self):
     """ delete all directories under POD dir, then copy
     drivers in."""
     bspdir = self.get_bsp_dir()
     if bspdir is None:
         raise PodError("Set directory before", 0)
     # deleting all directory in POD dir
     sy.del_all_dir(bspdir)
     for directory in \
             sy.list_dir(self.project.projectpath + DRIVERSPATH + "/"):
         sy.cp_dir(self.project.projectpath + DRIVERSPATH +
                   "/" + directory,
                   self.get_bsp_dir())
Example #8
0
 def complete_load(self, text, line, begidx, endidx):
     """ complete load command with files under directory """
     path = line.split(" ")[1]
     if path.find("/") == -1:  # sub
         path = ""
     elif text.split() == "":  # sub/sub/
         path = "/".join(path) + "/"
     else:  # sub/sub
         path = "/".join(path.split("/")[0:-1]) + "/"
     listdir = sy.list_dir(path)
     listfile = sy.list_file_type(path, XMLEXT[1:])
     listfile.extend(listdir)
     return self.completelist(line, text, listfile)
Example #9
0
 def check_lib(self, path):
     """ check if lib and component are not duplicated """
     libname = path.split("/")[-1]
     # check if lib name exist
     if libname in self.libraries:
         raise PodError("Library " + libname + " already exist", 0)
     # check if components under library are new
     componentlist = sy.list_dir(path)
     for component in componentlist:
         for libraryname in self.libraries:
             if component in self.list_components(libraryname):
                 raise PodError("Library " + libname +
                                " contain a component that exist in '" +
                                libraryname + "' : " + component, 0)
Example #10
0
 def check_lib(self, path):
     """ check if lib and component are not duplicated """
     libname = path.split("/")[-1]
     # check if lib name exist
     if libname in self.libraries:
         raise PodError("Library " + libname + " already exist", 0)
     # check if components under library are new
     componentlist = sy.list_dir(path)
     for component in componentlist:
         for libraryname in self.libraries:
             if component in self.list_components(libraryname):
                 raise PodError(
                     "Library " + libname +
                     " contain a component that exist in '" + libraryname +
                     "' : " + component, 0)
Example #11
0
    def generate_tcl(self, filename=None):
        """ generate tcl script
        """
        if filename is None:
            filename = self.project.name + TCLEXT

        tclfile = open(
            self.project.projectpath + SYNTHESISPATH + "/" + filename, "w")
        tclfile.write("# TCL script automaticaly generated by POD\n")
        # create project
        tclfile.write("cd .." + OBJSPATH + "\n")
        tclfile.write(self.project_base_creation())

        # Configuration
        tclfile.write("# configure platform params\n")
        tclfile.write(self.project_base_configuration())

        # Source files
        tclfile.write("## add components sources file\n")
        tclfile.write("# add top level sources file\n")
        tclfile.write(
            self.add_file_to_tcl(".." + SYNTHESISPATH + "/top_" +
                                 self.project.name + VHDLEXT))

        for directory in sy.list_dir(self.project.projectpath + SYNTHESISPATH):
            for afile in sy.list_files(self.project.projectpath +
                                       SYNTHESISPATH + "/" + directory):
                tclfile.write(
                    self.add_file_to_tcl(".." + SYNTHESISPATH + "/" +
                                         directory + "/" + afile))

        # Constraints files
        tclfile.write("# add constraint file\n")
        tclfile.write(
            self.add_constraints_file(SYNTHESISPATH + "/" + self.project.name))
        tclfile.write(self.insert_tools_specific_commands())

        tclfile.write(self.insert_tools_gen_cmds())

        DISPLAY.msg("TCL script generated with name : " + self.project.name +
                    TCLEXT)

        self.tcl_scriptname = self.project.name + TCLEXT
        return self.tcl_scriptname
Example #12
0
    def generate_tcl(self, filename=None):
        """ generate tcl script
        """
        if filename is None:
            filename = self.project.name + TCLEXT

        tclfile = open(self.project.projectpath + SYNTHESISPATH + "/" +
                       filename, "w")
        tclfile.write("# TCL script automaticaly generated by POD\n")
        # create project
        tclfile.write("cd .." + OBJSPATH + "\n")
        tclfile.write(self.project_base_creation())

        # Configuration
        tclfile.write("# configure platform params\n")
        tclfile.write(self.project_base_configuration())

        # Source files
        tclfile.write("## add components sources file\n")
        tclfile.write("# add top level sources file\n")
        tclfile.write(self.add_file_to_tcl(".." + SYNTHESISPATH + "/top_" +
                      self.project.name + VHDLEXT))

        for directory in sy.list_dir(self.project.projectpath + SYNTHESISPATH):
            for afile in sy.list_files(self.project.projectpath +
                                       SYNTHESISPATH + "/" + directory):
                tclfile.write(self.add_file_to_tcl(".." + SYNTHESISPATH + "/" +
                              directory + "/" + afile))

        # Constraints files
        tclfile.write("# add constraint file\n")
        tclfile.write(self.add_constraints_file(SYNTHESISPATH + "/" +
                                                self.project.name))
        tclfile.write(self.insert_tools_specific_commands())

        tclfile.write(self.insert_tools_gen_cmds())

        DISPLAY.msg("TCL script generated with name : " +
                    self.project.name + TCLEXT)

        self.tcl_scriptname = self.project.name + TCLEXT
        return self.tcl_scriptname
Example #13
0
 def availables_plat(cls):
     """ List all supported platforms names
     """
     platformlist = sy.list_dir(SETTINGS.path + PLATFORMPATH)
     return platformlist
Example #14
0
 def get_synthesis_toolchains(cls):
     """ list all toolchains availables """
     filelist = sy.list_dir(SETTINGS.path +
                            TOOLCHAINPATH + SYNTHESISPATH)
     return filelist
Example #15
0
 def get_driver_toolchains(cls):
     """ list all toolchains availables """
     filelist = sy.list_dir(SETTINGS.path +
                            TOOLCHAINPATH + DRIVERSPATH)
     return filelist
Example #16
0
 def availables_plat(cls):
     """ List all supported platforms names
     """
     platformlist = sy.list_dir(SETTINGS.path + PLATFORMPATH)
     return platformlist
Example #17
0
 def get_simulation_toolchains(cls):
     """ list all toolchain availables """
     filelist = sy.list_dir(SETTINGS.path +
                            TOOLCHAINPATH + SIMULATIONPATH)
     return filelist
Example #18
0
 def get_driver_toolchains(cls):
     """ list all toolchains availables """
     filelist = sy.list_dir(SETTINGS.path + TOOLCHAINPATH + DRIVERSPATH)
     return filelist
Example #19
0
 def get_synthesis_toolchains(cls):
     """ list all toolchains availables """
     filelist = sy.list_dir(SETTINGS.path + TOOLCHAINPATH + SYNTHESISPATH)
     return filelist
Example #20
0
 def libraries(self):
     """ Return a list of libraries availables """
     componentlist = sy.list_dir(SETTINGS.path + LIBRARYPATH)
     componentlist.extend(self.personnal_libraries())
     componentlist.extend(self.get_component_lib_name())
     return componentlist
Example #21
0
 def official_libraries(cls):
     """ Get list of official libraries"""
     return sy.list_dir(SETTINGS.path + LIBRARYPATH)
Example #22
0
 def libraries(self):
     """ Return a list of libraries availables """
     componentlist = sy.list_dir(SETTINGS.path + LIBRARYPATH)
     componentlist.extend(self.personnal_libraries())
     componentlist.extend(self.get_component_lib_name())
     return componentlist
Example #23
0
 def official_libraries(cls):
     """ Get list of official libraries"""
     return sy.list_dir(SETTINGS.path + LIBRARYPATH)
Example #24
0
 def get_simulation_toolchains(cls):
     """ list all toolchain availables """
     filelist = sy.list_dir(SETTINGS.path + TOOLCHAINPATH + SIMULATIONPATH)
     return filelist