Common Components

class ember.common.queue.Queue(*args, src_loc_at=0, **kwargs)

A FIFO queue that supports pushing/popping multiple entries.

The effects of push and pop requests are visible on the next cycle.

Warning

This is probably very inefficient and not synthesizable (in principle?), but we can worry about that after we have something behaviorally correct.

Ports:
  • i_pop_size – Number of entries being popped/consumed this cycle.

  • i_push_size – Number of entries being pushed this cycle.

  • i_push_data – Entry data being pushed this cycle.

  • o_data – The oldest entries in the queue.

  • o_pop_limit – Number of valid entries in o_data that are allowed to be popped this cycle.

  • o_push_limit – Number of entries in i_push_data that are allowed to be pushed this cycle.

  • o_overflow – The push request on the previous cycle would have caused an overflow condition.

  • o_underflow – The pop request on the previous cycle would have caused an underflow condition.

Parameters:
  • depth – The number of queue entries.

  • width – The maximum number of entries that can potentially be enqueued/dequeued in a single cycle.

class ember.common.PriorityMux(*args, src_loc_at=0, **kwargs)

A chain of muxes.

Selects the first signal for which the corresponding select bit is high.

Ports:
  • sel – Input select signals

  • val – Input data signals

  • output – Output data signal (zero when the ‘valid’ bit is low)

  • valid – Output valid (high when any of the select bits are valid)

class ember.common.coding.EmberPriorityEncoder(*args, src_loc_at=0, **kwargs)

A priority encoder.

Ports:
  • i – Input bits (one-hot)

  • mask – Output bits (one-hot)

  • o – Output index (encoded)

  • valid – High when at least one bit is valid in in the input