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

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

730KB Sizes 2 Downloads 175 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 - 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 ...

pdf-1835\reliability-availability-and-maintainability-ram-ram ...
... the apps below to open or edit this item. pdf-1835\reliability-availability-and-maintainability-r ... ent-of-ammunition-production-systems-by-joseph-w-fo.pdf.

Instructions for Offline admission form.pdf
... slip is also available at Hamdard University website. Save a copy of. the bank receipt for your record as well. For both modes of application form submission, ...

Instructions for Offline admission form.pdf
Hamdard University online Account No. 205787423 branch code (212) (Title of Account: Hamdard. University) All UBL Branches in Pakistan. Application form ...

Data Compression
Data Compression. Page 2. Huffman Example. ASCII. A 01000001. B 01000010. C 01000011. D 01000100. E 01000101. A 01. B 0000. C 0001. D 001. E 1 ...

Data Compression Algorithms for Energy ... - Margaret Martonosi
Data Compression Algorithms for Energy-Constrained Devices in .... 1000000. 10000000. CC2420. CC1000. XTend. Radio. In s tru c tio n. C y c le s fo r. S a m e.

Data Compression Algorithms for Energy ... - Margaret Martonosi
focuses on more generic data streams from text files or the web which they ... the least of amount of energy to compress and send 1 MB of ...... rather than a PC.

Ram Susana
Grantchester s01e01 tla.47891577696 - Download RamSusana.Futurama video game.This is to prevent public delvingwho let. the dogs out the patient's history and illness,and ... comprehend thetype of pain and anguish that which forevermoreshall beatermin

Ram - svbversvm
shall be Bletchley Park is to play a major rolein the wareffort. However we do not learn ifthis memo is sent out only to Bletchley Park, he may ... Man in the high castle S01. complete.Daisy ducatimiali.And yet itseems that which ... Pdf dragon age.6

Enable Offline Editing.pdf
Page 1 of 1. Enable Offline Editing.pdf. Enable Offline Editing.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Enable Offline Editing.pdf. Page 1 of ...

Scalable Offline Monitoring
entries from a two year period, requiring 0.4 TB of storage. The monitoring takes ... MFOTL's satisfaction relation |= is defined as expected for (i) a time ... we use terms like free variable and atomic formula, and abbreviations such as ...... Conf

OFFLINE ADMITTED POSGTRADUATE
MA LIBRARY & INFORMATION MANAGEMENT (MLIM_BLENDED MODE) 2017/2018. MASTER IN TOURISM PLANNING AND MANAGEMENT (MTPM_BLENDED ... ADMITTED POSGTRADUATE -BATCH_2_DISPALY_2017_2018.pdf.

Genderknowledge - Lady Shri Ram College
Mar 5, 2014 - Inauguration of Jagori Exhibition - Women and Mobility by. Suneeta Dhar. ... Entrepedia 2014: Entrepreneurial Development Event. Economics ...

Oscillatory chest compression device
Jan 14, 2002 - (Commued). 602/ 13. See application ?le for complete search history. ..... F. Ohnsorg, “A Cost Analysis of HighiFrequency Chesti ..... mucous and other secretions to build up in a person's lungs. .... mobile unit shoWn in FIG.

Enable Offline Editing.pdf
Page 1 of 1. How to enable Offline Editing in Google Drive. Once logged in to Google Drive,. select “more” from the menu. on the left hand side. Select “Oine” 1 2.

Offline Data Synchronization in IPMS
In this paper, "Offline mode" development for the UP (University of Prishtina) ... [5] proposes “Evaluation of contact synchronization algorithm for the android ...

Oscillatory chest compression device
Jan 14, 2002 - (63) Continuation of application No. 08/661,931 ... See application ?le for complete search history. Primary ..... Product Brochure, “Percussionaire® Corporation Presents .... Generator 3 may be con?gured as a mobile unit.

Oscillatory chest compression device
Jan 14, 2002 - N. Gavriely et al., “Gas Exchange During Combined High and LoW Frequency Tidal Volume Ventilation in Dogs,” in. Progress in Respiration ...

Scalable Offline Monitoring
3 Department of Computer Science, TU Darmstadt, Germany. 4 ABB Corporate Research .... entries from a two year period, requiring 0.4 TB of storage. ..... (1) (¯D, ¯τ,v,i) |= ϕ, for all valuations v and i ∈ N with (v, τi) ∈ R. (2) (¯Dk .....

HIT-MW Dataset for Offline Chinese Handwritten Text ...
School of Computer Science ... writers. Two years later, other two datasets, CEDAR [3] ... Figure 1. Flowchart of HIT-MW Dataset. 2. Sampling Scheme. Our dataset is to make a reasonable representation of. 1 HIT is the ... some degree. Thirdly ...

Bag-of-Features Representations for Offline ...
[4]). However, their application in document analysis and recognition is rather ... paper is the integration of a learned statistical bag-of-features model with an ...

Offline Optimization for Online Ad Allocation - Semantic Scholar
be the flow on edge (a, i) in this max flow (since all the ca- pacities are integers, we may assume that the resulting flow is integral [25]). For ease of notation, we say fai = 0 if edge. (a, i) ∈ E. Online Algorithm. When an impression i ∈ D(i)