Esempio n. 1
0
 def create_range_dict(self):
     if self.group == "ecp2_60":
         self.range_dict = dict(default="50,300,10",
                                ADPCMtest="10,50,5",
                                adpcm_codec_64ch="10,50,5")
     elif self.group == "sc_24":
         self.range_dict = dict(default="100,400,10")
     elif self.group == "large_25":
         self.range_dict = dict(default="50,300,10",
                                g64="10,100,5",
                                MARS128_iter="10,100,5",
                                MARS3in1_iter_42k="10,100,5",
                                RC6128_iter="10,100,5",
                                RC63in1_iter="10,100,5",
                                RIJNDAEL128_pipe_65k="10,100,5",
                                SERPENT_pipe_68k="10,100,5",
                                TWOFISH128_pipe="10,100,5",
                                TWOFISH3in1_pipe_72k="10,100,5",
                                sp7="10,100,5",
                                typhoon="10,100,5",
                                hdlc="10,100,5",
                                nozawa_top="10,100,5")
     elif self.group == "xo_103":
         self.range_dict = dict(default="50,400,10")
     else:  # never got here
         print_error("Unknown group name: %s" % self.group)
         return 1
Esempio n. 2
0
    def get_design_dict(self):
        if self.get_design_list():
            return

        design_dict = dict()
        for design in self.design_list:
            design_dir = os.path.join(self.top_dir, design)
            design_dir = win32api.GetLongPathName(
                win32api.GetShortPathName(design_dir))
            design = os.path.basename(
                design_dir)  # use the real letter for design name
            for i, mps in enumerate(self.mps_list):
                mps_dir = os.path.join(design_dir, mps)
                if not_exists(mps_dir):
                    if not i:  # models
                        continue
                    else:
                        print_error("Not found %s" % mps_dir)
                        break
                mps_fam_dir = self.get_fam_dir(mps_dir)
                if mps_fam_dir:
                    if design_dict.has_key(design):
                        design_dict[design][mps] = mps_fam_dir
                    else:
                        design_dict[design] = {mps: mps_fam_dir}
        if not design_dict:
            print_error("Not found cases for family %s" % self.family)
            return
        wrap_debug(design_dict, "Design Dictionary:")
        return design_dict
Esempio n. 3
0
 def get_top_module(self):
     srr_file = get_unique_file(
         [os.path.join(self.src_synthesis, "rev_1"), ".srr"])
     if not srr_file:
         return 1
     top_module = parse_file(srr_file, self.srr_pattern, at_once=True)
     if not top_module:
         print_error("Not found top module name in %s" % srr_file)
         return 1
     self.top_module = top_module.get("top_module")
Esempio n. 4
0
 def convert_designs(self):
     design_keys = self.design_dict.keys()
     design_keys.sort(key=str.lower)
     len_keys = len(design_keys)
     for i, design in enumerate(design_keys):
         print_always("Converting (%3d/%-3d): %s" %
                      (i + 1, len_keys, design))
         self.cur_design = design
         self.src_mps = self.design_dict.get(design)
         if self.convert_it():
             print_error("Failed to converting %s(%s)" %
                         (self.cur_design, self.family))
         else:
             print_always("convert %s successfully" % self.cur_design)
         print_always("")
Esempio n. 5
0
 def get_design_list(self):
     self.design_list = list()
     if self.design:
         if self._is_design(self.design):
             self.design_list.append(self.design)
         else:
             print_error("Check design %s" % self.design)
     else:
         for foo in os.listdir(self.top_dir):
             if self._is_design(foo):
                 self.design_list.append(foo)
     if not self.design_list:
         print_error("Not found any design under %s" % self.top_dir)
         return 1
     wrap_debug(self.design_list, "Design List:")
Esempio n. 6
0
    def get_device_info(self):
        for (fext, p) in self.patterns:
            prj_file = get_unique_file([self.src_par, fext])
            if prj_file:
                break
        else:
            print_error("Not found project file in %s" % self.src_par)
            return 1

        self.device_info = parse_file(prj_file, p)

        devkit = self.device_info.get("devkit")
        if devkit:  # lattice device
            devkit_detail = self.dev_parser.get_std_devkit(devkit)
            if not devkit_detail:
                return 1
            self.device_info["devkit"] = devkit_detail.get("name")
Esempio n. 7
0
 def create_hdl_info(self):
     if not self.raw_hdl:
         print_error("Not found hdl source file list")
         return 1
     for hdl_list in self.raw_hdl:
         try:
             lib_idx = hdl_list.index("-lib")
             lib_name = hdl_list[lib_idx + 1]
             if lib_name == "work":
                 lib_name = ""
         except ValueError:
             lib_name = ""
         real_file = self.get_real_path(hdl_list[-1])
         if not real_file:
             return 1
         if lib_name:
             real_file = "-lib %s %s" % (lib_name, real_file)
         self.hdl_info.append(real_file)
     wrap_debug(self.hdl_info, "HDL information:")
Esempio n. 8
0
    def check_options(self):
        # set logging level
        set_logging_level(self.debug)

        # check arguments
        if not_exists(self.from_dir, "source path"):
            return 1
        self.from_dir = os.path.abspath(self.from_dir)

        if wrap_md(self.to_dir, "destination path"):
            return 1
        self.to_dir = os.path.abspath(self.to_dir)

        if not self.group:
            print_error("No group name specified")
            return 1

        if not self.family:
            print_error("No family name specified")
            return 1

        # standardize family name and vendor name
        self.family, self.vendor = get_std_family_vendor(self.family)