mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-25 12:36:02 +00:00
Merge pull request #30 from alaindargelas/macro_power
Simulation information for macro power
This commit is contained in:
commit
7847b1b2eb
3 changed files with 8 additions and 1 deletions
|
@ -178,7 +178,7 @@ struct ActivityPropPass : public Pass {
|
|||
ActivityProp worker(module);
|
||||
totalNbBitsWithActivity += worker.getNbBitsWithActivity();
|
||||
}
|
||||
log("Collected %d bits with activity", totalNbBitsWithActivity);
|
||||
log("Collected %d bits with activity\n", totalNbBitsWithActivity);
|
||||
log_flush();
|
||||
}
|
||||
} ActivityPropPass;
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include "kernel/fmt.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
USING_YOSYS_NAMESPACE
|
||||
PRIVATE_NAMESPACE_BEGIN
|
||||
|
@ -2541,6 +2543,10 @@ struct AnnotateActivity : public OutputWriter {
|
|||
double clk_period = real_timescale * (double)max_time / (clktoggleCounts[0] / 2.0);
|
||||
double frequency = 1.0 / clk_period;
|
||||
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;
|
||||
ss << std::setprecision(4) << real_timescale;
|
||||
worker->top->module->set_string_attribute("$TIMESCALE", ss.str());
|
||||
if (debug) {
|
||||
std::cout << "Clock toggle count: " << clktoggleCounts[0] << "\n";
|
||||
std::cout << "Max time: " << max_time << "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue