Skip to content

Commit bf120e8

Browse files
authored
Add total cell count to report (#146)
1 parent d5a5f66 commit bf120e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/asic.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ impl Analysis<CellLang> for CellAnalysis {
218218
struct CircuitStats {
219219
/// AST size of the circuit
220220
ast_size: usize,
221+
// The total cell count
222+
cell_count: usize,
221223
/// Number of cells in the circuit
222224
cell_counts: BTreeMap<String, usize>,
223225
/// The area of the circuit
@@ -253,9 +255,12 @@ impl CircuitStats {
253255
}
254256

255257
fn new(expr: &RecExpr<CellLang>) -> Self {
258+
let cell_counts = Self::get_cell_counts(expr);
259+
let cell_count = cell_counts.values().sum();
256260
Self {
257261
ast_size: expr.len(),
258-
cell_counts: Self::get_cell_counts(expr),
262+
cell_count,
263+
cell_counts,
259264
area: Self::get_area(expr),
260265
}
261266
}

0 commit comments

Comments
 (0)