Offline Compression for On-Chip RAM Nathan Cooprider and John Regehr University of Utah

Microcontrollers (MCUs) ●

10 billion units / year



$12.5 billion market in 2006



Products with embedded computing are usually… − −



Low cost, high volume Very sensitive to unit cost

Bottom line: Pressure to use cheap MCUs

On-Chip RAM is Small ●

Kilobytes, not megabytes or gigabytes



Atmel AVR (8-bit RISC) examples − − −



mega48 – 0.5 KB RAM – $1.50 mega128 – 4 KB RAM – $8.75 mega256 – 8 KB RAM – $10.66

SRAM can dominate power consumption of a sleeping chip

Out of RAM – What Next? ●

Remove application features?



Buy MCUs with more RAM?



Manually reduce RAM usage?

Out of RAM – What Next? ●

Remove application features?



Buy MCUs with more RAM?



Manually reduce RAM usage?

Out of RAM – What Next? ●

Remove application features?



Buy MCUs with more RAM?



Manually reduce RAM usage?

Out of RAM – What Next? ●

Remove application features?



Buy MCUs with more RAM?



Manually reduce RAM usage?

A Closer Look ●

Is RAM used efficiently? −

Performed value profiling for embedded apps ●

− ●

Apps already heavily tuned for RAM usage

Result: Average byte stores four values!

MCUs are Harvard architecture − − −

Data in SRAM – 6 transistors / bit Code in Flash “ROM” – 1 transistor / bit 4-32x more ROM than RAM

RAM Compression ●

Automated sub-word packing for statically allocated scalars, pointers, structs, arrays −



Driven by whole-program dataflow analysis −



No heap on most MCUs

Sound for interrupt-driven concurrency

Compression level can be tuned

Method x ≝ variable that occupies n bits

Method x ≝ variable that occupies n bits Vx ≝ conservative estimate of value set

Method x ≝ variable that occupies n bits Vx ≝ conservative estimate of value set

log2|Vx| < n ⇒ RAM compression possible

Method x ≝ variable that occupies n bits Vx ≝ conservative estimate of value set

log2|Vx| < n ⇒ RAM compression possible Cx ≝ another set such that |Cx| = |Vx|

Method x ≝ variable that occupies n bits Vx ≝ conservative estimate of value set

log2|Vx| < n ⇒ RAM compression possible Cx ≝ another set such that |Cx| = |Vx| fx ≝ bijection from Vx to Cx

Method x ≝ variable that occupies n bits Vx ≝ conservative estimate of value set

log2|Vx| < n ⇒ RAM compression possible Cx ≝ another set such that |Cx| = |Vx| fx ≝ bijection from Vx to Cx n - log2|Cx| ⇒ bits saved through compression of x

Example Compression void (*function_queue[8])(void);

Example Compression void (*function_queue[8])(void); x

n = size of a function pointer = 16 bits

Example Compression

x

Vx &function_A &function_B &function_C NULL

Example Compression

x

Vx

n = 16 bits |Vx| = 4

log2|Vx| < n 2 < 16



Example Compression

x

Vx

Cx 0 1 2 3

fx ≝ Vx to Cx ≝ compression

fx-1 ≝ Cx to Vx ≝ decompression

Example Compression ROM x

Cx

Vx = {

,

,

,

}

0 1 2 3

fx ≝ compression table scan fx-1 ≝ decompression table lookup

Example Compression ROM x

Cx

Vx = {

,

,

,

}

0 1 2

128 bits reduced to 16 bits

3

112 bits of RAM saved

Implementation ●

Source-to-source transformation for C −



What about value sets of size 1? −



Rewrite declaration, initializer, reads, writes

Constant propagation (then DCE, DDE)

Optimizations −

Avoid table-driven compression funcs when possible



Align hot compressed values on word boundaries



Merge redundant compression tables



Compile-time compression when storing constants

RAM Compression Results

⇒ simulator unavailable

RAM Compression Results Constant Prop / DCE 10% RAM reduction 20% ROM reduction 5.9% duty cycle reduction

⇒ simulator unavailable

RAM Compression Results Constant Prop / DCE 10% RAM reduction 20% ROM reduction 5.9% duty cycle reduction

Compression 22% RAM reduction 3.6% ROM reduction 29% duty cycle increase ⇒ simulator unavailable

Tuning RAM Compression ●

Can elect to not compress some compressible variables −



For each compressible variable compute a cost / benefit ratio − −



But which ones?

Cost – estimated penalty in ROM or CPU cycles Benefit – RAM savings

Sort compressible variables by ratio and compress until some threshold is met

Cost/Benefit Ratio

∑ C i Ai B i V  C ≝ access profile A,B ≝ platform-specific costs V ≝ cardinality of value set

Cost/Benefit Ratio

∑ C i Ai B i V  C ≝ access profile A,B ≝ platform-specific costs V ≝ cardinality of value set

S u −S c Su ≝ original size Sc ≝ compressed size

Turning the RAM Knob 0%

Turning the RAM Knob 10%

Turning the RAM Knob 20%

Turning the RAM Knob 30%

Turning the RAM Knob 40%

Turning the RAM Knob 50%

Turning the RAM Knob 60%

Turning the RAM Knob 70%

Turning the RAM Knob 80%

Turning the RAM Knob 90%

Turning the RAM Knob 100%

Turning the RAM Knob 95%

Compression Spectrum

Compression Spectrum 95%

Compression Spectrum 95%

Conclusion ●

● ●

RAM likely to remain scarce in low-cost, low-power systems RAM is used inefficiently Manually tweaking data sizes (even among char, short, long, etc.) is unpleasant



Useful to trade haves for have-nots



CComp implements RAM compression http://www.cs.utah.edu/~coop/research/ccomp/

Analysis Times Benchmark drive1 drive2 osc genericbase ap rfmtoleds cnttoledsandrfm testdrip

HH:MM:SS 00:00:13 00:00:22 00:00:44 00:01:17 00:01:18 00:01:23 00:01:32 00:01:42

Benchmark sensetorfm testtimestamping ident surge hfs testtinysec tinydb

HH:MM:SS 00:01:42 00:02:09 00:03:13 00:03:42 00:06:06 00:12:34 01:58:45

No RAM Compression

⇒ simulator unavailable

Full RAM Compression

⇒ simulator unavailable

Offline Compression for On-Chip RAM - University of Utah School of ...

Products with embedded computing are usually… − Low cost, high volume. − Very sensitive to unit cost. ○ Bottom line: Pressure to use cheap MCUs ...

NAN Sizes 0 Downloads 144 Views

Recommend Documents

Offline Compression for On-Chip RAM
take advantage of useful abstractions such as threads and a heap. We developed offline .... Thus, there are no performance gains to be had by improving spatial locality ..... by KESO [27], an ahead-of-time Java-to-C compiler for con- strained ...

Offline Compression for On-Chip RAM
$12.5 billion market in 2006. ○ Products with embedded computing are usually… .... Benefit – RAM savings. ○ Sort compressible variables by ratio and.

Eliminating the Call Stack to Save RAM - University of Utah School of ...
Jun 19, 2009 - Categories and Subject Descriptors C.3 [Special-purpose and .... way: by previously performing a function inlining pass that elimi- nates all ...

Nathan Seegert - University of Utah
University of Wisconsin, Madison, WI. B.A. Economics, (with honors, mathematics emphasis, Dean's List). PUBLISHED PAPERS: The Performance of State Tax ...

Preventing Interrupt Overload - CS @ Utah - University of Utah
May 2, 2005 - web transaction generates 14 interrupts, and it did not seem to make .... lazy receiver processing [5] and Dannowski and Härtig's work [4],.

test errors are usually an indication of - Utah State University
I ex perienc ed m ental bloc k. I w a s tired during the te s t and c ould not c onc entrate . I w a s hungry during the te s t and c ould not c onc entrate . I panic k ed.

Curriculum Vitae - Faculty Activity Reporting (FAR) - University of Utah
1645 E. Campus Center Drive, Rm. 109. E-mail: ... Retention and Productivity in Call Centers, with Jason Sandvik, Richard Saouma, and Chris. Stanton.

Protection of compression drivers
maintaining a good degree of protection. 2. Somewhat smaller capacitor values may be required for additional protection in high—pa war sound reinforcement.

please scroll down for article - Northwestern University School of ...
Nov 11, 2008 - Spence (1982) echoed this sentiment, writing that ... retain what he [sic] learned during the analysis''. (p. 270). ..... But I now have better tools to work with*One of the ... else, but I can still do good work and enjoy life. In sum

VIT UNIVERSITY SCHOOL OF ELECTRONICS ...
Which of the figures above is the best representation of the channel in the schematic on the ... (a) Calculate VOH, VOL, VM of the above inveter. (b) Find VIH, VIL, ...

CAVENDISH UNIVERSITY SCHOOL OF MEDICINE ...
SCHOOL OF MEDICINE. Foundation Physics Tutorial sheet 1. (January 2017 intake). 1. A warplane moving at the same altitude makes three successive ...

Fordham University School of Law
Sep 30, 2003 - ... without charge from the Social Science Research Network electronic library: ... Both were twenty-eight.1 Over the next seven years, Andrea2 ..... was designing computer systems for NASA.53 Andrea approached him first in ...... nati

BOSTON UNIVERSITY GRADUATE SCHOOL OF ...
grammar for my conference abstracts, term papers, manuscripts, and this dissertation, ...... For example, in (21), the antecedent of the elided VP go to the ball.

stirling management school scholarship ... - University of Stirling
MBA Only. MBA Leadership for Sustainable. Futures Scholarships. MBA Only ... Title of Masters course applied for (e.g. MSc Marketing). Type of offer received from the ... help you, and detailing your motivations, expectations and educational or profe

KELLEY SCHOOL OF BUSINESS, INDIANA UNIVERSITY
“Best Foot Forward or Best for Last in a Sequential Auction? .... Service to the Department of Finance, Kelley School of Business, and Indiana University.

Predator Management in Utah - Utah Division of Wildlife Resources
Jan 24, 2012 - wildlife officials may choose to implement predator-management plans. The DWR recently updated its policy on predator management to place ...

2012 Utah Black Bear Guidebook - Utah Division of Wildlife Resources
9 Basic requirements. 9 Adults must .... guidebook—such as Utah Code § 23-20-3 ..... email. You can also learn your drawing results by visiting wildlife.utah.govor by calling 1-800-221-. 0659 .... wildlife.utah.gov/licenses/agent.html. Before you.

2012 Utah Black Bear Guidebook - Utah Division of Wildlife Resources
wildlife.utah.gov/guidebooksto view digital versions of ... apply for or obtain a 2012 black bear hunting permit ...... The signature of the owner or person in charge.

University of Utah S.J. Quinney College of Law Honors Snell & Wilmer ...
May 4, 2016 - UNIVERSITY OF UTAH S.J. QUINNEY COLLEGE OF LAW HONORS SNELL ... Dragoo is listed in The Best Lawyers in America® for Energy Law, ... Arizona; Los Angeles and Orange County, California; Denver, Colorado; Las.

The University of Tokyo Graduate School of Information ...
sources. Semantic annotations represent information contained in text documents in a structured format which are more amenable to applications in data mining,.

wioletta dziuda - Harris School of Public Policy - University of Chicago
Microeconomic Analysis, 1997-2000. Higher School of ... Microeconomic Analysis, 2005, 2006. Kellogg School of ... 2008-2013. Business Analytics, 2013-2014.

School of Law University of California, Davis - SSRN papers
http://www.law.ucdavis.edu. UC Davis Legal Studies Research Paper Series. Research Paper No. 312. October 2012. Does Geoengineering Present a Moral Hazard? Albert Lin. This paper can be downloaded without charge from. The Social Science Research Netw