Le Parser Multi FSM nouveau est arrive !

This commit is contained in:
Ludovic Jacomme 2002-04-16 11:24:26 +00:00
parent 8533d03c59
commit 33e32ba92e
13 changed files with 1126 additions and 513 deletions

View File

@ -109,6 +109,7 @@
\------------------------------------------------------*/
# define FSM_MIXED_RTL_MASK (long)( 0x0001 )
# define FSM_MULTI_MASK (long)( 0x0002 )
/*------------------------------------------------------\
| |
@ -159,6 +160,10 @@
# define SetFsmFigMixedRtl( F ) ( (F)->FLAGS |= FSM_MIXED_RTL_MASK )
# define ClearFsmFigMixedRtl( F ) ( (F)->FLAGS &= ~FSM_MIXED_RTL_MASK )
# define IsFsmFigMulti( F ) ( (F)->FLAGS & FSM_MULTI_MASK )
# define SetFsmFigMulti( F ) ( (F)->FLAGS |= FSM_MULTI_MASK )
# define ClearFsmFigMulti( F ) ( (F)->FLAGS &= ~FSM_MULTI_MASK )
/*------------------------------------------------------\
| |
| Structures |
@ -334,6 +339,7 @@
long FLAGS;
ptype_list *PRAGMA;
chain_list *MULTI;
void *FIGURE;
void *USER;

View File

@ -211,6 +211,8 @@ int delfsmfig( Name )
destroyauthtable( Figure->HASH_STATE );
destroyauth2table( Figure->HASH_TRANS );
freechain( Figure->MULTI );
freefsmfig( Figure );
return( 1 );

View File

@ -338,9 +338,13 @@ void viewfsmfig( Figure )
fprintf( stdout, "\n\tNUMBER_TRANS : %ld", Figure->NUMBER_TRANS );
fprintf( stdout, "\n\tNUMBER_STACK : %ld", Figure->NUMBER_STACK );
fprintf( stdout, "\n\tSTACK_SIZE : %ld", Figure->STACK_SIZE );
fprintf( stdout, "\n\tCLOCK : %s", Figure->CLOCK );
fprintf( stdout, "\n\tCLOCK : %s", Figure->CLOCK ? Figure->CLOCK : "NULL" );
fprintf( stdout, "\n\tCLOCK_ABL : " );
viewablexpr( Figure->CLOCK_ABL, ABL_VIEW_VHDL );
if ( Figure->CLOCK_ABL != (ablexpr *)0 )
{
viewablexpr( Figure->CLOCK_ABL, ABL_VIEW_VHDL );
}
fprintf( stdout, "\n\tPORT : " );

View File

@ -3,3 +3,10 @@ lib_LIBRARIES = libFtl.a
include_HEADERS = ftl.h
libFtl_a_SOURCES = \
ftl.h ftlacces.c ftlacces.h ftlerror.c ftlerror.h
EXTRA_PROGRAMS = fsmtest
fsmtest_LDADD = @ALLIANCE_LIBS@ -lFtl -lFks -lFvh -lFsm \
-lBdd -lAbl -lAut -lMut
fsmtest_SOURCES = main.c

View File

@ -24,11 +24,7 @@
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/***************************************************************************
* Fonctions utiles pour fbfig : optimisation des abl d'un fbfig, evaluation *
* du cout . . . *
* Le 01/09/92.
****************************************************************************/
#include <stdio.h>
#include "mut.h"
#include "aut.h"
@ -36,138 +32,109 @@
#include "bdd.h"
#include "fvh.h"
/*------------------------------------------------------------------------i
fsp_mapCarExprFbh : applique une fonction de conversion sur chaque expression
d'une fbfig
---------------------------------------------------------------------------
retour : un void.
---------------------------------------------------------------------------*/
void fsp_mapCarExprFbh(fbh,func)
static void (*FbhFuncLeft)();
static void (*FbhFuncRight)();
fbfig_list *fbh;
chain_list *(*func)();
static void FbhScanExprInstruction();
/*------------------------------------------------------------\
| |
| FbhScanExprIf |
| |
\------------------------------------------------------------*/
void FbhScanExprIf( ScanIf )
fbifs_list *ScanIf;
{
fbout_list *out;
fbreg_list *reg;
fbbus_list *bus;
fbbux_list *bux;
biabl_list *biabl;
fbaux_list *aux;
FbhFuncRight( ScanIf->CND );
aux = fbh->BEAUX;
while (aux)
{
if (aux->ABL)
{
aux->ABL = (*func)(aux->ABL);
}
aux = aux->NEXT;
}
out = fbh->BEOUT;
while (out)
{
if (out->ABL)
{
out->ABL = (*func)(out->ABL);
}
out = out->NEXT;
}
reg = fbh->BEREG;
while (reg)
{
biabl = reg->BIABL;
while (biabl)
{
if (biabl->CNDABL && biabl->VALABL)
{
biabl->CNDABL = (*func)(biabl->CNDABL);
biabl->VALABL = (*func)(biabl->VALABL);
}
biabl = biabl->NEXT;
}
reg = reg->NEXT;
}
bus = fbh->BEBUS;
while (bus)
{
biabl = bus->BIABL;
while (biabl)
{
if (biabl->CNDABL && biabl->VALABL)
{
biabl->CNDABL = (*func)(biabl->CNDABL);
biabl->VALABL = (*func)(biabl->VALABL);
}
biabl = biabl->NEXT;
}
bus = bus->NEXT;
}
bux = fbh->BEBUX;
while (bux)
{
biabl = bux->BIABL;
while (biabl)
{
if (biabl->CNDABL && biabl->VALABL)
{
biabl->CNDABL = (*func)(biabl->CNDABL);
biabl->VALABL = (*func)(biabl->VALABL);
}
biabl = biabl->NEXT;
}
bux = bux->NEXT;
}
FbhScanExprInstruction( ScanIf->CNDTRUE );
FbhScanExprInstruction( ScanIf->CNDFALSE );
}
/*-----------------------------------------------------------------------
fbrinToChain_list : forme une chaine liste des entrees.
prend l'odre d'apparition.
-----------------------------------------------------------------------
parametres : fbh.
---------------------------------------------------------------------------
retour : un pointeur de chain_list.
---------------------------------------------------------------------------*/
chain_list *fbrinToChain_list(fbh)
fbfig_list *fbh;
{
fbrin_list *in;
chain_list *lst;
in = fbh->BERIN; /* entrees primaires */
lst = 0;
/*------------------------------------------------------------\
| |
| FbhScanExprAsg |
| |
\------------------------------------------------------------*/
while (in)
void FbhScanExprAsg( ScanAsg )
fbasg_list *ScanAsg;
{
FbhFuncLeft( ScanAsg->NAME );
FbhFuncRight( ScanAsg->ABL );
}
/*------------------------------------------------------------\
| |
| FbhScanExprWhen |
| |
\------------------------------------------------------------*/
static void FbhScanExprWhen( ScanCase )
fbcas_list *ScanCase;
{
char *ChoiceValue;
int Index;
FbhFuncRight( ScanCase->ABL );
for ( Index = 0; Index < ScanCase->SIZE; Index++ )
{
lst = addchain(lst,(void *)in->NAME);
in = in->NEXT;
};
return(lst);
ChoiceValue = ScanCase->CHOICE[ Index ].VALUE;
FbhScanExprInstruction( ScanCase->CHOICE[ Index ].INSTRUCTION );
}
}
/*-------------------------------------------------------------------------
fsp_countInputFbh : compte les entrees d'un circuit (fbrin)
---------------------------------------------------------------------------
retour : un int.
---------------------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| FbhScanExprInstruction |
| |
\------------------------------------------------------------*/
int fsp_countInputFbh(fbh)
fbfig_list *fbh;
static void FbhScanExprInstruction( Instruction )
ptype_list *Instruction;
{
fbrin_list *in;
int count = 0;
ptype_list *ScanIns;
in = fbh->BERIN; /* entrees primaires */
while (in)
{
in = in->NEXT;
count++;
};
for ( ScanIns = Instruction;
ScanIns != (ptype_list *)0;
ScanIns = ScanIns->NEXT )
{
switch ( ScanIns->TYPE )
{
case FBH_BECAS : FbhScanExprWhen( ScanIns->DATA );
break;
return(count);
case FBH_BEIFS : FbhScanExprIf( ScanIns->DATA );
break;
case FBH_BEASG : FbhScanExprAsg( ScanIns->DATA );
break;
}
}
}
/*------------------------------------------------------------\
| |
| FbhScanExprProcess |
| |
\------------------------------------------------------------*/
void FbhScanExprProcess( Process, FuncLeft, FuncRight )
fbpcs_list *Process;
void (*FuncLeft)();
void (*FuncRight)();
{
FbhFuncLeft = FuncLeft;
FbhFuncRight = FuncRight;
FbhScanExprInstruction( Process->INSTRUCTION );
}

View File

@ -825,12 +825,24 @@ pragma_declaration
: Pragma
{
char pragma[30];
char type[30];
char name[30];
sscanf((char *)$1,"-- %s %s %s", pragma,type,name);
char type[128];
char name[128];
char value[128];
char *pt;
int field;
FBL_BEFPNT->BEPGM = fbh_addfbpgm(FBL_BEFPNT->BEPGM,type,name,0);
FBL_BEFPNT->BEPGM->USER = (void *)FBL_LINNUM;
field = sscanf((char *)$1,"-- %s %s %s %s", pragma,type,name,value);
if ( field == 3 ) pt = (void *)0;
else
if ( field == 4 ) pt = namealloc( value );
else
{
fbl_error (86,0);
}
FBL_BEFPNT->BEPGM = fbh_addfbpgm(FBL_BEFPNT->BEPGM,type,name,pt);
FBL_BEFPNT->BEPGM->LINE_NUM = FBL_LINNUM;
}
;
@ -927,7 +939,7 @@ full_type_declaration
{
FBL_BEFPNT->BETYP = fbh_addfbtyp(FBL_BEFPNT->BETYP,$2,$4.LEFT,
$4.RIGHT,$4.VALUE,$4.SIZE,$4.BYTE,$4.BASE,$4.INDEX,$4.RESOLV,$4.CLASS);
FBL_BEFPNT->BETYP->USER = (void *)FBL_LINNUM;
FBL_BEFPNT->BETYP->LINE_NUM = FBL_LINNUM;
addtab(hshtab,$2,FBL_MODNAM,FBL_SIGDFN,FBL_TPEDFN);
addtab(hshtab,$2,FBL_MODNAM,FBL_LBLDFN,$4.CLASS);
addtab(hshtab,$2,FBL_MODNAM,FBL_TYPDFN,FBL_NUMTYP);
@ -954,7 +966,7 @@ subtype_declaration
{
FBL_BEFPNT->BETYP = fbh_addfbtyp(FBL_BEFPNT->BETYP,$2,$4.LEFT,
$4.RIGHT,$4.VALUE,$4.SIZE,$4.BYTE,$4.BASE,$4.INDEX,$4.RESOLV,$4.CLASS);
FBL_BEFPNT->BETYP->USER = (void *)FBL_LINNUM;
FBL_BEFPNT->BETYP->LINE_NUM = FBL_LINNUM;
addtab(hshtab,$2,FBL_MODNAM,FBL_SIGDFN,FBL_TPEDFN);
addtab(hshtab,$2,FBL_MODNAM,FBL_LBLDFN,$4.CLASS);
addtab(hshtab,$2,FBL_MODNAM,FBL_TYPDFN,FBL_NUMTYP);
@ -1849,7 +1861,7 @@ unlabeled_process_statement
{FBL_NM1LST = 0 ;}
.sensitivity_list.
{ FBL_BEFPNT->BEPCS = fbh_addfbpcs(FBL_BEFPNT->BEPCS,FBL_LBLNAM,FBL_NM1LST,0,0,0);
FBL_BEFPNT->BEPCS->USER = (void *)FBL_LINNUM;
FBL_BEFPNT->BEPCS->LINE_NUM = FBL_LINNUM;
FBL_NM1LST = 0; }
process_declarative_part
_BEGIN
@ -1959,7 +1971,7 @@ assertion_statement
Semicolon_ERR
{
FBL_BEFPNT->BEMSG = fbh_addfbmsg(FBL_BEFPNT->BEMSG,0,$4,$3,$2.LIST_ABL->DATA,0);
FBL_BEFPNT->BEMSG->USER = (void *)FBL_LINNUM;
FBL_BEFPNT->BEMSG->LINE_NUM = FBL_LINNUM;
}
;
@ -2088,7 +2100,7 @@ signal_assignment_statement
if (i >= in_bound)
{
*pnt =fbh_addfbasg(*pnt,newname, (struct chain *)abl_pnt->DATA,type);
((struct fbasg *)((*pnt)->DATA))->USER = (void *)FBL_LINNUM;
((struct fbasg *)((*pnt)->DATA))->LINE_NUM = FBL_LINNUM;
abl_pnt = abl_pnt->NEXT;
addauthelem( FBL_HASH_ASG_FSM, newname, 1 );
@ -2100,7 +2112,7 @@ signal_assignment_statement
else
{
*pnt = fbh_addfbasg(*pnt,$1.NAME,abl_pnt->DATA,type);
((struct fbasg *)((*pnt)->DATA))->USER = (void *)FBL_LINNUM;
((struct fbasg *)((*pnt)->DATA))->LINE_NUM = FBL_LINNUM;
}
}
}
@ -2119,7 +2131,7 @@ if_statement
struct ptype **pnt;
pnt = (struct ptype**)FBL_NM1LST->DATA;
*pnt = fbh_addfbifs(*pnt,$2.LIST_ABL->DATA);
((struct fbifs *)((*pnt)->DATA))->USER = (void *)FBL_LINNUM;
((struct fbifs *)((*pnt)->DATA))->LINE_NUM = FBL_LINNUM;
FBL_NM1LST = addchain(FBL_NM1LST,&(((struct fbifs*)(*pnt)->DATA)->CNDTRUE));
}
sequence_of_statements
@ -2150,7 +2162,7 @@ if_statement
struct ptype **pnt;
pnt = (struct ptype**)FBL_NM1LST->DATA;
*pnt = fbh_addfbifs(*pnt,$3.LIST_ABL->DATA);
((struct fbifs *)((*pnt)->DATA))->USER = (void *)FBL_LINNUM;
((struct fbifs *)((*pnt)->DATA))->LINE_NUM = FBL_LINNUM;
FBL_NM1LST = addchain(FBL_NM1LST,(void*)&((struct fbifs*)(*pnt)->DATA)->CNDTRUE);
}
sequence_of_statements
@ -2197,12 +2209,13 @@ case_statement
/*fbcas = (struct fbcas *)mbkalloc(sizeof(struct fbcas));
fbcas->CHOICE = 0;
fbcas->USER = 0;
fbcas->LINE_NUM = 0;
fbcas->SIZE = 0;
fbcas->TYPE = $2.TYPE;
fbcas->ABL = $2.LIST_ABL->DATA;*/
FBL_OTHPNT = 0;
*pnt = fbh_addfbcas(*pnt,$2.LIST_ABL->DATA,$2.TYPE);
((struct fbcas *)((*pnt)->DATA))->USER = (void *)FBL_LINNUM;
((struct fbcas *)((*pnt)->DATA))->LINE_NUM = FBL_LINNUM;
FBL_NM1LST = addchain(FBL_NM1LST,(void*)&(((struct fbcas*)((*pnt)->DATA))->SIZE));
FBL_NM1LST = addchain(FBL_NM1LST,(void*)&(((struct fbcas*)(*pnt)->DATA)->CHOICE));
}
@ -2897,7 +2910,7 @@ attribute_name
ptabl = (struct chain*)expr2.LIST_ABL->DATA;
FBL_BEFPNT->BEDLY = fbh_addfbaux(FBL_BEFPNT->BEDLY,lclname,
ptabl,0,type);
FBL_BEFPNT->BEDLY->USER = (void *)FBL_LINNUM;
FBL_BEFPNT->BEDLY->LINE_NUM = FBL_LINNUM;
/* LUDO addtab (hshtab,$1,FBL_MODNAM,FBL_STBDFN,1); */
addtab (hshtab,lclname,FBL_MODNAM,FBL_WMNDFN,-1);
addtab (hshtab,lclname,FBL_MODNAM,FBL_WMXDFN,-1);
@ -3397,37 +3410,37 @@ short right;
if (porflg == 1)
{
ptfig->BEPOR = fbh_addfbpor (ptfig->BEPOR,extname,lclmod,lcltyp);
ptfig->BEPOR->USER = (void *)FBL_LINNUM;
ptfig->BEPOR->LINE_NUM = FBL_LINNUM;
}
if (rinflg == 1)
{
ptfig->BERIN = fbh_addfbrin (ptfig->BERIN,extname);
ptfig->BERIN->USER = (void *)FBL_LINNUM;
ptfig->BERIN->LINE_NUM = FBL_LINNUM;
}
if (outflg == 1)
{
ptfig->BEOUT = fbh_addfbout (ptfig->BEOUT,extname,0,0,lcltyp);
ptfig->BEOUT->USER = (void *)FBL_LINNUM;
ptfig->BEOUT->LINE_NUM = FBL_LINNUM;
}
if (busflg == 1)
{
ptfig->BEBUS = fbh_addfbbus (ptfig->BEBUS,extname,0,0,lcltyp);
ptfig->BEBUS->USER = (void *)FBL_LINNUM;
ptfig->BEBUS->LINE_NUM = FBL_LINNUM;
}
if (auxflg == 1)
{
ptfig->BEAUX = fbh_addfbaux (ptfig->BEAUX,extname,0,0,lcltyp);
ptfig->BEAUX->USER = (void *)FBL_LINNUM;
ptfig->BEAUX->LINE_NUM = FBL_LINNUM;
}
if (buxflg == 1)
{
ptfig->BEBUX = fbh_addfbbux (ptfig->BEBUX,extname,0,0,lcltyp);
ptfig->BEBUX->USER = (void *)FBL_LINNUM;
ptfig->BEBUX->LINE_NUM = FBL_LINNUM;
}
if (regflg == 1)
{
ptfig->BEREG = fbh_addfbreg (ptfig->BEREG,extname,0,0);
ptfig->BEREG->USER = (void *)FBL_LINNUM;
ptfig->BEREG->LINE_NUM = FBL_LINNUM;
}
}
}
@ -3440,37 +3453,37 @@ short right;
if (porflg == 1)
{
ptfig->BEPOR = fbh_addfbpor (ptfig->BEPOR,name,lclmod,lcltyp);
ptfig->BEPOR->USER = (void *)FBL_LINNUM;
ptfig->BEPOR->LINE_NUM = FBL_LINNUM;
}
if (rinflg == 1)
{
ptfig->BERIN = fbh_addfbrin (ptfig->BERIN,name);
ptfig->BERIN->USER = (void *)FBL_LINNUM;
ptfig->BERIN->LINE_NUM = FBL_LINNUM;
}
if (outflg == 1)
{
ptfig->BEOUT = fbh_addfbout (ptfig->BEOUT,name,0,0,lcltyp);
ptfig->BEOUT->USER = (void *)FBL_LINNUM;
ptfig->BEOUT->LINE_NUM = FBL_LINNUM;
}
if (busflg == 1)
{
ptfig->BEBUS = fbh_addfbbus (ptfig->BEBUS,name,0,0,lcltyp);
ptfig->BEBUS->USER = (void *)FBL_LINNUM;
ptfig->BEBUS->LINE_NUM = FBL_LINNUM;
}
if (auxflg == 1)
{
ptfig->BEAUX = fbh_addfbaux (ptfig->BEAUX,name,0,0,lcltyp);
ptfig->BEAUX->USER = (void *)FBL_LINNUM;
ptfig->BEAUX->LINE_NUM = FBL_LINNUM;
}
if (buxflg == 1)
{
ptfig->BEBUX = fbh_addfbbux (ptfig->BEBUX,name,0,0,lcltyp);
ptfig->BEBUX->USER = (void *)FBL_LINNUM;
ptfig->BEBUX->LINE_NUM = FBL_LINNUM;
}
if (regflg == 1)
{
ptfig->BEREG = fbh_addfbreg (ptfig->BEREG,name,0,0);
ptfig->BEREG->USER = (void *)FBL_LINNUM;
ptfig->BEREG->LINE_NUM = FBL_LINNUM;
}
}

View File

@ -362,6 +362,9 @@ char *str1;
case 85:
(void) fprintf (stderr,"when choice is empty in case statement \n");
break;
case 86:
(void) fprintf (stderr,"bad pragma\n");
break;
case 100:
(void) fprintf (stderr,"cannot find `%s`\n",str1);

View File

@ -93,7 +93,7 @@ typedef struct fbfig /* fbhaviour figure */
struct fbpcs *BEPCS; /* list of processes */
struct bddcircuit *CIRCUI; /* Circuit's pointer used for BDDs */
struct ptype *USER; /* reserved for user's applications */
unsigned char FLAG; /* error flags */
unsigned long FLAG; /* error flags */
unsigned char TYPE; /* type of the description (not used) */
struct fbtyp *BETYP; /* list of declared types */
struct fbpgm *BEPGM; /* list of pragmas */
@ -106,7 +106,8 @@ typedef struct fbreg /* register */
char *NAME; /* register's name */
struct biabl *BIABL; /* list of drivers (ABL) */
struct binode *BINODE; /* list of drivers (BDD) */
unsigned char FLAG;
unsigned long FLAG;
unsigned long LINE_NUM;
void *USER;
}
fbreg_list;
@ -119,6 +120,7 @@ typedef struct fbmsg /* assert instruction */
char *MESSAGE; /* assertion's message */
struct chain *ABL; /* assertion's condition (ABL) */
bddnode *NODE; /* assertion's condition (BDD) */
unsigned long LINE_NUM;
void *USER;
}
fbmsg_list;
@ -130,7 +132,8 @@ typedef struct fbout /* output port */
struct chain *ABL; /* port's equation (ABL) */
bddnode *NODE; /* port's equation (BDD) */
unsigned char TYPE; /* port's type */
unsigned char FLAG;
unsigned long FLAG;
unsigned long LINE_NUM;
void *USER;
}
fbout_list;
@ -142,7 +145,8 @@ typedef struct fbbus /* output port (BUS) */
struct biabl *BIABL; /* list of drivers (ABL) */
struct binode *BINODE; /* list of drivers (BDD) */
unsigned char TYPE; /* port's type : W or M */
unsigned char FLAG;
unsigned long FLAG;
unsigned long LINE_NUM;
void *USER;
}
fbbus_list;
@ -154,7 +158,8 @@ typedef struct fbaux /* auxiliary signal */
struct chain *ABL; /* signal's equation (ABL) */
bddnode *NODE; /* signal's equation (BDD) */
unsigned char TYPE; /* signal's type */
unsigned char FLAG;
unsigned long FLAG;
unsigned long LINE_NUM;
void *USER;
}
fbaux_list;
@ -166,7 +171,8 @@ typedef struct fbbux /* internal signal (BUS) */
struct biabl *BIABL; /* list of drivers (ABL) */
struct binode *BINODE; /* list of drivers (BDD) */
unsigned char TYPE; /* signal's type : W or M */
unsigned char FLAG;
unsigned long FLAG;
unsigned long LINE_NUM;
void *USER;
}
fbbux_list;
@ -177,6 +183,7 @@ typedef struct fbpor /* port */
char *NAME; /* port's name */
char DIRECTION; /* port's mode (same as LOCON) */
unsigned char TYPE; /* port's type (B, M or W) */
unsigned long LINE_NUM;
void *USER;
}
fbpor_list;
@ -187,6 +194,7 @@ typedef struct biabl /* couple of ABL */
char *LABEL; /* driver's label */
struct chain *CNDABL; /* driver's connection condition (ABL) */
struct chain *VALABL; /* equation of driven value (ABL) */
unsigned long LINE_NUM;
void *USER;
}
biabl_list;
@ -196,6 +204,7 @@ typedef struct binode /* couple of BDD */
struct binode *NEXT; /* next figure */
bddnode *CNDNODE; /* driver's connection condition (BDD) */
bddnode *VALNODE; /* equation of driven value (BDD) */
unsigned long LINE_NUM;
void *USER;
}
binode_list;
@ -204,6 +213,7 @@ typedef struct fbrin /* primary inputs */
{
struct fbrin *NEXT; /* next input */
char *NAME; /* input's name */
unsigned long LINE_NUM;
void *USER;
}
fbrin_list;
@ -214,6 +224,7 @@ typedef struct fbgen /* generic */
char *NAME; /* generic's name */
char *TYPE; /* generic type's name */
void *VALUE; /* generic's value */
unsigned long LINE_NUM;
void *USER;
}
fbgen_list;
@ -225,7 +236,8 @@ typedef struct fbpcs /* process */
struct chain *SENSITIVITY; /* list of sensitivity */
struct ptype *INSTRUCTION; /* list of instructions */
struct chain *OUTPUTS; /* list of assigned signals */
unsigned char FLAG; /* flag (not used) */
unsigned long LINE_NUM;
unsigned long FLAG; /* flag (not used) */
void *USER;
}
fbpcs_list;
@ -235,6 +247,7 @@ typedef struct fbifs /* if statement */
struct chain *CND; /* condition (abl) */
struct ptype *CNDTRUE; /* list of instructions when true */
struct ptype *CNDFALSE; /* list of instructions when false */
unsigned long LINE_NUM;
void *USER;
}
fbifs_list;
@ -244,6 +257,7 @@ typedef struct fbasg /* signal assignment statement */
char *NAME; /* target's name */
struct chain *ABL; /* condition (abl) */
unsigned char TYPE; /* signal's type */
unsigned long LINE_NUM;
void *USER;
}
fbasg_list;
@ -254,6 +268,7 @@ typedef struct fbcas /* case statement */
struct fbcho *CHOICE; /* table of choices */
unsigned char TYPE; /* expression's type */
unsigned int SIZE; /* size of choices' table */
unsigned long LINE_NUM;
void *USER;
}
fbcas_list;
@ -263,6 +278,7 @@ typedef struct fbcho /* a choice in a case instruction */
char *VALUE; /* the value of the choice */
unsigned int SIZE; /* size of the value in byte */
struct ptype *INSTRUCTION; /* list of instructions */
unsigned long LINE_NUM;
void *USER;
}
fbcho_list;
@ -280,6 +296,7 @@ typedef struct fbtyp /* type or subtype */
unsigned char INDEX; /* the type of the index for an array */
unsigned char BASE; /* the base type or element's type */
unsigned char RESOLV; /* index of resolution function */
unsigned long LINE_NUM;
void *USER;
}
fbtyp_list;
@ -290,6 +307,7 @@ typedef struct fbpgm /* pragma */
char *TYPE; /* prgma's type */
char *NAME; /* object's name */
void *VALUE; /* prgma's content */
unsigned long LINE_NUM;
void *USER;
}
fbpgm_list;
@ -384,4 +402,10 @@ extern void vhdlsavefbport __P(( fbfig_list *pthedfbfig, int synopsys ));
extern void vhdlsavefbarchi __P(( fbfig_list *pthedfbfig, int synopsys ));
extern FILE *FblDriveFile;
/* ###------------------------------------------------------### */
/* Tools
/* ###------------------------------------------------------### */
extern void FbhScanExprProcess __P(( fbpcs_list *Process, void (*FuncLeft)(), void (*FuncRight)()));
#endif

View File

@ -642,6 +642,11 @@ void vhdlsavefsmfig( FsmFigure )
fvherror( FVH_ERROR_OPEN_FILE, FsmFigure->NAME, 0 );
}
if ( IsFsmFigMulti( FsmFigure ) )
{
fvherror( FVH_ERROR_NOT_YET_IMPLEMENTED, FsmFigure->NAME, 0 );
}
VhdlWriteHeader( FsmFigure );
VhdlWriteEntity( FsmFigure );
VhdlWriteArchitecture( FsmFigure );

View File

@ -104,7 +104,8 @@ void fvh_error( Error, Text, Value, File, Line )
fprintf( stderr, "Illegal default output assignation\n" );
break;
case FVH_ERROR_NO_STATE :
fprintf( stderr, "Number of state is zero in \"%s\"\n", Text );
fprintf( stderr, "Number of state is zero in \"%s\" (FSM %s)\n",
Text, (char *)Value );
break;
case FVH_ERROR_CONTROL_TYPE :
fprintf( stderr, "Bad control type size in \"%s\" line %ld\n", Text, Value );
@ -155,7 +156,8 @@ void fvh_error( Error, Text, Value, File, Line )
fprintf( stderr, "Illegal output \"%s\" assignation line %ld\n", Text, Value );
break;
case FVH_ERROR_MISSING_CLOCK_PORT :
fprintf( stderr, "Missing clock declaration in figure \"%s\"\n", Text );
fprintf( stderr, "Missing clock declaration in figure \"%s\" (fsm %s)\n",
Text, (char *)Value );
break;
case FVH_ERROR_STACK_SIZE_ZERO :
fprintf( stderr, "Size of stack is zero in \"%s\"\n", Text );
@ -176,11 +178,20 @@ void fvh_error( Error, Text, Value, File, Line )
fprintf( stderr, "Illegal IF condition line %ld\n", Value );
break;
case FVH_ERROR_TWO_PROCESS :
fprintf( stderr, "Should have two process in figure \"%s\"\n", Text );
fprintf( stderr, "Should have two process for each FSM in figure \"%s\"\n", Text );
break;
case FVH_ERROR_ILLEGAL_PROCESS_BODY :
fprintf( stderr, "Illegal body structure for process \"%s\" line %ld\n", Text, Value );
fprintf( stderr, "Illegal body structure for process \"%s\" line %ld\n",
Text, Value );
break;
case FVH_ERROR_PRAGMA_SPECIFICATION :
fprintf( stderr, "Illegal pragma specification in figure \"%s\"\n", Text );
break;
case FVH_ERROR_BAD_PROCESS :
fprintf( stderr, "Process \"%s\" not compatible with the FSM VHDL subset in figure \"%s\"\n", Text, (char *)Value );
break;
case FVH_ERROR_NOT_YET_IMPLEMENTED :
fprintf( stderr, "Multi FSM driver not yet implemented for figure \"%s\"\n", Text );
default :
fprintf( stderr, "Internal error number %d\n", Error );
}

View File

@ -82,6 +82,9 @@
# define FVH_ERROR_CLOCK_PROCESS 30
# define FVH_ERROR_MISSING_SIGNAL 31
# define FVH_ERROR_ILLEGAL_PROCESS_BODY 32
# define FVH_ERROR_PRAGMA_SPECIFICATION 33
# define FVH_ERROR_BAD_PROCESS 34
# define FVH_ERROR_NOT_YET_IMPLEMENTED 35
/*------------------------------------------------------------\
| |

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,38 @@
| Types |
| |
\------------------------------------------------------------*/
typedef struct fbpcsinfo
{
chain_list *READ_LIST;
chain_list *WRITE_LIST;
authtable *HASH_READ;
authtable *HASH_WRITE;
} fbpcsinfo;
typedef struct fvhfig_list
{
struct fvhfig_list *NEXT;
char *NAME;
fsmfig_list *FSM_FIGURE;
fbpcs_list *PROCESS_CLOCK;
fbpcs_list *PROCESS_MAIN;
char *CLOCK;
char *CURRENT_STATE;
char *NEXT_STATE;
char *FIRST_STATE;
char *RETURN_STATE;
char *CONTROL;
char *STACK_CONTROL[ FSM_MAX_CTRL ];
fbtyp_list *STATE_TYPE;
fbtyp_list *CONTROL_TYPE;
unsigned char CLOCK_OK;
unsigned char WHEN_CONDITION;
unsigned char STAR_STATE_LOCOUT;
} fvhfig_list;
/*------------------------------------------------------------\
| |
| Variables |