final fixes

This commit is contained in:
Fabian Posch 2025-01-30 23:57:27 +01:00
parent 25b4684669
commit e51064771b
7 changed files with 24 additions and 53 deletions

View file

@ -40,7 +40,11 @@ class DBSimArtifact : public db::DBArtifact {
const db::uuid_t& design,
const db::uuid_t& reference,
const db::uuid_t& source_config
);
) : DBArtifact(id, source_pass, target_artifact) {
this->design_ = design;
this->reference_ = reference;
this->source_config_ = source_config;
};
/**
* @brief The UUID of the design this simulation uses

View file

@ -242,7 +242,7 @@ class SimConfigArtifact: public Artifact {
private:
bool has_reference_;
bool has_reference_ = false;
std::vector<testcase_t> testcases;
};

View file

@ -1,39 +0,0 @@
/*************************************************************************
*
* This file is part of the ACT library
*
* Copyright (c) 2024 Fabian Posch
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
**************************************************************************
*/
#include "agent_artifact.hpp"
DBSimArtifact::DBSimArtifact(
const db::uuid_t& id,
const db::uuid_t& source_pass,
const db::uuid_t& target_artifact,
const db::uuid_t& design,
const db::uuid_t& reference,
const db::uuid_t& source_config
) : DBArtifact(id, source_pass, target_artifact) {
this->design_ = design;
this->reference_ = reference;
this->source_config_ = source_config;
}

View file

@ -133,9 +133,9 @@ bool Downloader::fetch_tasks(size_t n) {
" sc.has_reference AS reference, "
" so.id AS id "
"FROM "
" actsim_passes ap "
" sim_configs sc "
"JOIN "
" sim_configs sc ON ap.sim_configs = sc.artifact "
" actsim_passes ap ON ap.sim_configs = sc.artifact "
"LEFT JOIN "
" sim_outputs so ON sc.id = so.sim_config "
"JOIN "
@ -193,6 +193,7 @@ bool Downloader::fetch_tasks(size_t n) {
auto design = row["design"].as<db::uuid_t>();
db::uuid_t reference;
reference = 0;
if (!row["reference"].is_null()) {
reference = row["reference"].as<db::uuid_t>();
@ -417,11 +418,6 @@ std::shared_ptr<pl::SimOutputArtifact> Downloader::fetch_reference_run(const db:
return nullptr;
}
std::cout << "Output tokens:" << std::endl;
for (auto&& token: output_token_timings) {
std::cout << token << std::endl;
}
auto reference = std::make_shared<pl::SimOutputArtifact>();
reference->set_output_token_timings(output_token_timings);
reference->set_output_tokens(output_tokens);

View file

@ -23,6 +23,7 @@
**************************************************************************
*/
#include <iostream>
#include <regex>
#include "util.h"
#include "log_parser.hpp"
@ -63,7 +64,7 @@ void LogParser::parse_log(const std::string& line) {
}
void LogParser::parse_error(const std::string& line) {
void LogParser::parse_error([[maybe_unused]]const std::string& line) {
// DEBUG_PRINT("Parsing error line " + line);
@ -245,7 +246,7 @@ inline void LogParser::check_glitch(const std::string& line) {
// simply check if the standard glitch output is given
const std::string glitch_detected = "Glitch detected in channel";
const std::string glitch_detected = "WARNING: weak-interference on";
if (line.find(glitch_detected) != std::string::npos) {
artifact->set_fault_glitch(true);

View file

@ -141,7 +141,7 @@ bool Uploader::upload_task(std::unique_ptr<OutputType> task) {
](
pqxx::work *txn
) {
txn->exec_params0(
txn->exec(
"UPDATE sim_outputs SET "
" sim_log = $1, "
" error_log = $2, "
@ -151,13 +151,13 @@ bool Uploader::upload_task(std::unique_ptr<OutputType> task) {
" log_size = $6, "
" part_status = 'finished' "
"WHERE id = $7 AND part_status != 'halted';",
sim_log,
{sim_log,
sim_error,
output_tokens,
output_token_timings,
fault_flags,
log_size,
task_id
task_id}
);
};

View file

@ -29,6 +29,7 @@
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <errno.h>
#include <cstdlib>
#include "util.h"
@ -138,6 +139,7 @@ std::unique_ptr<OutputType> Worker::perform_task(std::unique_ptr<InputType>& tas
// execv expects mutable char*, so we have to copy our stuff first
auto design = this->interface.get_design(task->design);
design = "testbench.act";
char *design_char = new char[design.length()+1];
std::strcpy(design_char, design.c_str());
@ -499,6 +501,13 @@ std::unique_ptr<OutputType> Worker::perform_task(std::unique_ptr<InputType>& tas
// check if the process has ended ie. all pipes closed
if (stdout_closed && stderr_closed) {
finished = true;
int exit_code;
waitpid(pid, &exit_code, 0);
if (exit_code != 0) {
std::cerr << "SIMULATION EXITED ABNORMALLY!" << std::endl;
}
break;
}