From 200951275cde23fd03a8176a8f42ec566244aad8 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 28 Jan 2013 21:15:51 +0000 Subject: [PATCH] Fix logic value returned for unambiguous HiZ1 strength. If a strength aware net has an unambiguous HiZ1 strength, VVP treats it as a logic '1'. It should be treated as a logic 'z'. An ambiguous HiZ1/HiZ0 strength should also be treated as a logic 'z'. --- vvp/vvp_net.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index b46520158..4085c4d8c 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -682,7 +682,7 @@ class vvp_scalar_t { unsigned strength1() const; bool eeq(vvp_scalar_t that) const { return value_ == that.value_; } - bool is_hiz() const { return value_ == 0; } + bool is_hiz() const { return (value_ & 0x77) == 0; } private: unsigned char value_; @@ -718,7 +718,7 @@ inline vvp_scalar_t::vvp_scalar_t(vvp_bit4_t val, unsigned str0, unsigned str1) inline vvp_bit4_t vvp_scalar_t::value() const { - if (value_ == 0) { + if ((value_ & 0x77) == 0) { return BIT4_Z; } else switch (value_ & 0x88) { case 0x00: