hwt/interfaces/agents/rdSynced.py
def driver(self, sim):
        """Push data to interface"""
        r = sim.read
        if self.actualData is NOP and self.data:
            self.actualData = self.data.popleft()

        do = self.actualData is not NOP

        if do:
            self.doWrite(sim, self.actualData)
        else:
            self.doWrite(sim, None)

        en = self.notReset(sim) and self._enabled
        if not (en and do):
            return

        yield sim.waitOnCombUpdate()

        rd = self.isRd(r)
        if en:
            assert rd.vldMask, (
                ("%r: ready signal for interface %r is in invalid state,"
                 " this would cause desynchronization") %
                (sim.now, self.intf))
        if rd.val:
            if self._debugOutput is not None:
                self._debugOutput.write("%s, wrote, %d: %r\n" % (
                                           self.intf._getFullName(),
                                           sim.now, self.actualData))
            if self.data:
                self.actualData = self.data.popleft()
            else:
                self.actualData = NOP
def driver(self, sim):
        """Push data to interface"""
        r = sim.read
        if self.actualData is NOP and self.data:
            self.actualData = self.data.popleft()

        do = self.actualData is not NOP

        if do:
            self.doWrite(sim, self.actualData)
        else:
            self.doWrite(sim, None)

        en = self.notReset(sim) and self._enabled
        if not (en and do):
            return

        yield sim.waitOnCombUpdate()

        rd = self.isRd(r)
        if en:
            assert rd.vldMask, (
                ("%r: ready signal for interface %r is in invalid state,"
                 " this would cause desynchronization") %
                (sim.now, self.intf))
        if rd.val:
            if self._debugOutput is not None:
                self._debugOutput.write("%s, wrote, %d: %r\n" % (
                                           self.intf._getFullName(),
                                           sim.now, self.actualData))
            if self.data:
                self.actualData = self.data.popleft()
            else:
                self.actualData = NOP
Push data to interface