svt_fsm_state_base Class Reference

Inheritance diagram for class svt_fsm_state_base:

List of all members.


Detailed Description

FSM state base class.



Public Member Functions

virtual task   body ( )
function bit  callback_client_exists ( )
function ovm_object  create ( string name = "" )
virtual function string  get_class_name ( )
virtual function real  get_enter_time ( )
virtual function svt_fsm  get_fsm ( )
virtual function real  get_leave_time ( )
virtual function string  get_name ( )
task   get_next_state_choice ( ref svt_fsm_state_base next_state )
virtual function ovm_object_wrapper  get_object_type ( )
static function type_id  get_type ( )
virtual function string  get_type_name ( )
virtual function string  get_uid ( )
virtual function string  get_xml_name ( )
virtual function bit  is_dest_fsm_state ( svt_fsm_state_base test_incoming )
function void  m_add_next_state ( svt_fsm_state_base state )
function void  m_entering ( )
task   m_goto_next_state ( output svt_fsm_state_base next_state, input bit dead_end_is_ok )
function int  m_init ( )
function void  m_leaving ( )
function void  new ( string name = "" )
virtual function bit  save_to_xml ( svt_xml_writer writer, string prefix = "", string suffix )
virtual function void  set_enter_time ( real enter_time )
virtual function void  set_fsm ( svt_fsm fsm )
virtual function void  set_leave_time ( real leave_time )
function void  set_next_states_transition_option ( svt_fsm_state_base :: state_transition_options_enum transition_option )
function void  set_next_state_choice ( svt_fsm_state_base next_state )
virtual task   state_transition ( svt_fsm_state_base from_state, output bit ok )
virtual function bit  static_fsm_thread_enabled ( )

Public Attributes

int  callback_client_exists_cache = -1; 
ovm_report_object  reporter 
svt_fsm_state_base :: state_transition_options_enum  transition_option 
static const string  type_name = "svt_fsm_state_base"; 

Protected Member Functions

virtual function void  m_incoming_states ( ref svt_fsm_state_base state_q[$] )

Member Typedefs

 typedef enum  state_transition_options_enum 
 typedef class  type_id 


Member Function Documentation

 virtual task
 svt_fsm_state_base::body

 (   ) 


Function performed while the FSM is in this state. Will no look for state transition until it returns. If the state behavior is to execute as long as no transitions are observed, simply fork/join_none the behavior.

  function bit
 svt_fsm_state_base::callback_client_exists

 (   ) 

  function ovm_object
 svt_fsm_state_base::create

 (  string name = ""  ) 


 Superseded functions 
 ovm_object :: create 

 virtual function string
 svt_fsm_state_base::get_class_name

 (   ) 


Return the class name.

Return values - Name which represents the class.

 virtual function real
 svt_fsm_state_base::get_enter_time

 (   ) 


Method to get the last 'enter' time for the state

 virtual function svt_fsm
 svt_fsm_state_base::get_fsm

 (   ) 


Return the parent FSM for this state

 Superseding functions 
 svt_fsm_state :: get_fsm 

 virtual function real
 svt_fsm_state_base::get_leave_time

 (   ) 


Method to get the last 'leave' time for the state

 virtual function string
 svt_fsm_state_base::get_name

 (   ) 


Return the name of this state

Return values - Name which represents the state.


 Superseded functions 
 ovm_object :: get_name 
 Superseding functions 
 svt_fsm_state :: get_name 

  task
 svt_fsm_state_base::get_next_state_choice

 (  ref svt_fsm_state_base next_state  ) 


Method to get the m_next_state_choice field.

 virtual function ovm_object_wrapper
 svt_fsm_state_base::get_object_type

 (   ) 


 Superseded functions 
 ovm_object :: get_object_type 

 static function type_id
 svt_fsm_state_base::get_type

 (   ) 


 Superseded functions 
 ovm_object :: get_type 

 virtual function string
 svt_fsm_state_base::get_type_name

 (   ) 


 Superseded functions 
 ovm_object :: get_type_name 

 virtual function string
 svt_fsm_state_base::get_uid

 (   ) 


This method can be used to obtain a unique identifier for the state.

Return values - Unique identifier for the object.

 virtual function string
 svt_fsm_state_base::get_xml_name

 (   ) 


Returns a name that can be used to represent the state's object type in the XML output.

Return values - Name to be used for the state in XML output.


 Superseding functions 
 svt_fsm_state :: get_xml_name 

 virtual function bit
 svt_fsm_state_base::is_dest_fsm_state

 (  svt_fsm_state_base test_incoming  ) 


Method which checks whether this state can be reached directly from the provided state.

test_incoming - The state to be checked as a possible incoming state.

Return values - Indicates that this state can (1) or cannot (0) be reached directly from the provided state.

  function void
 svt_fsm_state_base::m_add_next_state

 (  svt_fsm_state_base state  ) 


Add the specified FSM state to the states this state can transition to. Do not call directly. Automatically called by svt_fsm :: m_init.

  function void
 svt_fsm_state_base::m_entering

 (   ) 


Call the registered svt_fsm_state_callback :: entering method. Called by svt_fsm, before body is called. Do not call directly.

  task
 svt_fsm_state_base::m_goto_next_state

 (  output svt_fsm_state_base next_state , input bit dead_end_is_ok  ) 


Look for a state transition condition out of this state. Do not call directly.

 protected virtual function void
 svt_fsm_state_base::m_incoming_states

 (  ref svt_fsm_state_base state_q [$]  ) 


Return the set of states that can transition into this state. It is usually simpler to use the `svt_fsm_from_state macro.

  function int
 svt_fsm_state_base::m_init

 (   ) 


Initialize the state instance. Must not be called directly. Automatically called by svt_fsm :: m_init;

  function void
 svt_fsm_state_base::m_leaving

 (   ) 


Call the registered svt_fsm_state_callback :: leaving method. Called by m_goto_next_state after next_state has been recognized. Do not call directly.

  function void
 svt_fsm_state_base::new

 (  string name = ""  ) 


Constructor for the FSM state base class.

 Superseded functions 
 ovm_object :: new 

 virtual function bit
 svt_fsm_state_base::save_to_xml

 (  svt_xml_writer writer , string prefix = "", string suffix  ) 


This method writes a description of the state to the XML file managed by the XML writer argument.

writer - Object which takes care of the basic write operations.

prefix - String to be placed at the beginning of each generated line.

suffix - Additional string that is placed at the end of the generated XML block

Return values - Indicates success (1) or failure (0) of the save.

 virtual function void
 svt_fsm_state_base::set_enter_time

 (  real enter_time  ) 


Method to set the last 'enter' time for the state

 virtual function void
 svt_fsm_state_base::set_fsm

 (  svt_fsm fsm  ) 


Set the parent FSM that holds this FSM state instance. Implemented in svt_fsm_state.

 Superseding functions 
 svt_fsm_state :: set_fsm 

 virtual function void
 svt_fsm_state_base::set_leave_time

 (  real leave_time  ) 


Method to set the last 'leave' time for the state

  function void
 svt_fsm_state_base::set_next_states_transition_option

 (  svt_fsm_state_base :: state_transition_options_enum transition_option  ) 


Set all of the m_next_states transition_option field values.

  function void
 svt_fsm_state_base::set_next_state_choice

 (  svt_fsm_state_base next_state  ) 


Method to set the m_next_state_choice field.

 virtual task
 svt_fsm_state_base::state_transition

 (  svt_fsm_state_base from_state , output bit ok  ) 


Detect a transition from the specified state to this state. Set 'ok' to TRUE and return if no errors were detected. Set 'ok' to FALSE and return if a protocol violation was detected. Must be implemented in every FSM state definition. Implementations must not call super.state_transition.

 virtual function bit
 svt_fsm_state_base::static_fsm_thread_enabled

 (   ) 


Indicates whether the state_transition method for this class will exit cleanly if transition_option goes to DISABLED_NEXT. Default implmentation always returns 0.

Member Attribute Documentation

 int  attribute
 svt_fsm_state_base::callback_client_exists_cache = -1


Cached callback_client_exists return value used to accelerate callback processing.

 ovm_report_object  attribute
 svt_fsm_state_base::reporter

 svt_fsm_state_base :: state_transition_options_enum  attribute
 svt_fsm_state_base::transition_option = DISABLED_NEXT


Indicates the transition options currently available to this state.

 static const string  attribute
 svt_fsm_state_base::type_name = "svt_fsm_state_base"


Member Typedef Documentation

 typedef enum  svt_fsm_state_base::state_transition_options_enum

The current state transition options.

EXTERNAL_INTERRUPT_NEXT
State transitions enabled, possibly to be interrupted externally.
INTERNAL_INTERRUPT_NEXT
State transitions enabled, possibly to be interrupted internally.
DISABLED_NEXT
State transitions disabled

 typedef class  svt_fsm_state_base::type_id
 Typedefe'd string ==>   ovm_object_registry#(svt_fsm_state_base,)