A simple Java Swing application that estimates CPU power and energy for sequences of instructions using predefined CPU power profiles. It can generate a textual report (PowerReport.txt) and show a bar chart of power per instruction using JFreeChart.
- Interactive GUI to add instruction types and select CPU models.
- Generate and save a textual power/energy report (
PowerReport.txt). - Show a bar chart visualizing power per instruction using JFreeChart.
- Java JDK 8 or later installed and
javac/javaavailable on PATH. - The project includes required JFreeChart libraries in the
lib/folder:jfreechart-1.5.4.jarjcommon-1.0.24.jar
This project was verified on Windows. The provided run.bat builds and runs the application.
Open PowerShell or Command Prompt, navigate to the project folder and run the bundled script:
cd "c:\Users\PAARTH DUTTA\Downloads\PowerEstimatorProject\PowerEstimatorProject"
.\run.batWhat run.bat does:
- Changes directory to
src. - Compiles
PowerEstimatorFull.javawith the classpath set to include the jars inlib/. - Runs the
PowerEstimatorFullSwing application.
- Use the dropdowns to select an instruction type (arithmetic, logical, memory, control) and a CPU model (Basic CPU, High Performance CPU, Low Power CPU).
- Click "Add Instruction" for each instruction in your workload.
- Click "Generate Report" to compute totals and averages; this saves
PowerReport.txtto the project root (where the app was run). - Click "Show Graph" to open a chart window visualizing power per instruction for the selected CPU.
After generating a report, PowerReport.txt contains a summary similar to:
=== CPU Power Estimation Report ===
CPU Model: Basic CPU
Total Instructions: 1
Total Power: 5.00 mW
Average Power: 5.00 mW
Total Energy: 17.50 µJ
Average Energy: 17.50 µJ
src/PowerEstimatorFull.java— main Swing application and estimator logic.run.bat— convenience script to compile and run the app on Windows.lib/— third-party jars required by the project (JFreeChart and JCommon).PowerReport.txt— example output report generated by the app.
- If you move the project folder, update the paths in
run.bator run the compile/run commands manually fromsrc/with an adjusted classpath. - Consider adding a Gradle/Maven build or a cross-platform shell script for easier builds on non-Windows systems.
If you want, I can also add a small Gradle wrapper and build file to manage dependencies and run the app more reliably across platforms.