Home
The Qfsm User Manual
Contents
1. Using Qfsm Moore outputs and Mealy inputs outputs Fonts Arrow Type The Free Text type allows to specify inputs and outputs us ing any kind of character string of variable length This type of FSM cannot be simulated afterwards because the input conditions won t be interpreted If you are creating a binary FSM you can specify the num ber of bits of the moore output and mealy input output and their respective names The names are lists of character strings separated by commas If you don t want to choose the names you can leave these fields blank and they will be auto matically set You can also specify the font to use for the state names and for the input conditions and outputs displayed on the trans itions The type of arrow to use for drawing transitions When you want to modify the properties of an existing FSM you can select Machine Edit from the main menu and the same dialog box will be displayed As soon as you click OK the changes will take effect The Working Area The working area denotes the area of the Qfsm window that shows the state diagram Once you have created a new FSM you see a blank working area and you are in the select mode Eile Edit View Machine State Transition Help DeeSenen BMA gF AQ T select mode working area X 452 7 Y There are six different modes you can be in and which determine what happens when you click or drag the mouse inside the working area of
2. Radius The radius of the drawn circle of the state in pixels 8 Using Qfsm Line width The line width of the outline of the state Color The color of the outline of the state Description The description of the state This is only for documentation purposes To modify an existing state you have to be in the select mode see the section called The Select mode Then either double click on the respective state or select one state by a single click and chose State Edit from the main menu Adding and modifying transitions Before you can create a new transition you have to have created a new FSM before by selecting File gt New see the section called Creating and modifying a Finite State Machine or loaded an existing file by chosing File gt Open from the main menu Further you have to have at least one state in you diagram to draw a transition to itselft or two states to draw a transition from one to the other see the section called Adding and modifying states Finally you have to be in the add transition mode see the section called The Add Transition mode To create a transition from state A to state B Press and hold the left mouse button on state A and re lease it on state B You can also draw loops i e transitions that go from one state to itself by press ing and releasing the mouse button on the same state The following dialog will appear allowing you to specify or modify the properties of the
3. Set the SOFSM environment variable to the location where you installed Qfsm by default usr local qfsm The bash command for example is export QFSM usr local qfsm You might want to update your SPATH environment variable as well to include the SOFSMDIR bin directory export PATH QFSM bin PATH Chapter 2 Using Qfsm The main menu This section briefly describes the entries of the main menu File Edit View New Open Open Recent Save Save As Export Print New Window Close Quit Undo Cut Copy Paste Delete Select Select AII Deselect All Options State Codes Creates a new file See the section called Creating and modifying a Finite State Machine for details Opens an existing Qfsm file List of the most recently opened Qfsm files Saves the current FSM to a Qfsm file Saves the current FSM under a different name Exports the current FSM to a foreign file format See the section called Exporting for details Prints the current FSM Opens a new window with a separate working area where a different FSM can be edited Note that you can copy cut and paste states and transitions from to differ ent FSMs Closes the current FSM Exits Qfsm Undoes the last action Cuts the currently selected states and transitions to the clipboard Copies the currently selected states and transitions to the clipboard Pastes the clipboard into the current FSM Deletes the curre
4. by selecting Machine gt Simulate from the main menu A dialog opens allowing you to input data to the machine while displaying its cur 11 Using Qfsm rent state and output ge Qfsm ascii example fsm o x File Edit View Machine State Transition Help Da ES F RRS Qg VAG Reset OD JUEGA O Inputs Binary Hexadecimal e ASCII 7 5 4 3 e o O6c a A Z Outputs v D Binary Hexadecimal ASCII State Name State_2 Q State Code 2 Clock Frequency 1 0 Send Reset Cancel 100 0 X 329 0 Vi 54 0 In the top of the dialog you can enter input data in the text field in one of the formats binary hexa decimal or ASCII Alternatively you can set or unset input bits using the buttons 0 to 15 When you choose the ASCII format you are can also use escape sequences as detailed in the section called Escape sequences However you can only enter a single character Thus Nd or ranges for ex ample are not allowed In the output section you see the current output of the FSM in one of the formats you choose i e binary hexadecimal or ASCII The State Name and State Code fields display the current state of the FSM The red or green point next to it indicates if the FSM is in a final state or not i e green for final state and red otherwise There are two modes to send input data either by clicking on the Send button
5. curcuit design Current features of Qfsm are Drawing Editing and Printing of states diagrams Binary ASCII and free text condition codes Multiple windows Integrity check nteractive simulation AHDL VHDL Verilog HDL KISS export State table export in Latex HTML and plain text format e Ragel file export used for C C Java or Ruby code generation Copyright and license information Copyright C 2000 2007 Stefan Duffner This program is free software you can redistribute it and or modify it under the terms of the GNU General Public License LICENSE as published by the Free Software Foundation either version 2 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program if not write to the Free Software Foundation Inc 59 Temple Place Suite 330 Boston MA 02111 1307 USA Installation Requirements Qfsm requires the Qt library version 3 3 available from Trolltech http www trolltech com Installation Procedure 1 Unpack the gzipped tar archive with tar zxf qfsm x xx tar gz Introduction Change to the directory qfsm x xx and call Jconfigure make make install
6. of a FSM You can access this function by the menu entry Machine Integrity Check Warning Be careful This may take a long time for larger FSMs and the procedure can t be interrup ted The following tests will be performed Unambigous Conditions Start state End state No dead locks Completeness States reachable End states reachable Transitions connected Simulating a FSM Checks if the FSM has got transitions with conditions that are am biguous i e transitions that are activated simultaniously by the same input in the same state Note that ambiguous transitions are only allowed in non deterministic FSMs which are currently not supported by Qfsm Checks if the FSM has got a start state Checks if the FSM has got an end state Checks if the FSM has got states where it can get of out i e states with no transitions going out Checks if for every possible input in every state there exists a transition that is activated Checks if all the states of the FSM are reachable Checks if all the end states of the FSM are reachable Checks if all the transitions of the diagram are actually connected to a start end an end state Note that sometimes a transition looks as if it is connected to a state but in fact the connection point is slightly away from it Once you have created a FSM with some states and transitions you can simulate its behaviour with respect to varying input signals You can start the simulation
7. state Transition Properties Condition Type Binary ASCII Input jd Any input Invert condition Default transition Description This transition is activated when the character d is pressed Cancel The respective fields have the following meaning Condition Type The type of the condition determines the format in which you enter the input condition in the next field Input If the condition type is binary you will have to enter a string of zeros and ones here You can also use the character x meaning don t care If the condition type is ASCII you can just enter a character or specify an ex pression in a specific format which is explained in detail in the section called Input ASCII conditions For free text conditions any input character string is allowed However it has got no logical meaning and won t be interpreted for example when sim ulating the machine Output This represents the Mealy output sent from the FSM when the transition is 9 Using Qfsm activated i e the input condition is satisfied Depending on the type of the condition the format is either a string of zeros and ones binary a character ASCII or any character string free text Note that in case of an ASCII character it can also be an escape sequence See the section called Input ASCII conditions for details on escape sequences Description The description of the transition This is onl
8. ter ETE etre ews ts 8 Adding and modifying states esses eene 8 Adding and modifying transitions esessssssesseee emen 9 Input ASCH conditions esee eme emere 10 Single character sermi eae ier E err E OR p EN EE Pe Pub 10 Multiple characters terere EEEE TEES Te iau 10 Escape sequentes ero erret Ri er ueteri qp CRRU ERR EE RI e peer ren 10 hence Pm 11 Mixed forimats eor ROO TRevese De NR UI RO Ree ui Vea ERR E 11 Checking the integrity of a FSM aortes rosoisia ee e yE mme 11 Simulating ESM noe eee Ute ge tip eret o dedpte tetigere d eU gee nter 11 BX POrtin Ss P lC PA 12 Hardware description languages esses 12 State EDI e inort seep evens ony sea EPER E avons steaes epoca ahs ERNS E E 13 Code generation languages csse emere 13 ODtIODS i rette tere D t t ete Up E rebote ces eet oepe teda 14 General sissies E sh 14 Display sie oto Posen aan t Dre ro PR E ERR eas Goud causes EPESA UIT 14 usu Pp 14 3s COMLACE UE 15 Chapter 1 Introduction What is Qfsm Qfsm is a graphical editor for finite state machines written in C using Qt the graphical Toolkit from Trolltech http www trolltech com Finite state machines are a model to describe complex objects or systems in terms of the states they may be in In practice they can be used to create regular expressions scanners or other program code as well as for integrated
9. Qfsm 1 Select 2 Pan 3 Zoom 4 Add State 5 Add Transition Using Qfsm 6 Simulate Only one mode can be activated at a time To change the mode you can click on one of the icons in the middle of the toolbar kg ig Alternatively you can select the respective menu entry or press the respective short cut The active mode is indicated by a highlighted toolbar button In some modes the form of the mouse cursor also changes e g a magnifier for the zoom mode The Select mode k In this mode when clicking with the left mouse button on a state or a transition you select it Hold ing down the shift key allows you to select several states or transitions at the same time You can then apply further actions on selected items i e copy or edit by using the menu Clicking on the background unselects all selected items When you click with the right mouse button on a state or a transition the context menu for it will be shown Double clicking on a state or transition opens a dialog that lets you modify the state transition prop erties Dragging the mouse pointer holding the left mouse button can have different effects When you start dragging from the background you can select multiple items those that are contained in the rectangle you drag When you start dragging over a state you can move it around and when mul tiple objects are selected you can move them all at the same time You can also drag transition con
10. The Qfsm User Manual The Qfsm User Manual Version 0 45 Copyright O 2007 Stefan Duffner Table of Contents T Introductiotiz uer Re e RES 1 What INOS eeaeee T rise rro ness oi tuse ote ey oi free tod rates QE UST 1 Copyright and license information ssssssessss Henne 1 IDEE 1 Requirements 1 ie eee t eroe ever ee EIE EE REEL EE ORE edes 1 Installation Procedure i enri E E m Hm e meme here 1 2 Usmg OISm 33 24 sey fh E ederet oon ee deus ertet teo wet tot aed eei dest aedis eee eats 3 The r ain menu tre ep eee Oe eve e S RR NE e eot 3 Eie titre tete to deve er rette peo Ute RON ed ce e TR Ue eode eto EOE SS 3 Edit 1t RARE eie e eie rtr perte E eoe eee 3 VIEW saas stews ie tiet e a aede Et reet es dau c pue Ordo qee eoe d deet ceo Do P ecce ERES 3 Machine iiec IRAE eI M E EET 4 State cou im ree e ORE PR RE E ERE IS cd EPI ER EPI ME PARERE UNE TERRE 4 Transito e o ro Eee SeS eder pepe eee tue e edere Rete vun eis quse Pee Lote ydo tenes 5 Creating and modifying a Finite State Machine ssessee 5 M RO SUA 6 The Select mode nnne E aE IRE E EOR r he ERI R ERESI e red 7 Th P n mode 5 oie ei et sterii tet tese ort ttes fas EE ENSURE SIR 7 Th Zoom mode 5 oo ee e OT reete E reU ire ERR VT 7 TheAdd State mode 5 rotto tete orte tee exe eoo ee DER SETUP Pe ee pee 7 The Add Transition mode sss ee m eene eene 7 The Simulate mode 5 be ote
11. alternatively hitting the Enter key or by clicking on the Clock button where the FSM will periodically send the data in the input text field on the top of the dialog You can specify the frequency of the clock in the input field at the bottom right The Clock mode can be exited by once again clicking on the Clock button Finally you can reset the FSM by clicking on the Reset button i e it will be set to its initial state There are several export functions in Qfsm all reachable by the main menu entry File Export They can be divided into three categories hardware description languages state tables and code generation languages Hardware description languages 12 Using Qfsm Hardware description languages are high level descriptions that can be synthesized into integrated circuits like FPGAs using special software The following languages are supported 1 AHDL 2 VHDL 3 Verilog HDL 4 KISS Some of the export functions open a dialog allowing you to specify additional export options However they should be self contained for the users having experience with hardware description languages State Tables State tables can be exported in the formats ASCII plain text Latex or HTML State tables show for each possible state and input here called event the respective resulting states A dialog will allow you to change some options concerning the layout of the state table Include asynchronous output Determines if th
12. e asynchronous outputs Mealy outputs are printed in the table cells together with the resulting states Resolve inverted conditions Determines if the inverted conditions are printed using the in version descriptor e g NOT a or without it i e printing every character or binary string except the ones in the con dition In the case of NOT a this would be the two ranges N000 and b OFF Which one is clearest depends on the respective FSM Orientation Determines the orientation of the table i e if current states represent the different rows of the table and the events the columns or vice versa Code generation languages For this type of output there is only one type namely the ragel file format and only ASCII FSMs can be exported The resulting file serves as an input for the ragel state machine compiler The ragel state machine compiler is a compiler that generates code from a high level state machine description language In this way you can create parsers for example For details refer to the ragel homepage http www cs queensu ca thurston ragel A dialog allows you to create a so called action file That means the ragel state machine specifica tion is divided into two files One that contains the state machine logic which I will call FSM file here and an action file that contains the action definitions and a framework calling the state ma chine Thus the action file actually includes the FSM file The name
13. e menu item File New A dialog Switches to the add transition made See the section called The Add Transition mode and the section called Adding and modifying transitions for details Opens a dialog that lets you modify the properties of the currently selected trans ition See the section called Adding and modifying transitions for details Straightens the currently selected transition lets you specify the properties of the FSM Name Version Type Machine Properties Name My Machine Version 1 0 Type Binary J ASCII 2 Free Text Moore Outputs 2 o z Names s_out1 s outO Mealy Inputs 3 z Names i2 i1 id Outputs 2 zl Names 01 o0 State Font Helvetica Transition Font Helvetica OK Cancel The name is only used by some file export functions e g the formats VHDL Verilog HDL or Ragel The version of the FSM is a free character string that is only used when printing the diagram The type attribute determines which type of information is processed by the FSM i e the inputs the outputs etc Binary FSMs process zeros and ones at the inputs or outputs This is the main type used for hardware design ASCII FSMs process characters i e letters digits etc These characters are coded in ASCII format using 8 bits This type of FSM can be used either for hardware design or to create string parsers
14. ed The Pan mode for details Switches to the zoom mode See the section called The Zoom mode for de tails Zooms the view in The current zoom value is shown in the left most part of the status bar Zooms the view out The current zoom value is shown in the left most part of the status bar Set the zoom to the original value 10096 The current zoom value is shown in the left most part of the status bar Opens a dialog that lets you modify the properties of the current FSM See the section called Creating and modifying a Finite State Machine for de tails Switches to the simulation made See the section called The Simulate mode and the section called Simulating a FSM for details Performs an integry check on the current FSM See the section called Checking the integrity of a FSM for details Switches to the add state made See the section called The Add State mode and the section called Adding and modifying states for details Opens a dialog that lets you modify the properties of the currently se lected state See the section called Adding and modifying states for details Define the currently selected state as the start state of the FSM Defines the currently selected state as a final or non final state Using Qfsm Transition New Edit Straighten Creating and modifying a Finite State Ma chine You can create a new Finite State Machine FSM by choosing th
15. nd all interaction with the state diagram is disabled until you close the dialog See the section called Simulating a FSM for details When you hold down the middle mouse button if you have one in any mode you can pan the view by moving the mouse pointer as in the pan mode As soon as you release the middle mouse button the application reverts to the selected mode Adding and modifying states In order to be able to add a new state you have to have created a new FSM before by selecting File gt New see the section called Creating and modifying a Finite State Machine or loaded an exist ing file by chosing File gt Open from the main menu Then you have to be in the add state mode see the section called The Add State mode Finally you can left click at the position of the working area where the new state shall be The following dialog will appear allowing you to specify or modify the properties of the state 7 7 State Properties 77 Name State 2 Code 0010 Moore Outputs 0010 Radius Line width 40 Description This is the waiting state The respective fields have the following meaning Name The name of the state Code This is a unique identifier of the state to create Normally you don t have to care about this Moore Outputs These are the outputs sent by the FSM when this state is entered In binary FSMs this is a string of zeros and ones and in ASCII FSMs this is just one character
16. ntly selected states and transitions Switches to the select mode See the section called The Select mode for de tails Selects all states and transitions of the current FSM Deselects all objects Opens the options dialog See the section called Options for details Shows hides the state codes inside the states Each state has got a unique iden 3 Using Qfsm Moore Outputs Mealy Inputs Mealy Outputs Shadows Grid Pan View Zoom Zoom In Zoom Out Zoom 100 Machine State Edit Simulate Integrity Check Edit Set Start State Toggle Final State tifier called state code which is an integer that is automatically determined by Qfsm Shows hides the Moore outputs inside the states Each state defines its Moore outputs which are the values that are sent to the outputs of the FSM when the respective state is reached Shows hides the Mealy input conditions on the transitions Mealy inputs are asynchronous inputs to the FSM They can trigger transitions from one state to another if the condition of the respective transition is satisfied Shows hides the Mealy outputs on the transitions Mealy outputs are outputs of the FSM that were sent when a transition is triggered Thus each transition can define the Moore outputs that are sent when it is triggered Shows hides the shadows of the states Shows hides the grid on the working area Switches to the pan mode See the section call
17. of input conditions and outputs drawn on top of the transitions Tooltips Determines if tooltips should be shown or not when moving the mouse pointer over a state or a transition Start transition descriptor The text that is displayed next to the start transition Default Reset Inversion descriptor The text that is displayed before inverted transition condi tions Default NOT Any input descriptor The text that is displayed for transitions that are activated by any input Default any Default transition descriptor The text that is displayed for default transitions Default de fault Print header Prints a header with the FSM name and version at the top of the diagram Chapter 3 Contact If you have questions or suggestions concerning Qfsm feel free to contact me at lt qfsm at duffner dash net dot de gt I m also glad about any contribution you want to make to the project e g code bug fixes docu mentation packaging testing etc
18. of the action file is determined automatically by appending action at the end of the file name Example suppose you have created an ASCII FSM and you export it under the name myF SM r1 If you check the option Create action file the action file will be created under the name myF SM_actions rl Using ragel you can compile the action file like this ragel C o myFSM xml myFSM actions rl This will create an intermediate file an XML file called myFSM xml The option C is to tell ragel that the host language is C C Using Qfsm Finally the XML file can be compiled into C C Java or Ruby by one of the command starting with rlgen Thus in order to generate a C programm type rlgen cd o myFSM c myFSM xml The resulting C code will contain a function int parse char string that parses an input string and returns if the FSM accepts it i e finishes in a final state and 0 otherwise Options To display the options dialog select Edit Options from the main menu General Language Lets you choose the language of the application Having changed the language in the options you need to click OK and restart the application to have Qfsm in the desired language Grid Lets you choose the color and size of the grid displayed on the working area The grid can be activated via the main menu entry View Grid Shadows Determines if shadows should to be drawn and the their color Transitions Determines the appearance
19. tenation of characters as input condition for example print in order to recognize the word print To do this you have to create a transition and a state for each character and build a chain with the respective characters Escape sequences Special characters like the newline character need to be escaped i e backslash some character The following table shows the recognized escape sequences Table 2 1 Recognized escape sequences escape sequence meaning Nt tab n newline NE carriage return s space minus d digit 0 9 Note that the last escape sequence Nd actually represents 10 characters 10 Using Qfsm Characters that are neither printable nor in the above table can be specified by NO backslash zero followed by their hexadecimal code For example NOCF would represent the ASCII char acter 207 decimal Ranges You can further specify ranges by using the minus sign Thus a z means one of the characters between a and z including Any character even escaped ones can be used as start or end point of a range Mixed formats Finally you can combine several conditions each of them in one of the above mentioned notations into one long condition by just concatenating them Note that you must not separate them by any character like white space or comma Here are some examples A F0 9 d n r tXYZ xyz0 3N010A Z Checking the integrity
20. trol points These are indicated by small red and green points when a transition is selected The red points control the form of the transition i e the bend The green ones are used to attach them to a starting and end state The Pan mode When your diagram is larger than the working area of the window you can move the view to a dif ferent part of your diagram by dragging the mouse pointer The Zoom mode T In this mode you can zoom in the view by clicking with the left mouse button on the working area You can zoom out by keeping the CTRL key pressed at the same time you click The Add State mode e Clicking the left mouse button in the add state mode will add a new state at the position that was clicked A dialog where you can specify the properties of the new state will be opend beforehand See the section called Adding and modifying states for details The Add Transition mode yt Using Qfsm Dragging the mouse pointer in the add transition mode will add a new transition from the state where you pressed the left mouse button to the state where you relesed it A dialog where you can specify the properties of the new transition will be opend beforehand See the section called Adding and modifying transitions for details The Simulate mode iA oe In the simulate mode you can test the behaviour of your state machine with respect to external input When entering this state the simulator dialog will appear a
21. y for documentation purposes To modify the properties of an existing transition you have to be in the select mode see the sec tion called The Select mode Then either double click on the respective transition or select one transition by a single click and chose Transition gt Edit from the main menu You can also change the bend of the transition as well as its start state and end state To do this you have to be in the select mode and click with the left mouse button on the transition Four control points will appear that you can drag around by pressing the left mouse button The green ones allow you to change the start and end state With the red ones you can change the bend of the transition Input ASCII conditions When creating a transition of FSM that processes ASCII characters you have to enter an input con dition This condition can be a simple character e g a or several characters that are expressed by a special notation explained in the following Single character This is the most simple form of condition It contains one ASCII character e g a or z Note that for special characters e g or the space character you need to use an escape sequence see the section called Escape sequences Multiple characters If you want the condition to contain multiple characters i e a or f or you just enter the string af Clearly the order is not important Note that it is not possible to use a conca
Download Pdf Manuals
Related Search
Related Contents
VGN-NW Series PDF版はこちら - パーソナルアシスタント町田 Belkin F5D9230-4 User's Manual ECLIPSE ILLUMINATION MANUAL DE USUARIO BM Series User Manual (Software) DNM Product Specification Report Transcend TS4GCF170 flash memory Copyright © All rights reserved.
Failed to retrieve file