Skip to content

Commit

Permalink
Arrange for mcd id=00_00_00_01 to go to stdout
Browse files Browse the repository at this point in the history
 as well as a user specified log file, set log
 file to buffer lines.

 Add vpi_flush function, and clear up some cunfused
 return codes from other vpi functions.

 Adjust $display and vcd/lxt messages to use the
 standard output/log file.
  • Loading branch information
steve committed May 15, 2003
1 parent 04d32a4 commit 2e3ce49
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 61 deletions.
17 changes: 14 additions & 3 deletions vpi/sys_display.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_display.c,v 1.59 2003/05/02 15:45:43 steve Exp $"
#ident "$Id: sys_display.c,v 1.60 2003/05/15 16:51:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -899,10 +899,10 @@ static int sys_display_calltf(char *name)
vpi_put_userdata(sys, info);
}

do_display(5, info);
do_display(1, info);

if (strncmp(name,"$display",8) == 0)
vpi_mcd_printf(5, "\n");
vpi_mcd_printf(1, "\n");

return 0;
}
Expand Down Expand Up @@ -1666,6 +1666,17 @@ void sys_display_register()

/*
* $Log: sys_display.c,v $
* Revision 1.60 2003/05/15 16:51:08 steve
* Arrange for mcd id=00_00_00_01 to go to stdout
* as well as a user specified log file, set log
* file to buffer lines.
*
* Add vpi_flush function, and clear up some cunfused
* return codes from other vpi functions.
*
* Adjust $display and vcd/lxt messages to use the
* standard output/log file.
*
* Revision 1.59 2003/05/02 15:45:43 steve
* Certain constants are allowed as mcd parameters.
*
Expand Down
30 changes: 21 additions & 9 deletions vpi/sys_lxt.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_lxt.c,v 1.20 2003/04/28 01:03:11 steve Exp $"
#ident "$Id: sys_lxt.c,v 1.21 2003/05/15 16:51:09 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -290,7 +290,7 @@ inline static int install_dumpvars_callback(void)
return 0;

if (dumpvars_status == 2) {
vpi_mcd_printf(6, "VCD Error:"
vpi_mcd_printf(1, "VCD Error:"
" $dumpvars ignored,"
" previously called at simtime %lu\n",
dumpvars_time);
Expand Down Expand Up @@ -396,14 +396,14 @@ static void open_dumpfile(const char*path)
dump_file = lt_init(path);

if (dump_file == 0) {
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"LXT Error: Unable to open %s for output.\n",
path);
return;
} else {
int prec = vpi_get(vpiTimePrecision, 0);

vpi_mcd_printf(4,
vpi_mcd_printf(1,
"LXT info: dumpfile %s opened for output.\n",
path);

Expand All @@ -430,7 +430,7 @@ static int sys_dumpfile_calltf(char*name)

if (vpi_get(vpiType, item) != vpiConstant
|| vpi_get(vpiConstType, item) != vpiStringConst) {
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"LXT Error:"
" %s parameter must be a string constant\n",
name);
Expand Down Expand Up @@ -590,17 +590,18 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
const char* fullname =
vpi_get_str(vpiFullName, item);

vpi_mcd_printf(4,
#if 0
vpi_mcd_printf(1,
"LXT info:"
" scanning scope %s, %u levels\n",
fullname, depth);

#endif
nskip = 0 != vcd_names_search(&lxt_tab, fullname);

if (!nskip)
vcd_names_add(&lxt_tab, fullname);
else
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"LXT warning:"
" ignoring signals"
" in previously scanned scope %s\n",
Expand All @@ -623,7 +624,7 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break;

default:
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"LXT Error: $lxtdumpvars: Unsupported parameter "
"type (%d)\n", vpi_get(vpiType, item));
}
Expand Down Expand Up @@ -793,6 +794,17 @@ void sys_lxt_register()

/*
* $Log: sys_lxt.c,v $
* Revision 1.21 2003/05/15 16:51:09 steve
* Arrange for mcd id=00_00_00_01 to go to stdout
* as well as a user specified log file, set log
* file to buffer lines.
*
* Add vpi_flush function, and clear up some cunfused
* return codes from other vpi functions.
*
* Adjust $display and vcd/lxt messages to use the
* standard output/log file.
*
* Revision 1.20 2003/04/28 01:03:11 steve
* Fix stringheap list management failure.
*
Expand Down
31 changes: 21 additions & 10 deletions vpi/sys_vcd.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_vcd.c,v 1.43 2003/04/27 02:22:28 steve Exp $"
#ident "$Id: sys_vcd.c,v 1.44 2003/05/15 16:51:09 steve Exp $"
#endif

# include "config.h"
Expand All @@ -39,7 +39,6 @@
#endif
# include "vcd_priv.h"


static FILE*dump_file = 0;

static const char*units_names[] = {
Expand Down Expand Up @@ -249,7 +248,7 @@ inline static int install_dumpvars_callback(void)
return 0;

if (dumpvars_status == 2) {
vpi_mcd_printf(6, "VCD Error:"
vpi_mcd_printf(1, "VCD Error:"
" $dumpvars ignored,"
" previously called at simtime %lu\n",
dumpvars_time);
Expand Down Expand Up @@ -353,7 +352,7 @@ static void open_dumpfile(const char*path)
dump_file = fopen(path, "w");

if (dump_file == 0) {
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"VCD Error: Unable to open %s for output.\n",
path);
return;
Expand All @@ -363,7 +362,7 @@ static void open_dumpfile(const char*path)
unsigned udx = 0;
time_t walltime;

vpi_mcd_printf(4,
vpi_mcd_printf(1,
"VCD info: dumpfile %s opened for output.\n",
path);

Expand Down Expand Up @@ -404,7 +403,7 @@ static int sys_dumpfile_calltf(char*name)

if (vpi_get(vpiType, item) != vpiConstant
|| vpi_get(vpiConstType, item) != vpiStringConst) {
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"VCD Error:"
" %s parameter must be a string constant\n",
name);
Expand Down Expand Up @@ -570,17 +569,18 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
const char* fullname =
vpi_get_str(vpiFullName, item);

vpi_mcd_printf(4,
#if 0
vpi_mcd_printf(1,
"VCD info:"
" scanning scope %s, %u levels\n",
fullname, depth);

#endif
nskip = 0 != vcd_names_search(&vcd_tab, fullname);

if (!nskip)
vcd_names_add(&vcd_tab, fullname);
else
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"VCD warning:"
" ignoring signals"
" in previously scanned scope %s\n",
Expand All @@ -603,7 +603,7 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break;

default:
vpi_mcd_printf(6,
vpi_mcd_printf(1,
"VCD Error: $dumpvars: Unsupported parameter "
"type (%d)\n", vpi_get(vpiType, item));
}
Expand Down Expand Up @@ -793,6 +793,17 @@ void sys_vcd_register()

/*
* $Log: sys_vcd.c,v $
* Revision 1.44 2003/05/15 16:51:09 steve
* Arrange for mcd id=00_00_00_01 to go to stdout
* as well as a user specified log file, set log
* file to buffer lines.
*
* Add vpi_flush function, and clear up some cunfused
* return codes from other vpi functions.
*
* Adjust $display and vcd/lxt messages to use the
* standard output/log file.
*
* Revision 1.43 2003/04/27 02:22:28 steve
* Capture VCD dump value in the rosync time period.
*
Expand Down
40 changes: 29 additions & 11 deletions vpi_user.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vpi_user.h,v 1.24 2003/04/20 02:49:07 steve Exp $"
#ident "$Id: vpi_user.h,v 1.25 2003/05/15 16:51:08 steve Exp $"
#endif


Expand Down Expand Up @@ -215,19 +215,26 @@ typedef struct t_vpi_value {

/* VPI FUNCTIONS */
extern void vpi_register_systf(const struct t_vpi_systf_data*ss);
extern void vpi_printf(const char*fmt, ...)
__attribute__((format (printf,1,2)));

extern void vpi_vprintf(const char*fmt, va_list ap);

extern PLI_UINT32 vpi_mcd_close(unsigned int mcd);
/* I/O routines */
extern PLI_UINT32 vpi_mcd_open(char *name);
extern PLI_UINT32 vpi_mcd_close(PLI_UINT32 mcd);
extern char *vpi_mcd_name(PLI_UINT32 mcd);
extern PLI_UINT32 vpi_mcd_open(char *name);
extern PLI_UINT32 vpi_mcd_open_x(char *name, char *mode);
extern PLI_INT32 vpi_mcd_printf(unsigned int mcd, const char*fmt, ...)
extern PLI_INT32 vpi_mcd_printf(PLI_UINT32 mcd, const char*fmt, ...)
__attribute__((format (printf,2,3)));
extern PLI_INT32 vpi_mcd_fputc(unsigned int mcd, unsigned char x);
extern PLI_INT32 vpi_mcd_fgetc(unsigned int mcd);

extern PLI_INT32 vpi_printf(const char*fmt, ...)
__attribute__((format (printf,1,2)));

extern PLI_INT32 vpi_vprintf(const char*fmt, va_list ap);
extern PLI_INT32 vpi_mcd_vprintf(PLI_UINT32 mcd, const char*fmt, va_list ap);

extern PLI_INT32 vpi_flush(void);
extern PLI_INT32 vpi_mcd_flush(PLI_UINT32 mcd);

extern PLI_UINT32 vpi_mcd_open_x(char *name, char *mode);
extern PLI_INT32 vpi_mcd_fputc(PLI_UINT32 mcd, unsigned char x);
extern PLI_INT32 vpi_mcd_fgetc(PLI_UINT32 mcd);

/*
* support for VPI callback functions.
Expand Down Expand Up @@ -388,6 +395,17 @@ EXTERN_C_END

/*
* $Log: vpi_user.h,v $
* Revision 1.25 2003/05/15 16:51:08 steve
* Arrange for mcd id=00_00_00_01 to go to stdout
* as well as a user specified log file, set log
* file to buffer lines.
*
* Add vpi_flush function, and clear up some cunfused
* return codes from other vpi functions.
*
* Adjust $display and vcd/lxt messages to use the
* standard output/log file.
*
* Revision 1.24 2003/04/20 02:49:07 steve
* acc_fetch_value support for %v format.
*
Expand Down
23 changes: 18 additions & 5 deletions vvp/main.cc
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: main.cc,v 1.35 2003/03/13 04:36:57 steve Exp $"
#ident "$Id: main.cc,v 1.36 2003/05/15 16:51:09 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -191,11 +191,13 @@ int main(int argc, char*argv[])
if (logfile_name) {
if (!strcmp(logfile_name, "-"))
logfile = stderr;
else
else {
logfile = fopen(logfile_name, "w");
if (!logfile) {
perror(logfile_name);
exit(1);
if (!logfile) {
perror(logfile_name);
exit(1);
}
setlinebuf(logfile);
}
}

Expand Down Expand Up @@ -285,6 +287,17 @@ int main(int argc, char*argv[])

/*
* $Log: main.cc,v $
* Revision 1.36 2003/05/15 16:51:09 steve
* Arrange for mcd id=00_00_00_01 to go to stdout
* as well as a user specified log file, set log
* file to buffer lines.
*
* Add vpi_flush function, and clear up some cunfused
* return codes from other vpi functions.
*
* Adjust $display and vcd/lxt messages to use the
* standard output/log file.
*
* Revision 1.35 2003/03/13 04:36:57 steve
* Remove the obsolete functor delete functions.
*
Expand Down

0 comments on commit 2e3ce49

Please sign in to comment.