From df0cfc5b35835c4255450ebc0c2bea086e0cd784 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 9 May 2024 15:26:42 +0200 Subject: [PATCH] Fix breakdown model forbidden value 0 error When a event causes a new value in the sort module, the first time it will write all output values, which most of them will be zero. Writting a zero value is forbidden by default, so we relax the constraint with the PRV_ZERO flag. --- CHANGELOG.md | 5 +++++ src/emu/nanos6/breakdown.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbdc70d..1b36b94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix breakdown model error that was preventing a zero value to be written in + the PRV trace. + ## [1.9.0] - 2024-04-25 ### Added diff --git a/src/emu/nanos6/breakdown.c b/src/emu/nanos6/breakdown.c index 6d63da6..953f3a1 100644 --- a/src/emu/nanos6/breakdown.c +++ b/src/emu/nanos6/breakdown.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) +/* Copyright (c) 2023-2024 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ #include "breakdown.h" @@ -239,6 +239,11 @@ model_nanos6_breakdown_connect(struct emu *emu) long type = PRV_NANOS6_BREAKDOWN; long flags = PRV_SKIPDUP; + /* We may emit zero at the start, when an input changes and all + * the other sort output channels write a zero in the output, + * before the last value is set in prv.c. */ + flags |= PRV_ZERO; + struct chan *out = sort_get_output(&bemu->sort, i); if (prv_register(prv, i, type, bay, out, flags)) { err("prv_register failed");