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 theringandtagattributes, 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, theRingMACitself 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,
ringmust be hooked up to a message ring on which aRingMACServercan be found.tagMUST uniquely identify the underlyingRingClientinstantiated inside thisRingMAC.
- class tiliqua.dsp.mac.RingClient(*args, src_loc_at=0, **kwargs)
Message ring client participant.
ringshould connect to the ring bus.To issue a request,
iandtagshould be set, andstrobeasserted, untilvalidis asserted. On the same clock thatvalidis asserted,ocontains the answer from the server to our request.Under the hood,
RingClientwill take care of not sending our request until the bus is free, and not assertingvaliduntil 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.