diff --git a/sparta/sparta/resources/Array.hpp b/sparta/sparta/resources/Array.hpp index 2c37cbe9e0..40452a0fc7 100644 --- a/sparta/sparta/resources/Array.hpp +++ b/sparta/sparta/resources/Array.hpp @@ -973,7 +973,7 @@ namespace sparta // to work as the underlying implementation structures of our array. array_.reset(static_cast(malloc(sizeof(ArrayPosition) * num_entries_))); - if(statset) + if((num_entries > 0) && statset) { utilization_.reset(new CycleHistogramStandalone(statset, clk, name + "_utilization", diff --git a/sparta/sparta/resources/Buffer.hpp b/sparta/sparta/resources/Buffer.hpp index 4a7be40129..f036609bff 100644 --- a/sparta/sparta/resources/Buffer.hpp +++ b/sparta/sparta/resources/Buffer.hpp @@ -1044,7 +1044,7 @@ namespace sparta num_entries_(num_entries), data_pool_size_(num_entries* 2) { - if(statset) + if((num_entries > 0) && statset) { utilization_.reset(new CycleHistogramStandalone(statset, clk_, name_ + "_utilization", diff --git a/sparta/sparta/resources/Queue.hpp b/sparta/sparta/resources/Queue.hpp index 88a6beb252..a88ef50bc2 100644 --- a/sparta/sparta/resources/Queue.hpp +++ b/sparta/sparta/resources/Queue.hpp @@ -451,7 +451,7 @@ namespace sparta collector_(nullptr) { - if(statset) + if((num_entries > 0) && statset) { utilization_.reset(new CycleHistogramStandalone(statset, clk, name + "_utilization",