def build_phase(self, phase): val_arr = [] if UVMConfigDb.get(self, "", "data", val_arr): self.data = val_arr[0] val_arr = [] if UVMConfigDb.get(self, "", "str", val_arr): self.str = val_arr[0]
def test_hier_set_get(self): UVMConfigDbOptions.tracing = True UVMConfigDb.set(None, str1, "master_id", 666, T=None) arr = [] ok = UVMConfigDb.get(None, str1, "master_id", arr) self.assertEqual(ok, True) self.assertEqual(arr[0], 666)
def test_set_get(self): cntxt = None inst_name = "my_comp" field_name = "field1" value = 123 UVMConfigDb.set(cntxt, "other_name", field_name, 666, T=None) UVMConfigDb.set(cntxt, inst_name, field_name, value, T=None) UVMConfigDb.set(cntxt, inst_name + ".*", field_name, 555, T=None) got_val = [] ok = UVMConfigDb.get(cntxt, inst_name, field_name, got_val, T=None) self.assertEqual(ok, True) self.assertEqual(got_val[0], value) got_val = [] ok = UVMConfigDb.get(cntxt, inst_name, "wrong_name", got_val, T=None) self.assertEqual(ok, False) self.assertEqual(len(got_val), 0) hier_name = inst_name + "." + "child" got_val = [] ok = UVMConfigDb.get(cntxt, hier_name, field_name, got_val, T=None) self.assertEqual(ok, True) self.assertEqual(got_val[0], 555)
def build_phase(self, phase): super().build_phase(phase) arr = [] if UVMConfigDb.get(self, "apb", "vif", arr) is False: uvm_fatal("APB/SYS_ENV/NO_VIF", "Could not get vif from config_db") self.vif = arr[0] self.blk0 = blk_env.type_id.create("blk0", self) self.blk1 = blk_env.type_id.create("blk1", self) UVMConfigDb.set(self.blk0, "apb", "vif", arr[0]) UVMConfigDb.set(self.blk1, "apb", "vif", arr[0]) if self.model is None: self.model = reg_sys_S.type_id.create("reg_sys_S", None, self.get_full_name()) self.model.build() self.model.lock_model() self.blk0.model = self.model.B[0] self.blk1.model = self.model.B[1] # self.apb = apb_agent.type_id.create("apb", self)
def configure_phase(self, phase): t = [] if (UVMConfigDb.get(self, "configure", "timeout", t) and t[0] > 0): yield Timer(t[0], "NS") uvm_fatal("TIMEOUT", "Time-out expired in configure phase")
def post_reset_phase(self, phase): t = [] if (UVMConfigDb.get(self, "post_reset", "timeout", t) and t[0] > 0): yield Timer(t[0], "NS") uvm_fatal("TIMEOUT", "Time-out expired in post_reset phase")
def shutdown_phase(self, phase): t = [] if (UVMConfigDb.get(self, "shutdown", "timeout", t) and t[0] > 0): yield Timer(t[0], "NS") uvm_fatal("TIMEOUT", "Time-out expired in shutdown phase")
async def pre_configure_phase(self, phase): t = [] if (UVMConfigDb.get(self, "pre_configure", "timeout", t) and t[0] > 0): await Timer(t[0], "NS") uvm_fatal("TIMEOUT", "Time-out expired in pre_configure phase")
async def reset_phase(self, phase): t = [] if (UVMConfigDb.get(self, "reset", "timeout", t) and t[0] > 0): await Timer(t[0], "NS") uvm_fatal("TIMEOUT", "Time-out expired in reset phase")
async def post_shutdown_phase(self, phase): t = [] if (UVMConfigDb.get(self, "post_shutdown", "timeout", t) and t[0] > 0): await Timer(t[0], "NS") uvm_fatal("TIMEOUT", "Time-out expired in post_shutdown phase")