Skip to content

Commit 9f51f5a

Browse files
committed
2 parents 83d742b + e443ee1 commit 9f51f5a

File tree

17 files changed

+365
-257
lines changed

17 files changed

+365
-257
lines changed

src/backend/container/block/blockDefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ enum BlockType : std::uint16_t {
3333
CUSTOM, // placeholder for custom blocks in parsed circuit
3434
};
3535

36-
inline std::string blocktype_to_string(const BlockType blockType) {
36+
inline std::string blocktype_to_string(const BlockType blockType) /* GCOVR_EXCL_FUNCTION */ {
3737
switch (blockType) {
3838
case BlockType::NONE: return "NONE";
3939
case BlockType::AND: return "AND";
@@ -64,7 +64,7 @@ inline std::string blocktype_to_string(const BlockType blockType) {
6464

6565
template <>
6666
struct fmt::formatter<BlockType> : fmt::formatter<std::string> {
67-
auto format(BlockType blockType, format_context& ctx) const { return formatter<std::string>::format(blocktype_to_string(blockType), ctx); }
67+
auto format(BlockType blockType, format_context& ctx) const /* GCOVR_EXCL_FUNCTION */ { return formatter<std::string>::format(blocktype_to_string(blockType), ctx); }
6868
};
6969

7070
#endif /* blockDefs_h */

src/backend/evaluator/evaluator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,9 @@ nlohmann::json Evaluator::dumpState() const /* GCOVR_EXCL_FUNCTION */ {
16131613
stateJson["circuitNodeToBlockTypeMap"][circuitNode.toString()] = blocktype_to_string(blockType);
16141614
}
16151615

1616-
1617-
16181616
return stateJson;
16191617
}
1618+
1619+
void Evaluator::resetStates() {
1620+
evalSimulator->resetStates();
1621+
}

src/backend/evaluator/evaluator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Evaluator {
8888
inline evaluator_id_t getEvaluatorId() const { return evaluatorId; }
8989
std::string getEvaluatorName() const;
9090

91-
void reset();
91+
void resetStates();
9292
void setPause(bool pause) { evalConfig.setRunning(!pause); }
9393
bool isPause() const { return !evalConfig.isRunning(); }
9494
void addSprint(unsigned int nTicks) { evalConfig.addSprint(nTicks); }

src/backend/evaluator/layers/layer2_evalSimulator.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ class EvalSimulator {
1313
BlockDataManager& blockDataManager
1414
) :
1515
gateSubstituter(evalConfig, middleIdProvider, dirtySimulatorIds, dirtyMiddleIds, blockDataManager) {}
16+
inline void resetStates() {
17+
gateSubstituter.resetStates();
18+
}
1619
inline SimPauseGuard beginEdit() {
1720
return gateSubstituter.beginEdit();
1821
}

src/backend/evaluator/layers/layer3_gateSubstituter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ class GateSubstituter {
113113
middleIdProvider(middleIdProvider),
114114
blockDataManager(blockDataManager) {}
115115

116+
void resetStates() { replacer.resetStates(); }
117+
116118
void addGate(SimPauseGuard& pauseGuard, const BlockType blockType, const middle_id_t gateId) {
117119
#ifdef TRACY_PROFILER
118120
ZoneScoped;

src/backend/evaluator/layers/layer4_replacer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class Replacer {
2424
middleIdProvider(middleIdProvider),
2525
blockDataManager(blockDataManager) {}
2626

27+
void resetStates() { busInterfacePassthrough.resetStates(); }
28+
2729
void addGate(SimPauseGuard& pauseGuard, const BlockType blockType, const middle_id_t gateId) {
2830
#ifdef TRACY_PROFILER
2931
ZoneScoped;

0 commit comments

Comments
 (0)