Flattening total current consumption of system having processing core and
power supply input by current sensing within system at power supply input
and controlling system current consumption such that system current is
reduced if over reference current threshold, and increased if below
reference current threshold. Inject additional current through digital
injections cells working higher frequencies, by increasing switching
activity, by increasing voltage supply to core, and by increasing
operating frequency of processor core. Feedback signal indicates current
consumption of system. Current consumption similarly decreased. Current
sensed by mirroring input current inline with power supply input and
compensating for voltage drop introduced by mirroring using opposing
field effect transistors and maintaining outputs at same voltage through
feedback control loop. Processor core may be general purpose processor
core or cryptographic processor core. System may be system-on-chip or
system-on-package. System includes processor core and current flattening
device based on method. Also, current flattening device and current
sensor. On chip current sensor sensing current draw of processor core.