Manual Page Result
0
Command: fsm.10 | Section: 10 | Source: UNIX v10 | File: fsm.10.5
FSM(10.5) FSM(10.5)
NAME
fsm - finite state machine language format
DESCRIPTION
Fsm is designed to write finite state machines. It assumes that there
are some number of input and output pins. These must be declared
first. The input clock speed can also be declared so that the compiler
will calculate the length of loops given in the time format. The input
programs resemble C. There must be a procedure named main for the com-
piler to proceed. Procedures declared "inline" are called directly by
the compiler to generate inline code. Otherwise the syntax is very fa-
miliar. Note that all procedures must be declared void. Therefore,
there are no expressions on the return statement.
The yacc(1) syntax for fsm is given below:
program : declarations procedures
declarations : declarations declaration ;
| empty
declaration : input
| outputDecl
input : INPUT inputDetails
inputDetails : BIT ID
| FIELD ID < NUMBER : NUMBER >
| CLOCK clockFrequency frequency
clockFrequency : NUMBER
| NUMBER . NUMBER
frequency : MHZ
| KHZ
outputDecl : OUTPUT outputDetails
outputDetails : BIT ID
| FIELD ID < NUMBER : NUMBER >
procedures : procedures procedure
| empty
procedure : inline VOID ID ( id_list ) statement
inline : INLINE
| empty
statements : statements statement
| empty
statement : output
| loop
| do
| enabled
| ifprefix statement
| ifelseprefix statement
| while
| repeat
| goto
| break
| continue
| call
| label statement
| { statements }
| ;
call : ID ( expression_list ) ;
loop : LOOP statement
enabled : ENABLED statement
ifprefix : IF boolean
ifelseprefix : ifprefix statement ELSE
while : WHILE whileHead boolean whileTail statement
do : DO statement dopart ;
dopart : UNTIL boolean
| WHILE boolean
repeat : REPEAT NUMBER DO statement
output : OUTPUT ( field_list ) outputSuffix ;
outputSuffix : FOR timesOrCycles
timesOrCycles : NUMBER times
| NUMBER CYCLES
times : NS
| US
| MS
goto : GOTO ID
break : BREAK
continue : CONTINUE
label : ID :
boolean : ( expression )
id_list : ID
| id_list , ID
| empty
expression_list : expression
| expression_list , expression
| empty
field_list : field
| field_list , field
field : ID = expression
expression : ( expression )
| expression + expression
| expression - expression
| expression & expression
| expression | expression
| expression ^ expression
| expression >> expression
| expression << expression
| ~ expression
| ! expression
| INPUT ( ID )
| ID
| NUMBER
UCDS FSM(10.5)