Ejemplo n.º 1
0
 def configure(self, **kwargs):
     """Configure `MAC`, add ports, and create `FSM`."""
     MAC.configure(self, **kwargs)
     # add downstream ports
     self.addport("TXD")     # port to send traffic to downstream protocol
     self.addport("RXD")     # port to recv traffic from downstream protocol
     # create FSM to manage send/recv execution of mac
     txfsm = self.newchild("txfsm", FSM, tracename=self.tracename+".TX")
     rxfsm = self.newchild("rxfsm", FSM, tracename=self.tracename+".RX")
     txfsm.goto(self.SEND)
     rxfsm.goto(self.RECV)
Ejemplo n.º 2
0
 def set_phy(self, p):
     """Check for valid `CSPHY` for MAC layer."""
     assert isinstance(p, CSPHY) or (p is None), \
            "[CSMAC]: set_phy() cannot set pointer to non-CSPHY object!"
     MAC.set_phy(self, p)
Ejemplo n.º 3
0
 def __init__(self, **kwargs):
     """Constructor."""
     MAC.__init__(self, **kwargs)