aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-08-07 10:25:51 +0200
committerClifford Wolf <clifford@clifford.at>2019-08-07 10:25:51 +0200
commit338f6765ebeb6bd07197dbef8e22fa077bf2d043 (patch)
tree6ca9f290d6cdf974178baf31d003f9e6393a7078 /passes
parent100c377451f18503fd85112d62d11ebdb6ac9d5a (diff)
downloadyosys-338f6765ebeb6bd07197dbef8e22fa077bf2d043.tar.gz
yosys-338f6765ebeb6bd07197dbef8e22fa077bf2d043.tar.bz2
yosys-338f6765ebeb6bd07197dbef8e22fa077bf2d043.zip
Tweak default gate costs, cleanup "stat -tech cmos"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'passes')
-rw-r--r--passes/cmds/stat.cc22
1 files changed, 6 insertions, 16 deletions
diff --git a/passes/cmds/stat.cc b/passes/cmds/stat.cc
index 89920ed55..c8e4f3981 100644
--- a/passes/cmds/stat.cc
+++ b/passes/cmds/stat.cc
@@ -17,11 +17,10 @@
*
*/
-#include "kernel/register.h"
+#include "kernel/yosys.h"
#include "kernel/celltypes.h"
#include "passes/techmap/libparse.h"
-
-#include "kernel/log.h"
+#include "kernel/cost.h"
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
@@ -228,25 +227,16 @@ struct statdata_t
{
int tran_cnt = 0;
bool tran_cnt_exact = true;
+ auto &gate_costs = CellCosts::cmos_gate_cost();
for (auto it : num_cells_by_type) {
auto ctype = it.first;
auto cnum = it.second;
- if (ctype == "$_NOT_")
- tran_cnt += 2*cnum;
- else if (ctype.in("$_NAND_", "$_NOR_"))
- tran_cnt += 4*cnum;
- else if (ctype.in("$_AOI3_", "$_OAI3_"))
- tran_cnt += 6*cnum;
- else if (ctype.in("$_AOI4_", "$_OAI4_"))
- tran_cnt += 8*cnum;
- else if (ctype.in("$_NMUX_"))
- tran_cnt += 10*cnum;
- else if (ctype.in("$_MUX_", "$_XOR_", "$_XNOR_"))
- tran_cnt += 12*cnum;
+ if (gate_costs.count(ctype))
+ tran_cnt += cnum * gate_costs.at(ctype);
else if (ctype.in("$_DFF_P_", "$_DFF_N_"))
- tran_cnt += 16*cnum;
+ tran_cnt += cnum * 16;
else
tran_cnt_exact = false;
}