Page 19 of 20

Design an asynchronous FIFO with non-power-of-2 even number of entries

Designing a power-of-2-entry async FIFO is straightforward, but how about designing an async FIFO with non-power-of-2 but even number of entries, for example, 6?

The only difficult part is non power of 2 number gray encoding. For power of 2 number is pretty straightforward. Let’s take 8 for example, the gray code can be:

000 -> 001 -> 011 -> 010 -> 110 -> 111 -> 101 -> 100

Notice that it’s mirror symmetric. To get gray encoding for 6, we can take the middle 2 encoding out of the sequence:

000 -> 001 -> 011 -> 111 -> 101 -> 100

It still satisfies gray encoding. Done!

Design a non-power-of-2 Synchronous FIFO

If the sync FIFO has non-power-of-2 entries, for example, 3 entries, what can we do? Well, we have at least 2 approaches.

The easiest way is to maintain a counter for FIFO occupied entries, and use it to generate the FIFO empty or full condition.

The second approach is to use the same trick for pointer encoding as what we see in power-of-2-entry FIFO. For example, both read and write pointers have (2 + 1) bits, where 2 is for bits to index 3-entry FIFO, and 1 is to decode FIFO full and empty conditions. Pointer value change shall have the following patterns:

000 -> 001 -> 010 -> 100 -> 101 -> 110 -> 000 -> …

When read pointer is equal to write pointer, the FIFO is empty; When read pointer is the same as write pointer other than MSB, the FIFO is full.

How to reduce static power, dynamic power, and short-circuit dissipation power?

Static Power

Static power is proportional to circuit leakage current and supply voltage Vdd. Thus we have following ways to reduce static power:

  1. Dynamic Vth scaling by adjusting substrate bias
  2. Use multi-Vth devices in design
  3. Use high-Vth device whenever possible
  4. Dynamic supply voltage scaling
  5. Use multi-Vdd in design
  6. Shut off the power in standby mode

Continue reading → How to reduce static power, dynamic power, and short-circuit dissipation power?

What are static power, dynamic power and short-circuit dissipation power?

Static power is the circuit leakage power. Static power exists even if there is no activities. When power is applied to the transistors, transistors would leak current naturally due to physical characteristics of the silicon and manufacturing defects. Examples of static power include transistor drain to source leakage and silicon substrate leakage.

Dynamic power is the power used to charge or discharge transistor intrinsic capacitor. Dynamic power only exists when signals toggle either from low-to-high or high-to-low. For example, clock toggles every cycle, thus clock paths consumes huge amount of dynamic power if there is no clock gating.

Short-circuit dissipation power occurs when both NMOS and PMOS transistors are active for a small period of time, during which current will find a path directly from power rail to ground. Hence, this creates a short-circuit current. In first-order analysis, we assume 0 transistor rise / fall time during transition, and short-circuit dissipation power can be ignored. However, we shall assume finite transistor transition time in more accurate analysis, thus short-circuit dissipation power exists every time signal toggles.

What is metastability?

Metastability happens when a register / FF has a setup or hold time violation. When setup time or hold time violation occurs, the output of that register becomes metastable, i.e., entering a quasi-static state which settles to either low or high.

Design engineer needs to handle properly:

  1. For synchronous paths, all timing paths should be checked for setup time and hold time constraints. Designers rely on STA to perform a thorough check against all timing paths.
  2. For asynchronous paths, designers should implement proper synchronization for clock domain crossing / CDC. Proper synchronizations between clock domains make sure metastability does not occur, otherwise chip failure can happen. Designers rely on CDC check to make sure synchronization are properly implemented

What are setup/hold time constraints and timing violation?

In previous post, we discussed setup time and hold time definitions. We will cover the basics of STA: setup time and hold time constraints.

These constraints dictate the max and min delays of a computational logic between flip-flops. If any of the constraint is not met, we call it as timing violation. Timing violations lead to metastability.

Continue reading → What are setup/hold time constraints and timing violation?