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)
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)
def __init__(self, **kwargs): """Constructor.""" MAC.__init__(self, **kwargs)