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 <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-01-08 09:59:34 +01:00
parent f705e7b61c
commit ea1bf7577a
1 changed files with 1 additions and 2 deletions

View File

@ -74,8 +74,7 @@ bool netenum_t::insert_name(size_t name_idx, perm_string name, const verinum&val
{
std::pair<std::map<perm_string,verinum>::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