Esempio n. 1
0
    def run(self):
        dut = self.dut
        cocotb.fork(
            StreamRandomizer("streamFlowArbiterInputStream",
                             self.onInputStream, None, dut, dut.clk))
        cocotb.fork(
            FlowRandomizer("streamFlowArbiterInputFlow", self.onInputFlow,
                           None, dut, dut.clk))

        while not (self.inputFlowCounter > 1000
                   and self.inputStreamCounter > 1000):
            yield RisingEdge(dut.clk)
            if int(dut.streamFlowArbiterOutput_valid) == 1:
                if int(dut.streamFlowArbiterInputFlow_valid) == 1:
                    assertEquals(dut.streamFlowArbiterOutput_payload,
                                 dut.streamFlowArbiterInputFlow_payload,
                                 "StreamFlowArbiter payload error")
                    assertEquals(0, dut.streamFlowArbiterInputStream_ready,
                                 "StreamFlowArbiter arbitration error")
                    self.inputFlowCounter += 1
                else:
                    assertEquals(dut.streamFlowArbiterOutput_payload,
                                 dut.streamFlowArbiterInputStream_payload,
                                 "StreamFlowArbiter payload error")
                    assertEquals(0, dut.streamFlowArbiterInputFlow_valid,
                                 "StreamFlowArbiter arbitration error")
                    self.inputStreamCounter += 1
Esempio n. 2
0
    def run(self):
        cocotb.fork(StreamRandomizer("forkInput", self.onInput,None, self.dut, self.dut.clk))
        for idx in range(0,3):
            cocotb.fork(StreamReader("forkOutputs_" + str(idx), self.onOutput, idx, self.dut, self.dut.clk))

        while not reduce(lambda x,y: x and y, map(lambda x: x > 1000, self.counters)):
            yield RisingEdge(self.dut.clk)
Esempio n. 3
0
    def run(self):
        cocotb.fork(StreamRandomizer("dispatcherInOrderInput", self.onInput,None, self.dut, self.dut.clk))
        for idx in range(0,3):
            cocotb.fork(StreamReader("dispatcherInOrderOutputs_" + str(idx), self.onOutput, idx, self.dut, self.dut.clk))

        while self.counter < 1000:
            yield RisingEdge(self.dut.clk)
Esempio n. 4
0
    def run(self):
        dut = self.dut
        for idx in range(0,3):
            cocotb.fork(StreamRandomizer("arbiterLowIdPortFirstFragmentLockInputs_" + str(idx), self.onInput ,idx, self.dut, self.dut.clk))
        cocotb.fork(StreamReader("arbiterLowIdPortFirstFragmentLockOutput", self.onOutput, idx, self.dut, self.dut.clk))
        cocotb.fork(self.arbitration())

        while self.counter < 1000:
            yield RisingEdge(dut.clk)