3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-02 12:21:23 +00:00

Merge pull request #30 from alaindargelas/macro_power

Simulation information for macro power
This commit is contained in:
Akash Levy 2024-12-04 10:01:04 -08:00 committed by GitHub
commit 7847b1b2eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -3546,6 +3546,7 @@ struct VerificPass : public Pass {
// RuntimeFlags::SetVar("veri_break_loops", 0); // SILIMATE: add to avoid breaking loops
RuntimeFlags::SetVar("veri_optimize_wide_selector", 1); // SILIMATE: add to optimize wide selector
RuntimeFlags::SetVar("veri_ignore_assertion_statements", 1); // SILIMATE: add to ignore SVA/asserts
RuntimeFlags::SetVar("verilog_ignore_unnecessary_modules_in_v_files", 1); // SILIMATE: add to ignore unnecessary modules
#endif
#ifdef VERIFIC_VHDL_SUPPORT
RuntimeFlags::SetVar("vhdl_extract_dualport_rams", 0);

View file

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

View file

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