5 Minutes To Flop Detection

Invio™ Tutorial: 5 Minutes to Flop Detect

 

FlopDetectConcise

Step One

Find the edge sensitive processes

The first step in identifying flip-flops is to find all the edge sensitive processes in the design.  This is quick and easy using the built-in get_processes API command with a filter on the is_edge_sensitive attribute and the HIER flag to search the entire design hierarchy. The results, a list of InvioObjects stored in the variable procs.

 Process

Step Two

Identify the flip-flop signals

Once the edge-sensitive processes have been identified, the next step is to identify the signals that will become flip-flops. Again, this is easy with the built-in “all_outputs” API command.  By definition in Invio, the outputs are signals on the left-hand side of the assignment statements within the processes.

 ProcOutputs

Step Three

Print the flip-flop names

Leveraging the native Python for iterator, we simply loop through proc_outputs printing out the signal name.

 Regs

Step Four

Get the process sensitivity list

Now lets dive a little deeper and find the clock and reset signals.

For this simple example, a signal is deemed to be a reset if it appears in the sensitivity list of an edge-sensitive process and is an input to a statement within that process.  A signal is deemed to be a clock if it appears in the sensitivity list of an edge-sensitive process and does not appear as an input to a statement within that process.

Again, it is easy to grab the sensitivity list simply by accessing the process objects sensitivity_list attribute.

 SenseList

Step Five

Get the sensitivity list signals

We can quickly grab the signals of the sensitivity list using the get_signals API command.

 SenseListSigs

Step Six

Find the process’ statements

For next step of our simple algorithm we need to look at the statements. The get_statements API does this is one step.

 Statements

Step Seven

Find the inputs to the statements

The all_inputs command grabs all the inputs to the statements in a single API call.

 StatementInputs

Step Eight

Differentiate clocks from resets

Now we all we have to do, according to our algorithm from above, is check if the sensitivity list signal is an input to one of the statements in the process.  Using the Python in operator we can simply check the signals against our list in one quick step.

 ClockReset

Start developing your custom EDA tool with Invio

Try it for free
30-Day Invio Trial