Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

CPU Power Consumption Estimator

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.

Features

  • 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.

Prerequisites

  • Java JDK 8 or later installed and javac/java available on PATH.
  • The project includes required JFreeChart libraries in the lib/ folder:
    • jfreechart-1.5.4.jar
    • jcommon-1.0.24.jar

This project was verified on Windows. The provided run.bat builds and runs the application.

Quick start (Windows)

Open PowerShell or Command Prompt, navigate to the project folder and run the bundled script:

cd "c:\Users\PAARTH DUTTA\Downloads\PowerEstimatorProject\PowerEstimatorProject"
.\run.bat

What run.bat does:

  • Changes directory to src.
  • Compiles PowerEstimatorFull.java with the classpath set to include the jars in lib/.
  • Runs the PowerEstimatorFull Swing application.

How to use the app

  1. Use the dropdowns to select an instruction type (arithmetic, logical, memory, control) and a CPU model (Basic CPU, High Performance CPU, Low Power CPU).
  2. Click "Add Instruction" for each instruction in your workload.
  3. Click "Generate Report" to compute totals and averages; this saves PowerReport.txt to the project root (where the app was run).
  4. Click "Show Graph" to open a chart window visualizing power per instruction for the selected CPU.

Expected output

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

Files

  • 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.

Notes & Next steps

  • If you move the project folder, update the paths in run.bat or run the compile/run commands manually from src/ 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages