summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index cb8c5f1..f6dea25 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -529,8 +529,16 @@ fn pick_chip_by_logic<'input>(
if let Some(chip) = series.logic_to_chip.get(&(gate, inputs)) {
Some(*chip)
} else {
- // todo!()
- None
+ // Returning first larger by size
+ // NOTE: this is not the optimal solution, but for my case it is the best (delay is lowest
+ // possible)
+ let larger_gate = series
+ .logic_to_chip
+ .keys()
+ .filter(|&&(g, i)| g == gate && i > inputs)
+ .sorted()
+ .next();
+ larger_gate.map(|conf| series.logic_to_chip[conf])
}
}