def build_phase(self, phase): super().build_phase(phase) UVMConfigDb.set(self, "u1", "v", 0) sv.display("%s: In Build: debug = %0d", self.get_full_name(), self.debug) self.u1 = C("u1", self)
async def run_phase(self, phase): phase.raise_objection(self) sv.display("%0t: %0s: start run phase", sv.time("NS"), self.get_full_name()) await Timer(test_duration, "NS") sv.display("%0t: %0s: end run phase", sv.time("NS"), self.get_full_name()) phase.drop_objection(self)
def build_phase(self, phase): super().build_phase(phase) UVMConfigDb.set(self, "inst1.u2", "v", 5) UVMConfigDb.set(self, "inst2.u1", "v", 3) UVMConfigDb.set(self, "inst1.*", "s", 0x10) sv.display("%s: In Build: debug = %0d", self.get_full_name(), self.debug) self.inst1 = A("inst1", self) self.inst2 = B("inst2", self)
def build_phase(self, phase): super().build_phase(phase) _str = [] if UVMConfigDb.get(self, "", "debug", _str): self.debug = _str[0] else: uvm_error("NO_CONF_MATCH", "Did not get debug") UVMConfigDb.set(self, "u1", "v", 0) sv.display("%s: In Build: debug = %0d", self.get_full_name(), self.debug) self.u1 = ClassC("u1", self)
def build_phase(self, phase): super().build_phase(phase) arr = [] if UVMConfigDb.get(self, "", "debug", arr): self.debug = arr[0] else: uvm_error("NO_CONF_MATCH", "Failed to get 'debug' from config DB") UVMConfigDb.set(self, "*", "v", 0) sv.display("%s: In Build: debug = %0d", self.get_full_name(), self.debug) self.u1 = ClassC("u1", self) self.u2 = ClassC("u2", self)
def build_phase(self, phase): super().build_phase(phase) arr = [] if UVMConfigDb.get(self, "", "debug", arr) is True: self.debug = arr[0] UVMConfigDb.set(self, "inst1.u2", "v", 5) UVMConfigDb.set(self, "inst2.u1", "v", 3) UVMConfigDb.set(self, "inst1.*", "s", 0x10) sv.display("%s: In Build: debug = %0d", self.get_full_name(), self.debug) self.inst1 = ClassA("inst1", self) self.inst2 = ClassB("inst2", self) if UVMConfigDb.get(uvm_top, "topenv", "should_match", arr): uvm_info("MATCH_OK", "should_match found from DB", UVM_MEDIUM) else: uvm_error("MATCH_ERROR", "should_match NOT found from DB")
async def run_phase(self, phase): await Timer(1, "NS") p = packet(0) while self.data_out.try_put(p): sv.display("%0t: put data %0d", sv.time(), p.i) await Timer(10, "NS") p = packet(p.i + 1) sv.display("try_put status return: %0d", p.i) sv.display("%0t: do a blocking put", sv.time()) await self.data_out.put(p) sv.display("%0t: blocking put succeeded", sv.time())
async def run_phase(self, phase): #100; // fifo will fill up await Timer(100, "NS") # FIFO will fill up sv.display("%0t: getting one", sv.time()) p = [] await self.data_in.get(p) p = p[0] # Required for python-tlm now sv.display("%0t: received data %0d", sv.time(), p.i) #100; // let the blocking put succeed p = [] while self.data_in.try_get(p): p = p[0] sv.display("%0t: received data %0d", sv.time(), p.i) #10 await Timer(10, "NS") p = []
def report_phase(self, phase): sv.display("%0t: %0s: report", sv.time("NS"), self.get_full_name())
def check_phase(self, phase): sv.display("%0t: %0s: check", sv.time("NS"), self.get_full_name())
def extract_phase(self, phase): sv.display("%0t: %0s: extract", sv.time("NS"), self.get_full_name())
def start_of_simulation_phase(self, phase): sv.display("%0t: %0s: start_of_simulation", sv.time("NS"), self.get_full_name())
def end_of_elaboration_phase(self, phase): sv.display("%0t: %0s: end_of_elaboration", sv.time("NS"), self.get_full_name())
def build_phase(self, phase): sv.display("%0t: %0s: build", sv.time("NS"), self.get_full_name())
async def print_proc(fifo): for i in range(30): sv.display("%0t: FIFO level %0d of %0d", sv.time(), fifo.used(), fifo.size()) await Timer(10, "NS")
async def run_phase(self, phase): sv.display("%0t: %0s: start run phase", sv.time("NS"), self.get_full_name()) await Timer(self.delay, "NS") sv.display("%0t: %0s: end run phase", sv.time("NS"), self.get_full_name())
def build_phase(self, phase): super().build_phase(phase) sv.display("%s: In Build: v = %0d s = %0d", self.get_full_name(), self.v, self.s)