Skip to content

Commit 0f580f4

Browse files
committed
Ergonomy improvements
1 parent 7a01e1d commit 0f580f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cmd_logic_locking.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ std::vector<Cell *> optimize_output_corruption(LogicLockingAnalyzer &pw, int max
6363
float cover = 100.0 * opt.corruptibility(sol);
6464
float rate = 100.0 * opt.corruptionSum(sol);
6565

66-
log("Locking solution with %d locked wires, %.1f%% estimated corruptibility and %.1f%% summed corruption.\n", (int)sol.size(), cover, rate);
66+
log("Locking solution with %d locked wires, %.1f%% estimated corruptibility and %.1f%% secondary objective.\n", (int)sol.size(), cover, rate);
6767

6868
std::vector<Cell *> ret;
6969
for (int c : sol) {
@@ -94,7 +94,7 @@ std::vector<Cell *> optimize_hybrid(LogicLockingAnalyzer &pw, int maxNumber)
9494
float cover = 100.0 * corr.corruptibility(sol);
9595
float rate = 100.0 * corr.corruptionSum(sol);
9696

97-
log("Locking solution with %d locked wires, largest clique of size %d, %.1f%% corruption cover and %.1f%% corruption rate.\n",
97+
log("Locking solution with %d locked wires, largest clique of size %d, %.1f%% estimated corruptibility and %.1f%% secondary objective.\n",
9898
(int)sol.size(), (int)largestClique.size(), cover, rate);
9999

100100
std::vector<Cell *> ret;
@@ -348,6 +348,9 @@ struct LogicLockingPass : public Pass {
348348
log("Running logic locking with %d test vectors, locking %d cells out of %d, key %s.\n", nb_test_vectors, nb_locked,
349349
GetSize(mod->cells_), key_check.c_str());
350350
auto locked_gates = run_logic_locking(mod, nb_test_vectors, nb_locked, target);
351+
if (GetSize(locked_gates) < nb_locked) {
352+
log_warning("Could not lock the requested number of gates. Only %d gates were locked.\n", GetSize(locked_gates));
353+
}
351354
report_locking(mod, locked_gates, nb_analysis_keys, nb_analysis_vectors);
352355
nb_locked = locked_gates.size();
353356
RTLIL::Wire *w = add_key_input(mod, nb_locked, port_name);

0 commit comments

Comments
 (0)