Skip to content

Commit

Permalink
cost, test_cell: comment cost model status
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed May 27, 2024
1 parent fefc24b commit d944f19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions kernel/cost.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ struct CellCosts
}

// Get the cell cost for a cell based on its parameters.
// This cost is an upper bound for the number of gates the cell will
// get mapped to with "opt -fast; techmap"
// This cost is an *approximate* upper bound for the number of gates that
// the cell will get mapped to with "opt -fast; techmap"
// The intended usage is for flattening heuristics and similar situations
unsigned int get(RTLIL::Cell *cell);
// Sum up the cell costs of all cells in the module
// and all its submodules recursively
Expand Down
10 changes: 6 additions & 4 deletions passes/tests/test_cell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ struct TestCellPass : public Pass {
log(" -bloat {factor}\n");
log(" increase cell size limits b{factor} times where possible\n");
log(" -check_cost\n");
log(" check the estimated cell cost is a valid upper bound for the techmapped\n");
log(" cell count \n");
log(" check if the estimated cell cost is a valid upper bound for\n");
log(" the techmapped cell count \n");
log("\n");
}
void execute(std::vector<std::string> args, RTLIL::Design*) override
Expand Down Expand Up @@ -1063,8 +1063,10 @@ struct TestCellPass : public Pass {
delete design;
}
if (check_cost && failed) {
log_warning("Cell type %s failed in %.1f%% cases with worst offender being by %d (%.1f%%)\n", cell_type.c_str(),
100 * (float)failed / (float)num_iter, worst_abs, 100 * worst_rel);
log_warning("Cell type %s cost underestimated in %.1f%% cases "
"with worst offender being by %d (%.1f%%)\n",
cell_type.c_str(), 100 * (float)failed / (float)num_iter,
worst_abs, 100 * worst_rel);
}
}
if (vlog_file.is_open()) {
Expand Down

0 comments on commit d944f19

Please sign in to comment.