From 682e54841cf1f0346743c14100236ae840a7146e Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 2 Apr 2009 17:51:36 -0700 Subject: [PATCH] Add support for getting the size of a real array word. This patch adds code to get the size of a real array word. We currently define the size if a real to be 1. (cherry picked from commit 337c9e7577519707e21cb9834fd7560c77b2eb5f) --- vvp/array.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vvp/array.cc b/vvp/array.cc index 020e1a28a..4bac1fe3c 100644 --- a/vvp/array.cc +++ b/vvp/array.cc @@ -462,13 +462,20 @@ static int vpi_array_var_word_get(int code, vpiHandle ref) assert(obj); decode_array_word_pointer(obj, parent); + assert(parent->nets == 0); switch (code) { case vpiLineNo: return 0; // Not implemented for now! case vpiSize: - return (int) parent->vals4->width(); + if (parent->vals4) { + assert(parent->valsr == 0); + return (int) parent->vals4->width(); + } else { + assert(parent->vals4 == 0); + return 1; + } case vpiLeftRange: return parent->msb.value;