From 88816e390eef28f2c2c78958ff752daf3c2f73f8 Mon Sep 17 00:00:00 2001 From: Neil Deo Date: Thu, 7 Aug 2025 18:07:15 -0700 Subject: [PATCH] add clockgate to makefile, add Density to sim pass --- Makefile | 1 + passes/sat/sim.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Makefile b/Makefile index b15ce9d02..3460fe086 100644 --- a/Makefile +++ b/Makefile @@ -755,6 +755,7 @@ OBJS += passes/techmap/demuxmap.o OBJS += passes/techmap/muxcover.o OBJS += passes/techmap/aigmap.o OBJS += passes/techmap/attrmap.o +OBJS += passes/techmap/clockgate.o include $(YOSYS_SRC)/passes/hierarchy/Makefile.inc include $(YOSYS_SRC)/passes/memory/Makefile.inc diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index 355a0051b..9d1af647d 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -2524,6 +2524,8 @@ struct AnnotateActivity : public OutputWriter { std::vector &clktoggleCounts = itr->second.toggleCounts; double clk_period = real_timescale * (double)max_time / (clktoggleCounts[0] / 2.0); double frequency = 1.0 / clk_period; + double density = clktoggleCounts[0] / (real_timescale * (double)max_time); + worker->top->module->set_string_attribute("$DENSITY", std::to_string(density)); worker->top->module->set_string_attribute("$FREQUENCY", std::to_string(frequency)); worker->top->module->set_string_attribute("$DURATION", std::to_string(max_time)); std::stringstream ss;