-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When user run 'Clean' simulation action, perform clean step for simul…
…ation only.
- Loading branch information
1 parent
653f3a3
commit 9a2fcc7
Showing
4 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
Copyright 2022 The Foedag team | ||
GPL License | ||
Copyright (c) 2022 The Open-Source FPGA Foundation | ||
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 3 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, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "Compiler/TaskManager.h" | ||
|
||
#include "Compiler/Compiler.h" | ||
#include "Compiler/CompilerDefines.h" | ||
#include "gtest/gtest.h" | ||
|
||
using namespace FOEDAG; | ||
|
||
TEST(TaskManager, getDownstreamCleanTasks) { | ||
TaskManager taskManager{nullptr}; | ||
|
||
taskManager.task(SIMULATE_RTL) | ||
->setCustomData({CustomDataType::Sim, | ||
QVariant::fromValue(Simulator::SimulationType::RTL)}); | ||
taskManager.task(SIMULATE_PNR) | ||
->setCustomData({CustomDataType::Sim, | ||
QVariant::fromValue(Simulator::SimulationType::PNR)}); | ||
taskManager.task(SIMULATE_GATE) | ||
->setCustomData({CustomDataType::Sim, | ||
QVariant::fromValue(Simulator::SimulationType::Gate)}); | ||
taskManager.task(SIMULATE_BITSTREAM) | ||
->setCustomData( | ||
{CustomDataType::Sim, | ||
QVariant::fromValue(Simulator::SimulationType::BitstreamBackDoor)}); | ||
|
||
auto simulationRtl = taskManager.task(SIMULATE_RTL_CLEAN); | ||
auto cleanTasks = taskManager.getDownstreamCleanTasks(simulationRtl); | ||
EXPECT_EQ(cleanTasks.count(), 1); | ||
EXPECT_EQ(cleanTasks.at(0), simulationRtl); | ||
|
||
auto simulationGate = taskManager.task(SIMULATE_GATE_CLEAN); | ||
cleanTasks = taskManager.getDownstreamCleanTasks(simulationGate); | ||
EXPECT_EQ(cleanTasks.count(), 1); | ||
EXPECT_EQ(cleanTasks.at(0), simulationGate); | ||
|
||
auto simulationPnr = taskManager.task(SIMULATE_PNR_CLEAN); | ||
cleanTasks = taskManager.getDownstreamCleanTasks(simulationPnr); | ||
EXPECT_EQ(cleanTasks.count(), 1); | ||
EXPECT_EQ(cleanTasks.at(0), simulationPnr); | ||
|
||
auto simulationBitstream = taskManager.task(SIMULATE_BITSTREAM_CLEAN); | ||
cleanTasks = taskManager.getDownstreamCleanTasks(simulationBitstream); | ||
EXPECT_EQ(cleanTasks.count(), 1); | ||
EXPECT_EQ(cleanTasks.at(0), simulationBitstream); | ||
|
||
auto analysis = taskManager.task(ANALYSIS_CLEAN); | ||
cleanTasks = taskManager.getDownstreamCleanTasks(analysis); | ||
EXPECT_EQ(cleanTasks.count(), 12); | ||
} |