From 84848e8e04162382439a574531aaa9b0aede446a Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 31 Dec 2024 16:59:23 +0000 Subject: [PATCH] vvp: fail gracefully on multi-bit modpath delays (issue #1184) The code doesn't currently handle the case of different bits within the vector needing different delays (e.g. when the rise and fall delays are different and some bits are rising as other bits are falling) and aborts with an assertion failure. For now, output a suitable "sorry" message and exit gracefully. --- vvp/delay.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vvp/delay.cc b/vvp/delay.cc index db243b9a82..aa47abd7d4 100644 --- a/vvp/delay.cc +++ b/vvp/delay.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2021 Stephen Williams + * Copyright (c) 2005-2024 Stephen Williams * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -664,7 +664,11 @@ void vvp_fun_modpath::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit, /* If the current and new bit values match then no delay * is needed for this bit. */ if (cur_vec4_.value(idx) == bit.value(idx)) continue; - assert(tmp == use_delay); + if (tmp != use_delay) { + fprintf(stderr, "sorry: multi-bit module path delays are " + "currently not fully supported.\n"); + exit(2); + } } cur_vec4_ = bit;