From ea1bf7577a70d41d09e11a9e85e43b1cf170d55e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 8 Jan 2022 09:59:34 +0100 Subject: [PATCH] Allow lsb > msb for enum base type Having an enum with a lsb > msb base type, e.g. `enum logic [0:9]` is a legal construct. It is handled correctly for the most part already, there is just an assert that triggers on it. Remove that assert. Signed-off-by: Lars-Peter Clausen --- netenum.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/netenum.cc b/netenum.cc index 0ec7ca33d..802a7f446 100644 --- a/netenum.cc +++ b/netenum.cc @@ -74,8 +74,7 @@ bool netenum_t::insert_name(size_t name_idx, perm_string name, const verinum&val { std::pair::iterator, bool> res; - assert((msb_-lsb_+1) > 0); - assert(val.has_len() && val.len() == (unsigned)(msb_-lsb_+1)); + assert(val.has_len() && val.len() == packed_width()); // Insert a map of the name to the value. This also gets a // flag that returns true if the name is unique, or false