Example #1
0
 def generate_project(self):
     """ copy all hdl file in synthesis project directory
     """
     for component in self.parent.instances:
         if component.num == "0":
             # Make directory
             compdir = self.parent.projectpath +\
                 SYNTHESISPATH + "/" +\
                 component.name
             if sy.dir_exist(compdir):
                 DISPLAY.msg("Directory " + compdir +
                             " exist, will be deleted")
                 sy.rm_dir(compdir)
             sy.mkdir(compdir)
             DISPLAY.msg("Make directory for " + component.name)
             # copy hdl files
             for hdlfile in component.hdl_files:
                 try:
                     sy.cp_file(
                         self.parent.projectpath + COMPONENTSPATH + "/" +
                         component.instancename + "/hdl/" +
                         hdlfile.filename, compdir + "/")
                 except IOError as error:
                     print(DISPLAY)
                     raise PodError(str(error), 0)
Example #2
0
 def generate_project(self):
     """ copy all hdl file in synthesis project directory
     """
     for component in self.parent.instances:
         if component.num == "0":
             # Make directory
             compdir = self.parent.projectpath +\
                 SYNTHESISPATH + "/" +\
                 component.name
             if sy.dir_exist(compdir):
                 DISPLAY.msg("Directory " + compdir +
                             " exist, will be deleted")
                 sy.rm_dir(compdir)
             sy.mkdir(compdir)
             DISPLAY.msg("Make directory for " + component.name)
             # copy hdl files
             for hdlfile in component.hdl_files:
                 try:
                     sy.cp_file(self.parent.projectpath +
                                COMPONENTSPATH + "/" +
                                component.instancename +
                                "/hdl/" + hdlfile.filename,
                                compdir + "/")
                 except IOError as error:
                     print(DISPLAY)
                     raise PodError(str(error), 0)
Example #3
0
    def generate_bitstream(self):
        """ generate the bitstream """
        commandname = self.synthesis_toolcommandname
        scriptpath = os.path.join(self.parent.projectpath + SYNTHESISPATH,
                                  self.tcl_scriptname)

        pwd = sy.pwd()
        sy.del_all(self.project.projectpath + OBJSPATH)
        sy.chdir(self.project.projectpath + SYNTHESISPATH)

        commandname += " -mode tcl"
        scriptname = "-source " + scriptpath + " -tclargs build"
        binpath = self.project.projectpath + OBJSPATH + "/" + \
            self.project.name + ".runs/impl_1/"

        for line in sy.launch_as_shell(commandname, scriptname):
            if SETTINGS.color() == 1:
                print(COLOR_SHELL + line + COLOR_END),
            else:
                print("SHELL>" + line),
        for ext_file in self.ext_files:
            try:
                sy.cp_file(
                    binpath + BINARY_PREFIX + self.project.name + ext_file,
                    self.project.projectpath + BINARYPROJECTPATH + "/")
            except IOError:
                raise PodError("Can't copy bitstream")
        sy.chdir(pwd)
Example #4
0
    def generate_bitstream(self):
        """ generate the bitstream """
        commandname = self.synthesis_toolcommandname
        scriptpath = os.path.join(self.parent.projectpath + SYNTHESISPATH,
                                  self.tcl_scriptname)

        pwd = sy.pwd()
        sy.del_all(self.project.projectpath + OBJSPATH)
        sy.chdir(self.project.projectpath + SYNTHESISPATH)

        commandname += " -mode tcl"
        scriptname = "-source " + scriptpath + " -tclargs build"
        binpath = self.project.projectpath + OBJSPATH + "/" + \
            self.project.name + ".runs/impl_1/"

        for line in sy.launch_as_shell(commandname, scriptname):
            if SETTINGS.color() == 1:
                print(COLOR_SHELL + line + COLOR_END),
            else:
                print("SHELL>" + line),
        for ext_file in self.ext_files:
            try:
                sy.cp_file(binpath + BINARY_PREFIX + self.project.name +
                           ext_file,
                           self.project.projectpath + BINARYPROJECTPATH + "/")
            except IOError:
                raise PodError("Can't copy bitstream")
        sy.chdir(pwd)
Example #5
0
 def driver_toolchain(self, toolchainname):
     """ set driver toolchain """
     if toolchainname not in self.get_driver_toolchains():
         raise PodError("No toolchain named " + toolchainname + " in POD")
     sy.cp_file(
         SETTINGS.path + TOOLCHAINPATH + DRIVERSPATH + "/" + toolchainname +
         "/" + toolchainname + XMLEXT, self.projectpath + DRIVERSPATH + "/")
     sy.rename_file(
         self.projectpath + DRIVERSPATH + "/" + toolchainname + XMLEXT,
         self.projectpath + DRIVERSPATH + "/drivers" + XMLEXT)
     self.driver = Driver(self)
     self.save()
Example #6
0
 def driver_toolchain(self, toolchainname):
     """ set driver toolchain """
     if toolchainname not in self.get_driver_toolchains():
         raise PodError("No toolchain named " + toolchainname + " in POD")
     sy.cp_file(SETTINGS.path + TOOLCHAINPATH + DRIVERSPATH +
                "/" + toolchainname + "/" + toolchainname + XMLEXT,
                self.projectpath + DRIVERSPATH + "/")
     sy.rename_file(self.projectpath + DRIVERSPATH +
                    "/" + toolchainname + XMLEXT,
                    self.projectpath + DRIVERSPATH +
                    "/drivers" + XMLEXT)
     self.driver = Driver(self)
     self.save()
Example #7
0
 def simulation_toolchain(self, toolchainname):
     """ Set simulation toolchain """
     if toolchainname not in self.get_simulation_toolchains():
         raise PodError("No toolchain named " + toolchainname + " in POD")
     sy.cp_file(SETTINGS.path + TOOLCHAINPATH + SIMULATIONPATH +
                "/" + toolchainname + "/" + toolchainname + XMLEXT,
                self.projectpath + SIMULATIONPATH + "/")
     sy.rename_file(self.projectpath + SIMULATIONPATH +
                    "/" + toolchainname + XMLEXT,
                    self.projectpath + SIMULATIONPATH +
                    "/simulation" + XMLEXT)
     self.simulation = Simulation(self)
     self.save()
Example #8
0
 def simulation_toolchain(self, toolchainname):
     """ Set simulation toolchain """
     if toolchainname not in self.get_simulation_toolchains():
         raise PodError("No toolchain named " + toolchainname + " in POD")
     sy.cp_file(
         SETTINGS.path + TOOLCHAINPATH + SIMULATIONPATH + "/" +
         toolchainname + "/" + toolchainname + XMLEXT,
         self.projectpath + SIMULATIONPATH + "/")
     sy.rename_file(
         self.projectpath + SIMULATIONPATH + "/" + toolchainname + XMLEXT,
         self.projectpath + SIMULATIONPATH + "/simulation" + XMLEXT)
     self.simulation = Simulation(self)
     self.save()