示例#1
0
    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)
示例#2
0
文件: test.py 项目: zfling/uvm-python
 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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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")
示例#7
0
文件: test.py 项目: zfling/uvm-python
    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())
示例#8
0
文件: test.py 项目: zfling/uvm-python
    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 = []
示例#9
0
文件: test.py 项目: zfling/uvm-python
 def report_phase(self, phase):
     sv.display("%0t: %0s:  report", sv.time("NS"), self.get_full_name())
示例#10
0
文件: test.py 项目: zfling/uvm-python
 def check_phase(self, phase):
     sv.display("%0t: %0s:  check", sv.time("NS"), self.get_full_name())
示例#11
0
文件: test.py 项目: zfling/uvm-python
 def extract_phase(self, phase):
     sv.display("%0t: %0s:  extract", sv.time("NS"), self.get_full_name())
示例#12
0
文件: test.py 项目: zfling/uvm-python
 def start_of_simulation_phase(self, phase):
     sv.display("%0t: %0s:  start_of_simulation", sv.time("NS"),
                self.get_full_name())
示例#13
0
文件: test.py 项目: zfling/uvm-python
 def end_of_elaboration_phase(self, phase):
     sv.display("%0t: %0s:  end_of_elaboration", sv.time("NS"),
                self.get_full_name())
示例#14
0
文件: test.py 项目: zfling/uvm-python
 def build_phase(self, phase):
     sv.display("%0t: %0s:  build", sv.time("NS"), self.get_full_name())
示例#15
0
文件: test.py 项目: zfling/uvm-python
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")
示例#16
0
文件: test.py 项目: zfling/uvm-python
 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())
示例#17
0
 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)