From 82a4a87c97e8755e915bade43cf4f8010787ac42 Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 8 May 2024 20:28:37 +0000 Subject: [PATCH] Fixes error with vector indicies of the form [2:7] [-12:7] Make sure that we correctly adjust the value to align it to a zero indexed list with lsb = 0 Signed-off-by: Ethan Mahintorabi --- frontends/verific/verific.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index a18f9fc877b..b4b0664d341 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2164,7 +2164,7 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma // that the indicies match LSB = 0 order to match the std::vector // to SigSpec LSB = 0 precondition. if (lsb_index > msb_index) { - port_offset = abs(port_offset - lsb_index); + port_offset = abs(port_offset - (lsb_index - min(msb_index, lsb_index))); } } IdString port_name_id = RTLIL::escape_id(port_name);