From f752007e9c0541fd0fab64fdc65b91fd0c3fdd3c Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sun, 6 Apr 2014 15:54:05 -0700 Subject: [PATCH] Add some minor VPI/ACC fixes and updates These were submitted. --- libveriuser/a_configure.c | 6 +++++- libveriuser/a_fetch_type_str.c | 8 ++++++++ libveriuser/a_vcl.c | 1 + vpi_user.h | 2 ++ vvp/vpi_signal.cc | 5 +++++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libveriuser/a_configure.c b/libveriuser/a_configure.c index c6d242e5d..cd79ca1e5 100644 --- a/libveriuser/a_configure.c +++ b/libveriuser/a_configure.c @@ -69,9 +69,13 @@ int acc_configure(PLI_INT32 config_param, const char*value) fprintf(pli_trace, "acc_configure(config=%d, %s)\n", (int)config_param, value); } - +#if 0 vpi_printf("XXXX acc_configure(%d, %s)\n", (int)config_param, value); +#else + /* Parameter is not necessarily a string. */ + vpi_printf("XXXX acc_configure(%d, ...)\n", (int)config_param); +#endif rc = 0; break; } diff --git a/libveriuser/a_fetch_type_str.c b/libveriuser/a_fetch_type_str.c index e8cefae4d..5250f1384 100644 --- a/libveriuser/a_fetch_type_str.c +++ b/libveriuser/a_fetch_type_str.c @@ -40,3 +40,11 @@ const char* acc_fetch_type_str(PLI_INT32 type) vpi_printf("acc_fetch_type_str: type %d is what accType?\n", (int)type); return "acc_fetch_type_str(unknown)"; } + +/* + * FIXME: What does this do? How should it be declared in acc_user.h? + */ +PLI_INT32 acc_fetch_paramtype(PLI_INT32 type) +{ + return 0; +} diff --git a/libveriuser/a_vcl.c b/libveriuser/a_vcl.c index e4f4d7725..e7bec8b93 100644 --- a/libveriuser/a_vcl.c +++ b/libveriuser/a_vcl.c @@ -162,6 +162,7 @@ void acc_vcl_add(handle obj, PLI_INT32(*consumer)(p_vc_record), switch (vpi_get(vpiType, obj)) { case vpiNet: + case vpiReg: cur = malloc(sizeof (struct vcl_record)); cur->obj = obj; cur->consumer = consumer; diff --git a/vpi_user.h b/vpi_user.h index 4b17ae2f0..6b80c31c7 100644 --- a/vpi_user.h +++ b/vpi_user.h @@ -334,6 +334,8 @@ typedef struct t_vpi_delay { #define vpiTimePrecision 12 #define vpiDefFile 15 #define vpiDefLineNo 16 +#define vpiScalar 17 +#define vpiVector 18 #define vpiDirection 20 /* direction of port: */ # define vpiInput 1 diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index 30fc9f11d..edd39adf9 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -567,6 +567,11 @@ static int signal_get(int code, vpiHandle ref) case vpiRightRange: return rfp->lsb; + case vpiScalar: + return (rfp->msb == 0 && rfp->lsb == 0); + case vpiVector: + return (rfp->msb != rfp->lsb); + case vpiAutomatic: return (int) vpip_scope(rfp)->is_automatic;