2 /* ###--------------------------------------------------------------### */
4 /* file : vhd_parse.c */
5 /* date : Oct 30 1995 */
7 /* author : L.A TABUSSE & H.N. VUONG & P. BAZARGAN-SABET */
8 /* content : vhdlloadbefig */
10 /* ###--------------------------------------------------------------### */
21 #include "bvl_utype.h"
22 #include "bvl_utdef.h"
23 #include "bvl_parse.h"
26 extern void vhd_bcomprestart (FILE *inputfile
);
30 char *vhdfindbefig(char *name
)
33 suffix
= V_STR_TAB
[__BVL_FILE_SUFFIX
].VALUE
;
34 if (suffix
== NULL
) suffix
= namealloc("vhd");
36 return filepath(name
, suffix
);
39 /* ###--------------------------------------------------------------### */
40 /* function : vhdloadbefig */
41 /* description : analyze a behavioural VHDL description and produce a */
42 /* set of data structure. The function returns a pointer */
43 /* on a BEFIG. Errors are repported in the returned */
45 /* ###--------------------------------------------------------------### */
48 vhdloadbefig (befig_list
*pt_befig
, char *figname
, unsigned int trace_mode
)
50 unsigned int check_mode
;
53 static unsigned int call_nbr
= 0 ;
55 // added to prevent warning
56 if (pt_befig
) call_nbr
=0 ;
58 suffix
= V_STR_TAB
[__BVL_FILE_SUFFIX
].VALUE
;
59 if (suffix
== NULL
) suffix
= namealloc("vhd");
61 if ((vhd_bcompin
= mbkfopen (figname
, suffix
, READ_TEXT
)) != NULL
)
63 sprintf (BVL_CURFIL
, "%s.%s", figname
, suffix
);
66 if (vhd_bcompin
== NULL
)
68 beh_error (100, figname
);
72 /* ###------------------------------------------------------### */
73 /* call the compiler on the current file */
74 /* - print a message if the trace mode is actif */
75 /* - add internal signals to the primary input list if */
76 /* "keep auxiliary" mode is actif */
77 /* ###------------------------------------------------------### */
79 if ((trace_mode
& BVL_TRACE
) != 0)
80 beh_message (3, BVL_CURFIL
);
82 if ((trace_mode
& BVL_KEEPAUX
) != 0)
89 if ((trace_mode
& BVL_CHECKEMPTY
) != 0)
95 vhd_bcomprestart (vhd_bcompin
);
102 /* ###------------------------------------------------------### */
103 /* check the consistency of the compiled description */
104 /* ###------------------------------------------------------### */
106 if ((trace_mode
& BVL_CHECKEMPTY
) != 0)
108 check_mode
= BEH_CHK_EMPTY
;
109 BVL_HEDFIG
->FLAG
= BEH_ARC_C
;
113 check_mode
= BEH_CHK_DRIVERS
;
114 BVL_HEDFIG
->FLAG
= BEH_ARC_VHDL
;
117 if (BVL_HEDFIG
->ERRFLG
== 0)
118 BVL_HEDFIG
->ERRFLG
= beh_chkbefig (BVL_HEDFIG
, check_mode
);
120 // fprintf( stdout, "BVL (vhd) : parse completed\n");