[Power] Refine power estimation flow and add power evaluation flow #718
[Power] Refine power estimation flow and add power evaluation flow #718qianxu1998 wants to merge 24 commits intoEPFL-LAP:mainfrom
Conversation
…cripts to 'power'
…able with xsim in Vivado
…_PERIOD in the generated testbench to fix the timing issue in timing simulation. Add initial implementation for power-eval flow as well
| set SAIF_OUT %saif_pre | ||
|
|
||
| # ============================================================= | ||
| # 1. Create an in-memory project |
There was a problem hiding this comment.
in-memory? comment outdated, or something I don't understand?
| ] | ||
|
|
||
| # Constraints (not required for behavioral sim, but harmless if you want periods/IO constraints loaded) | ||
| if {[file exists $XDC_FILE]} { |
There was a problem hiding this comment.
should we throw an error if the xdc file doesnt exist? the dict structure enforces that we pass an xdc file right? so if we have a typo in the name, should we tell the user?
| add_files -fileset sim_1 [list \ | ||
| %{sim_sources} | ||
| ] | ||
| set_property top $TB_TOP [get_filesets sim_1] |
There was a problem hiding this comment.
dumb q from me: set_property applies separately to sources_1 and sim_1? we are not overriding the previous set_top from line 43?
maybe a comment would help for someone learning about power estimation from this script
| # | ||
| # Get all the simulation hdl input files | ||
| # As a list of imports for the simulation.do | ||
| sim_hdl_inputs = [ |
There was a problem hiding this comment.
maybe a comment about what the vhdl files we want are when hdl is verilog?
| sim_inputs = "\n".join(sim_inputs) | ||
|
|
||
| # Get all the input VHDl files | ||
| if hdl != "verilog": |
There was a problem hiding this comment.
mild recommendation:
if hdl == "verilog":
elseif hdl == "vhdl":
else
throw error
had a lot of bugs in my code from stuff like this from python
| for f in sorted(os.listdir(vhdl_src_folder)) | ||
| if f.endswith(".vhd") | ||
| ) | ||
| if hdl == "verilog": |
There was a problem hiding this comment.
same mild recc here of error on unrecognized hdl
| # Normalize HDL selection | ||
| # For now, verilog-beta is treated as verilog | ||
| hdl = _normalize_hdl(hdl) |
There was a problem hiding this comment.
add print or throw error? seem risky to do quietly
Summary
tools/dynamatic/power, add Verilog support, stage selection (pre/post), and optional post-synthesis netlist generation for higher-accuracy SAIF generation.Script details
tools/dynamatic/power/estimate_power.py--output_dir,--kernel_name,--hdl (vhdl|verilog),--synth (pre|post),--cp,--vivado_cmdperiod.xdc, Modelsim.do, optional pre-synth via Vivado, thenreport_power.tclusing SAIF from simulation.tools/dynamatic/power/power_eval.py--output_dir,--kernel_name,--hdl (verilog|verilog-beta|vhdl),--stage (synth|impl),--flatten_hierarchy,--cp,--vivado_cmd,--no-runpower_extraction.tclto run XSim, dump SAIF/VCD, and generate power reports; runs Vivado unless--no-runis set.Usage (Dynamatic Frontend)