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 FSM

From Texas Instruments Wiki
Jump to: navigation, search

FSM System[edit]

Overview[edit]

Allows the user to detect patterns in data using FSM specified in an XML file. The user can detect only one pattern of the FSM but will be able to run different Heterogeneous FSMs in parallel


Input Channel[edit]

1 input channels

Output Channel[edit]

1 output channel

Properties[edit]

Property Description Type Default
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


XML tags for FSM Operation[edit]

The XML file will have the following format:

 < FSMSystem name="IRQs">
   
   <fsm name="IRQStack" states="9" events="2">
     <transition name="00" event="0" state="0" next="1" />
     …
     <statename state="0" name="Initial" />
     …  
   </fsm>
   
   <eventgen srcname="EventID" value="1" fsm="SYSStack" event="0" />
   … 
   
   
   <fsm name ….>
   … 
   </fsm>
   
   <eventgen srcname="EventID" value="1" fsm="SYSStack" event="0" />
   …
   
   
   
   <output name="Time" srctype="input" srcname="Time" datatype="data" />
   <output name="DepthIrq" srctype="fsm" srcname="IRQStack" datatype="state" />
   …
   
 </FSMSystem>
XML Tag Description
<FSMSystem /> Is the top level tag. The subsequent tags below are present inside this body
<eventgen /> Specifies which field and value pairs will be used as events that trigger a change of state. Events need to be defined separately for each FSM. Uses the following attributes
Attribute Description
srcname 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
fsm The name of the FSM for which this event is to be used
event The event number which should be unique across all events defined for a particular FSM


<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
type Possible values
Value Description
"default"
"linear" TODO
<output/> Describes the fields that are to be made available in the output record
Attribute Description
name Name of the output field
srctype Possible values
Value Description
"input" A value from an input field is selected for output
"fsm" A value of a FSM property is selected for output
srcname Possible values
Value Description
field name Will be a field name if srctype attribute has value "input"
fsm name Will be a fsm name if srctype attribute has value "fsm"
datatype Possible values
Value Description
"data" Will use value of the field name if srctype attribute has value "input"
"state" Will use value of the fsm state transitioned to, if srctype attribute has value "fsm"
"statename" Will use value of the statename. If none is provided then the string output will bet "stateN" where N will be the state number




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

XML Tag Description
<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
900 2 ReadCmd 16
1000 0 ReadCmd 24
1100 0 ReadResp 8
1200 2 WriteCmd 8
1300 3 WriteCmd 8
1400 1 ReadCmd 22
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 the following FSMs


  1. Single Sequence of records having Size = 8 and then Size 32
  2. Repeating Sequence of records having Size = 8 and then Size 32
  3. Single Sequence of records having Priority = 0, Priority = 1 and then Priority = 2

FSMExample.JPG

  • XML File


<FSMSystem name="Pattern">
  
  
  <fsm name="Size_8_32_single" states="3" events="2">
    <transition name="000" event="0" state="0" next="1" />
    <transition name="112" event="1" state="1" next="2" />
  </fsm>
   
  
  <eventgen srcname="Size" value="8" fsm="Size_8_32_single" event="0" />
  <eventgen srcname="Size" value="32" fsm="Size_8_32_single" event="1" />
  
  
  
  
  <fsm name="Size_8_32_repeat" states="3" events="2">
    <transition name="000" event="0" state="0" next="1" />
    <transition name="112" event="1" state="1" next="2" />
    <transition name="021" event="0" state="2" next="1" />
    
    <statename state="0" name="Initial" />
    <statename state="1" name="8_Detect" />
    <statename state="2" name="32_Detect" />
  </fsm>
  
  
  <eventgen srcname="Size" value="8" fsm="Size_8_32_repeat" event="0" />
  <eventgen srcname="Size" value="32" fsm="Size_8_32_repeat" event="1" />
  
  
  
  
  <fsm name="Priority_0_1_2" states="4" events="3">
    <transition name="001" event="0" state="0" next="1" />
    <transition name="112" event="1" state="1" next="2" />
    <transition name="223" event="2" state="2" next="3" />
  </fsm>
  
  
  <eventgen srcname="Priority" value="0" fsm="Priority_0_1_2" event="0" />
  <eventgen srcname="Priority" value="1" fsm="Priority_0_1_2" event="1" />
  <eventgen srcname="Priority" value="2" fsm="Priority_0_1_2" event="2" />
  
  
  
  
  <output name="Time" srctype="input" srcname="Time" datatype="data" />
  <output name="Size_8_32_single" srctype="fsm" srcname="Size_8_32_single" datatype="statename" />
  <output name="Size_8_32_repeat" srctype="fsm" srcname="Size_8_32_repeat" datatype="statename" />
  <output name="Priority_0_1_2" srctype="fsm" srcname="Priority_0_1_2" datatype="state" />
  
</FSMSystem>


  • Properties

These are properties changed from the default values

Property Value
Config File <the xml file describing the FSM>


  • Output


Time Size_8_32_single Size_8_32_repeat Priority_0_1_2
900 state0 Initial 0
1000 state0 Initial 1
1100 state1 8_Detect 1
1200 state0 8_Detect 1
1300 state1 8_Detect 1
1400 state1 8_Detect 2
1500 state1 8_Detect 2
1600 state1 8_Detect 2
1700 state1 8_Detect 2
1800 state1 8_Detect 2
1900 state1 8_Detect 2
2000 state1 8_Detect 2
2100 state2 32_Detect 2
2200 state2 32_Detect 2
2300 state2 8_Detect 2
2400 state2 8_Detect 2
2500 state2 8_Detect 3
2600 state2 8_Detect 3
2700 state2 32_Detect 3
2800 state2 32_Detect 3
2900 state2 8_Detect 3

Example Solution[edit]

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

Also See[edit]

TODO: Add references to tutorials in which component is used

Enhancement Requests[edit]

Gforge Tracker ID: 761, 763, 764, 765, 766, 772, 773

Known Issues[edit]

Gforge Tracker ID: