3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-18 13:15:46 +00:00

Merge pull request #84 from neildeo05/sim_and_clockgate

add clockgate to makefile, add Density to sim pass
This commit is contained in:
Akash Levy 2025-08-08 11:08:41 -07:00 committed by GitHub
commit 0354098c08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -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

View file

@ -2524,6 +2524,8 @@ struct AnnotateActivity : public OutputWriter {
std::vector<double_t> &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;