NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

User:DVT/UserDocumentation/DVT Component Reference Guide/DVT Data MHFSM

From Texas Instruments Wiki
Jump to: navigation, search

Multi-Homogeneous FSM[edit]

Overview[edit]

Allows the user to detect patterns in data using FSM specified in an XML file. The user can detect multiple patterns of the same FSM if the patterns can be divided into categories or quantified by a Source field.


Input Channel[edit]

1 input channels

Output Channel[edit]

1 output channel

Properties[edit]

Property Description Type Default
Auxdata Field The field chosen to be listed in the output channel. The value from the input field chosen will be the value from the record at which the FSM matched Text
Config File The XML file in which the FSM will be specified File Dialog
Name Displays the unique name for the component. Name can be changed through GSB Text
Time Field Specifies the input field which depicts the time or an increasing number Text
Passthrough All Fields make all fields present in input available in the output boolean false


XML tags for MHFSM Operation[edit]

The XML file will have the following format:

 <TimedFSMSystem timefield="Time" auxdatafield="Command">
   <fsm name="CELink" states="4" events="4" selfterminate="0">
      <transition name="00" event="0" state="0" next="0" />
      …
      <statename state="3" name="GE" />
      …
   </fsm>
   <eventgen eventfield="Event" value="8" sourcefield="TaskName" event="3" />
   …
 </TimedFSMSystem>
XML Tag Description
<TimedFSMSystem /> Is the top level Tag. The <eventgen /> and < fsm /> described below are tags within this tag's body. Uses the following attributes
Attribute Description
timefield The field that the FSM needs to use as time. Could also just be an increasing number field
auxdatafield The field which is to be made available in the output. The value put in o/p record will be of that input when the FSM reaches end state


<eventgen /> Specifies which field and value pairs will be used as events that trigger a change of state. A source field needs to be specified, this field will be used to run Multiple FSMs i.e. the FSM specified can run independently for different values in the source field. uses the following attributes
Attribute Description
eventfield Is the input field whose values will be used to check if they are defined events in the FSM
value The value of the eventfield which if found is a defined event for the FSM
sourcefield The input field which will be used to maintain the various FSMs. A separate instance of the FSM is created and can run in // per unique key value of this field
event The event number which should be unique across all events defined


<fsm /> Specifies the number of States, number of events and the terminate FSM state using the following attributes
Attribute Description
name Name of the FSM
states The number of states in the FSM
events The number of Events/Transitions in the FSM
selfterminate Possible Values
Attribute Description
0 FSM is allowed to transition from last state to another state
1 Last state is reached to End the FSM


Lower level tags that can be used under the <fsm /> tag are

XML Tag Description
<statename /> In this section each line is used to give a meaningful name to the states instead of 0,1,2,3. These renamed values will be used as filed/column names for the output. Has the following attributes
Attribute Description
name Name of the state. This is the name which will be used to name the field name in the output.
state Should be number with initial state 0 and final state = '# of states'-1
<transition /> Each line specifies a transition rule stating what event will take the FSM from a specific state to another state. Has the following attributes
Attribute Description
name Name of the transition
event Event number which triggers this transition
state The state number form which the FSM is comming out of for this transition
next The state number to which the FSM is going for this transition


Example[edit]

  • Input


The following records

Time Priority Event Size
1000 0 ReadCmd 32
1100 0 ReadResp 8
1200 2 WriteCmd 8
1300 3 WriteCmd 8
1400 1 ReadCmd 22
1500 0 WriteCmd 8
1600 1 ReadResp 16
1700 1 WriteCmd 8
1800 3 ReadCmd 8
1900 3 ReadResp 8
2000 0 WriteCmd 8
2100 3 ReadCmd 32
2200 3 ReadResp 32
2300 1 ReadCmd 8
2400 1 ReadResp 8
2500 2 WriteCmd 8
2600 2 WriteCmd 8
2700 0 ReadCmd 32
2800 0 ReadResp 32
2900 2 WriteCmd 8
  • Goal

To detect for each of the Events (ReadCmd, WriteCmd and ReadResp), when we get the following two events. 1) Priority = 0 2) Size = 8. For each time the FSM matches we want to know at what time did the events that transitioned states occur.

MHFSMExample.JPG

  • XML File
<TimedFSMSystem timefield="Time" auxdatafield="Time">
  
  
  <fsm name="Sequence" states="3" events="2" selfterminate="1">
    
    
    <transition name="000" event="0" state="0" next="1" />
    <transition name="111" event="1" state="1" next="2" />
    
    
    <statename state="0" name="Initial" />
    <statename state="1" name="Intermediate" />
    <statename state="2" name="Detected" />
  </fsm>
  
  
  <eventgen eventfield="Priority" value="0" sourcefield="Event" event="0" />
  <eventgen eventfield="Size" value="8" sourcefield="Event" event="1" />
  
</TimedFSMSystem>


  • Properties

These are properties changed from the default values

Property Value
Auxdata Field Time
Config File <the xml file describing the FSM>
Time Field Time


  • Output


Time Source SourceID Initial Intermediate Detected
1100 ReadResp 0 0 1100 1100
1500 WriteCmd 1 1300 1500 1500
1800 ReadCmd 2 0 1000 1800
2000 WriteCmd 1 1700 2000 2000

Example Solution[edit]

<install>\dvt\Examples\MultiHFSM\MultiHFSM.sol

Also See[edit]

TODO: Add references to tutorials in which component is used

Enhancement Requests[edit]

Gforge Tracker ID: 752, 761, 762, 763, 764, 767, 768, 769, 770, 772, 773

Known Issues[edit]

Gforge Tracker ID: 745, 751