From 87aabba22b0b4ee306abf8c48c616b969e70fa0a Mon Sep 17 00:00:00 2001 From: Fabian Posch Date: Fri, 3 Jan 2025 12:47:02 +0100 Subject: [PATCH] add failure modes to sim output artifact --- include/artifact.hpp | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/include/artifact.hpp b/include/artifact.hpp index b60b062..3e51842 100644 --- a/include/artifact.hpp +++ b/include/artifact.hpp @@ -29,7 +29,6 @@ #include #include #include -#include "util.h" namespace pl { @@ -160,7 +159,7 @@ class ActArtifact: public Artifact { * * @return long */ - long get_size() { return 1; }; + long get_size() override { return 1; }; private: @@ -219,7 +218,7 @@ class SimConfigArtifact: public Artifact { * * @return long The size of the testcase vector */ - long get_size() { return testcases.size(); }; + long get_size() override { return testcases.size(); }; const bool& has_reference = has_reference_; @@ -284,7 +283,7 @@ class SignalListArtifact: public Artifact { * * @return long The size of the signals vector */ - long get_size() { return signals.size(); }; + long get_size() override { return signals.size(); }; private: @@ -337,12 +336,38 @@ class SimOutputArtifact: public Artifact { * * @return long The size of the log lines vector */ - long get_size() { return sim_log.size(); }; + long get_size() override { return sim_log.size(); }; + + const bool& fault_timing_deviation = fault_timing_deviation_; + const bool& fault_value = fault_value_; + const bool& fault_coding = fault_coding_; + const bool& fault_glitch = fault_glitch_; + const bool& fault_deadlock = fault_deadlock_; + const bool& fault_token_count = fault_token_count_; + + const int& output_tokens = output_tokens_; + + inline void set_fault_timing_deviation (bool fault_timing_deviation) { this->fault_timing_deviation_ = fault_timing_deviation; }; + inline void set_fault_value (bool fault_value) { this->fault_value_ = fault_value; }; + inline void set_fault_coding (bool fault_coding) { this->fault_coding_ = fault_coding; }; + inline void set_fault_glitch (bool fault_glitch) { this->fault_glitch_ = fault_glitch; }; + inline void set_fault_deadlock (bool fault_deadlock) { this->fault_deadlock_ = fault_deadlock; }; + inline void set_fault_token_count (bool fault_token_count) { this->fault_token_count_ = fault_token_count; }; + + inline void set_output_tokens(int output_tokens) { this->output_tokens_ = output_tokens; }; private: std::vector sim_log; std::vector sim_err_log; + bool fault_timing_deviation_ = false; + bool fault_value_ = false; + bool fault_coding_ = false; + bool fault_glitch_ = false; + bool fault_deadlock_ = false; + bool fault_token_count_ = false; + + int output_tokens_; }; };