def __fixup_payloadsize(self, tc): datasize = len(self.headers.payload.fields.data) if datasize != self.payloadsize: logger.warn("- Testspec payload data size:%d payloadsize:%d" %\ (datasize, self.payloadsize)) logger.warn("- Fixing payloadsize to data size: %d" % datasize) self.payloadsize = datasize return
def __process_ignore(self, ehdr, ahdr): for hdr,fields in self.ignore_fields.items(): if hdr != ehdr.__class__.__name__: continue for f in fields: setattr(ehdr, f, 0) setattr(ahdr, f, 0) logger.warn("- Header:%s Field:%s is ignored. !!" % (hdr, f)) return
def __fixup_payload(self, tc): currdata = self.headers.payload.fields.data datasize = len(self.headers.payload.fields.data) if datasize != self.payloadsize: logger.warn("- Testspec payload data size:%d payloadsize:%d" %\ (len(self.headers.payload.fields.data), self.payloadsize)) logger.warn("- Fixing payload data.") fac = int(self.payloadsize / datasize) + 1 newdata = currdata * fac self.headers.payload.fields.data = newdata[:self.payloadsize] return
def Consume(self, descriptor): logger.warn( "RingObject::Consume() - Base Class Implementation - DO NOT USE") return
def Read(self, index=None): # Read the HW state of the ring. logger.warn( "RingObject::Read() - Base Class Implementation - DO NOT USE") return
def Post(self, descriptor): # 1) Convert descriptor to backend format or bytes # 2) Call mem_write of descriptor bytes logger.warn( "RingObject::Post() - Base Class Implementation - DO NOT USE") return
def Configure(self): # 1) Call the backend API to allocate an address for this ring. # 2) Initialize all the elements of the ring to default value. logger.warn( "RingObject::Configure() - Base Class Implementation - DO NOT USE") return
def Ring(self, test_spec, lgh=logger): logger.warn( "Doorbell::Ring() - Base Class Implementation - DO NOT USE") return
def __set_one_rpc(self, op, rpc): self.__rpcs[op] = getattr(self.__stub, rpc, None) if not self.__rpcs[op]: logger.warn("%s is None for OP: %d" % (rpc, op)) return
def GetTxPacket(self): # Base class implementation. logger.warn("GetTxPacket(): Base class implmentation called !!!") return None
def GetTxPktByteStats(self): # Base class implementation. logger.warn("GetTxPktByteStats(): Base class implmentation called !!!") return (None, None)