當前位置: 首頁>>代碼示例>>Python>>正文


Python Tinker類代碼示例

本文整理匯總了Python中Tinker的典型用法代碼示例。如果您正苦於以下問題:Python Tinker類的具體用法?Python Tinker怎麽用?Python Tinker使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Tinker類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: parse_grouping

 def parse_grouping(cls, e):
     ids = parse_list(e, "grouping")
     for i in ids:
         if(not Tinker.is_id(i)):
             Tinker.value_error_xml("grouping", i, "Alphabetic Characters",
                                    ET.tostring(e))
     return ids
開發者ID:drichmond,項目名稱:tinker,代碼行數:7,代碼來源:Phy.py

示例2: parse_macros

def parse_macros(e):
    macros = parse_list(e, "macros")
    for m in macros:
        if(not Tinker.is_valid_verilog_name(m)):
            Tinker.value_error_xml("macros", m, "Valid Verilog Names",
                                   ET.tostring(e))
    return macros
開發者ID:drichmond,項目名稱:tinker,代碼行數:7,代碼來源:IP.py

示例3: __generate_macro_file

 def __generate_macro_file(self, p):
     Tinker.check_path(p)
     ms = self.__d.get_macros(self.__t.get_version(), False)
     mfp = open(p + "/tinker.vh", "w")
     for m in ms:
         mfp.write("define `%s + \n" % m)
     mfp.close()
開發者ID:drichmond,項目名稱:tinker,代碼行數:7,代碼來源:Top.py

示例4: parse_oct_pins

 def parse_oct_pins(cls, e):
     pins = parse_list(e, "oct_pins")
     for p in pins:
         if(not Tinker.is_valid_verilog_name(p)):
             Tinker.value_error_xml("oct_pins", p, "Valid Verilog Names",
                                    ET.tostring(e))
     return pins
開發者ID:drichmond,項目名稱:tinker,代碼行數:7,代碼來源:Phy.py

示例5: parse_string

def parse_string(e, k):
    s = e.get(k)
    if(s is None):
        Tinker.key_error(k, ET.tostring(e))
    elif(not Tinker.is_string(s)):
        Tinker.value_error_xml(k, s, "Strings", ET.tostring(e))
    return s
開發者ID:drichmond,項目名稱:tinker,代碼行數:7,代碼來源:IP.py

示例6: parse_interface_keys

 def parse_interface_keys(cls, desc):
     k = set(desc.keys())
     err = (k - cls._C_MEMORY_KEYS)
     if(err != set()):
         print "In description:"
         Tinker.tostr_dict(desc)
         sys.exit("Error! Unknown keys: %s" % str(list(err)))
     return k
開發者ID:drichmond,項目名稱:tinker,代碼行數:8,代碼來源:GroupMemoryInterface.py

示例7: parse_keys

 def parse_keys(cls,desc):
     k = set(desc.keys())
     ifs = set(cls.parse_interfaces(desc))
     err = (k - ifs - cls._C_DESCRIPTION_KEYS)
     if(err != set()):
         print "In description:"
         Tinker.print_description(desc)
         sys.exit("Error! Unknown keys: %s" % str(list(err)))
     return k | ifs
開發者ID:drichmond,項目名稱:tinker,代碼行數:9,代碼來源:Description.py

示例8: check_quantity

 def check_quantity(cls, d):
     super(GlobalMemoryInterface,cls).check_quantity(d)
     
     cls.check_interfaces(d)
     ifs = cls.parse_interfaces(d)
     q = parse_int(d, "quantity")
     if(q != len(ifs)):
         Tinker.value_error_map("quantity",str(q),str(ifs),
                                Tinker.tostr_dict(d))
開發者ID:drichmond,項目名稱:tinker,代碼行數:9,代碼來源:GlobalMemoryInterface.py

示例9: write

 def write(self, p):
     Tinker.check_path(p)
     p += "/" + "system.qsys"
     Tinker.check_path(p)
     r = self.getroot()
     ifs = self.__d.get_pin_elements(self.__b["version"], False)
     for i in ifs:
         r.append(i)
     super(System, self).write(p, encoding="UTF-8", xml_declaration=True)
開發者ID:drichmond,項目名稱:tinker,代碼行數:9,代碼來源:System.py

示例10: parse_burst

 def parse_burst(cls,d):
     b = parse_int(d, "burst")
     if(not Tinker.is_in_range(b,cls._C_INTERFACE_BURST_RANGE[0],
                               cls._C_INTERFACE_BURST_RANGE[1])):
         Tinker.value_error_map("burst", str(b),
                            "range(%d, %d)"
                            % (cls._C_INTERFACE_BURST_RANGE[0],
                               cls._C_INTERFACE_BURST_RANGE[1]),
                               Tinker.tostr_dict(d))
     return b
開發者ID:drichmond,項目名稱:tinker,代碼行數:10,代碼來源:GroupMemoryInterface.py

示例11: construct

def construct(t):
    import GlobalMemoryInterface, HostInterface, KernelInterface
    if(t == "GlobalMemory"):
        return GlobalMemoryInterface.GlobalMemoryInterface
    elif(t == "Host"):
        return HostInterface.HostInterface
    elif(t == "Kernel"):
        return KernelInterface.KernelInterface
    else:
        Tinker.value_error("interfaces", str(t), str(Interface._C_INTERFACE_TYPES))
開發者ID:drichmond,項目名稱:tinker,代碼行數:10,代碼來源:Interface.py

示例12: check_quantity

 def check_quantity(cls,d):
     q = parse_int(d, "quantity")
     if(not Tinker.is_in_range(q,
                               cls._C_INTERFACE_QUANTITY_RANGE[0],
                               cls._C_INTERFACE_QUANTITY_RANGE[1])):
         Tinker.value_error_map("quantity", str(q),
                                "range(%d, %d)"
                                % (cls._C_INTERFACE_QUANTITY_RANGE[0],
                                   cls._C_INTERFACE_QUANTITY_RANGE[1]),
                                   Tinker.tostr_dict(d))
開發者ID:drichmond,項目名稱:tinker,代碼行數:10,代碼來源:Interface.py

示例13: check_width

 def check_width(cls,d):
     w = parse_int(d, "width")
     if(not Tinker.is_in_range(w,
                               cls._C_INTERFACE_WIDTH_RANGE[0],
                               cls._C_INTERFACE_WIDTH_RANGE[1])):
         Tinker.value_error_map("width", str(w),
                                "range(%d, %d)"
                                % (cls._C_INTERFACE_WIDTH_RANGE[0],
                                   cls._C_INTERFACE_WIDTH_RANGE[1]),
                                   Tinker.tostr_dict(d))
開發者ID:drichmond,項目名稱:tinker,代碼行數:10,代碼來源:GroupMemoryInterface.py

示例14: check_burst

 def check_burst(cls, d):
     burst = d.get("burst")
     if(burst is None):
         Tinker.key_error("burst", Tinker.tostr_dict(d))
     if(not Tinker.is_pow_2(burst)):
         Tinker.value_error_map("burst", str(burst),
                                "Integer powers of 2",
                                Tinker.tostr_dict(d))
     if(burst not in cls._C_BURST_WIDTHS):
         Tinker.value_error_map("burst", str(burst),
                                str(list(cls._C_BURST_WIDTHS)),
                                Tinker.tostr_dict(d))
開發者ID:drichmond,項目名稱:tinker,代碼行數:12,代碼來源:Phy.py

示例15: parse_keys

 def parse_keys(cls,desc):
     k = set(desc.keys())
     if("interfaces" not in desc):
         ifs = set([])
     else:
         ifs = set(cls.parse_interfaces(desc))
     err = (k - ifs - cls._C_INTERFACE_KEYS)
     if(err != set()):
         print "In description:"
         Tinker.print_description(desc)
         sys.exit("Error! Unknown keys: %s" % str(list(err)))
     return k | ifs
開發者ID:drichmond,項目名稱:tinker,代碼行數:12,代碼來源:Interface.py


注:本文中的Tinker類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。