MAC Operations

Utilities for sharing FPGA DSP tiles.

class tiliqua.dsp.mac.MAC(*args, src_loc_at=0, **kwargs)

Base class for MAC strategies. Subclasses provide the concrete strategy.

Subclasses use this through mac.Multiply(m, ...)

Multiply(m, a, b)

Contents of an FSM state, computing z = a*b. Ensure a, b will NOT change until the operation completes.

Returns a context object which may be used to perform more actions in the same clock the MAC is complete.

default()

Default MAC provider for DSP components if None is specified.

class tiliqua.dsp.mac.MuxMAC(*args, src_loc_at=0, **kwargs)

A Multiplexing MAC provider.

Instantiates a single multiplier, shared between users of this MuxMAC effectively using a Mux.

class tiliqua.dsp.mac.RingMAC(*args, src_loc_at=0, **kwargs)

A message-ring-backed MAC provider.

Normally these should only be created from an existing server using RingMACServer.new_client(). This automatically hooks up the ring and tag attributes, but does NOT add it as a submodule for elaboration (you must do this).

The common pattern here is that each functional block tends to use a single RingMAC, even if it has multiple MAC steps. That is, the RingMAC itself is Mux’d, however all requests land on the same shared bus.

This provides near-optimal scheduling for message rings composed of components that have the same state machines.

Contains no multiplier, ring must be hooked up to a message ring on which a RingMACServer can be found. tag MUST uniquely identify the underlying RingClient instantiated inside this RingMAC.

class tiliqua.dsp.mac.RingClient(*args, src_loc_at=0, **kwargs)

Message ring client participant.

ring should connect to the ring bus.

To issue a request, i and tag should be set, and strobe asserted, until valid is asserted. On the same clock that valid is asserted, o contains the answer from the server to our request.

Under the hood, RingClient will take care of not sending our request until the bus is free, and not asserting valid until an appropriate response has arrived.

class tiliqua.dsp.mac.RingMACServer(*args, src_loc_at=0, **kwargs)

MAC message ring server and connections between clients.

Prior to elaboration, new_client() may be used to add additional client nodes to this ring.

During elaboration, all clients (and this server) are connected in a ring, and a single shared DSP tile is instantiated to serve requests.