[docs]defget_names(objects,attr="name"):""" Returns name name of the verilog object (if the it contains name property) args: object(list[Cable, Port, Definition, Instance]): pass list of objects returns: (list[str]) : list of """names=[]ifnotisinstance(objects,(list,tuple,GeneratorType)):objects=tuple([objects,])foreachinobjects:ifisinstance(each,(ir.Cable,ir.Port,ir.Definition,ir.Instance)):foreach_attrinattr.split("."):each=getattr(each,each_attr)names.append(each)else:logger.warning("Skipping unsupport object %s",type(each))returnnames
[docs]defget_attr(objects,attr):""" Returns specific attribute from the properties of the object args: object(list[Cable, Port, Definition, Instance]): pass list of objects returns: (list[str]) : list of """return[getattr(each,attr,None)foreachinobjects]