Skip to content

Commit

Permalink
vvp: fail gracefully on multi-bit modpath delays (issue #1184)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinwhitaker committed Dec 31, 2024
1 parent 05d4e3f commit 84848e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vvp/delay.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2021 Stephen Williams <[email protected]>
* Copyright (c) 2005-2024 Stephen Williams <[email protected]>
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 84848e8

Please sign in to comment.