def register_seq_blocks( model ):

  all_models = []
  def create_model_list( current ):
    all_models.append( current )
    for m in current.get_submodules():
      create_model_list( m )

  create_model_list( model )

  sequential_blocks = []
  for i in all_models:
    for func in i.get_tick_blocks() + i.get_posedge_clk_blocks():

      # Grab the AST and src code of each function
      tree, src = get_method_ast( func )

      # Check there were no mistakes in use of .value/.next
      DetectIncorrectValueNext( func, 'value' ).visit( tree )
      DetectMissingValueNext  ( func, 'next'  ).visit( tree )

      # If function is decorated with tick_fl, wrap it with a greenlet
      if 'tick_fl' in DetectDecorators().enter( tree ):
        func = _pausable_tick( func )

      sequential_blocks.append( func )

    for func in i.get_combinational_blocks():

      tree, _ = get_method_ast( func )
      DetectIncorrectValueNext( func, 'next'  ).visit( tree )
      DetectMissingValueNext  ( func, 'value' ).visit( tree )

  return sequential_blocks

#---------------------------------------------------------------------
# register_comb_blocks
#---------------------------------------------------------------------
# Register all decorated @combinational functions with the simulator.
# Combinational logic blocks are registered with SignalValue objects
# and get added to the event queue when values are updated.
dataset/ETHPy150Open cornell-brg/pymtl/pymtl/tools/simulation/sim_utils.py/register_seq_blocks/original