Skip to content

Commit

Permalink
Bugfix in library parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaimueller committed Oct 31, 2024
1 parent ec3ba44 commit 0173c2f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Hardware/Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,20 @@ void Cell::SetType(const boost::json::value& value, bool is_relaxed) {
}

void Cell::SetOperations(const std::vector<std::string>& expressions) {
std::vector<std::string> primary_signals;
predefined_functions_found_ = false;

for (const std::string& expression : expressions) {
for (const std::vector<std::string>& input_port : inputs_) {
primary_signals.insert(primary_signals.end(), input_port.begin(), input_port.end());
}
std::vector<std::string> primary_signals;
for (const std::vector<std::string>& input_port : inputs_) {
primary_signals.insert(primary_signals.end(), input_port.begin(), input_port.end());
}

if (type_ == CellType::sequential_gate) {
for (const std::vector<std::string>& output_port : outputs_) {
primary_signals.insert(primary_signals.end(), output_port.begin(), output_port.end());
}
if (type_ == CellType::sequential_gate) {
for (const std::vector<std::string>& output_port : outputs_) {
primary_signals.insert(primary_signals.end(), output_port.begin(), output_port.end());
}
}

for (const std::string& expression : expressions) {
operations_.emplace_back(Operation<CustomOperation>(expression, primary_signals));

if (type_ == CellType::relaxed_gate) {
Expand Down Expand Up @@ -485,4 +485,4 @@ uint64_t Library::Evaluate(uint64_t cell_index, uint64_t output_index, std::vect
return cells_[cell_index].Evaluate(output_index, input_values);
}

} // namespace Hardware
} // namespace Hardware

0 comments on commit 0173c2f

Please sign in to comment.