Presentation is loading. Please wait.

Presentation is loading. Please wait.

Propagating Constants Past Software to Hardware Peripherals Frank Vahid*, Rilesh Patel and Greg Stitt Dept. of Computer Science and Engineering University.

Similar presentations


Presentation on theme: "Propagating Constants Past Software to Hardware Peripherals Frank Vahid*, Rilesh Patel and Greg Stitt Dept. of Computer Science and Engineering University."— Presentation transcript:

1 Propagating Constants Past Software to Hardware Peripherals Frank Vahid*, Rilesh Patel and Greg Stitt Dept. of Computer Science and Engineering University of California, Riverside *Also with the Center for Embedded Computer Systems, UC Irvine This work was supported by the National Science Foundation Compilers and Operating Systems for Low Power 2001 (COLP’01)

2 Frank Vahid, www.cs.ucr.edu/~vahid 2 Introduction Past –Board-level IC’s Present –System-on-a-chip (SOC) and IP “cores” –Core types Hard: layout Firm: structural HDL Soft: RT-synthesizable HDL ProcessorMemoryPeripheral Board PeripheralMem Processor IP cores Core library PeripheralA PeripheralB ProcessorX SOC

3 Frank Vahid, www.cs.ucr.edu/~vahid 3 Cores Come with Parameters Sample parameters –JPEG resolution –Cache size and # ways –Buffer sizes –Peripheral register addresses Sample VHDL using generics entity CODEC is generic (resol : integer); port (clk: in bit; rst: in bit...);... if (resol = 12) then... elsif (resol = 16) then... User sets generics entity SOC is... M1: MIPS... B1: DMA... C1: CODEC generic map( resol => 12 ); port map (clk_sig, rst_sig,...); MIPS CCD I$ A/D D/A JPEG CODEC DMA Memory UART LCD Driver Bridge D$ Field-programmable logic SOC

4 Frank Vahid, www.cs.ucr.edu/~vahid 4 Impact of Parameter Settings Pre-fabrication parameters –Essentially CONSTANTS –Synthesis tool propagates constants and performs dead code elimination Impact on Power –Less logic means less switching Dynamic power proportional to switching –Less logic means shorter wires So also get less power per switch MIPS CCD I$ A/D D/A JPEG CODEC DMA Memory UART LCD Driver Bridge D$ Field-programmable logic Parameter setting A Parameter setting B entity CODEC is generic (resol : integer); -- suppose =12 port (clk: in bit; rst: in bit...);... if (12 = 12) then... elsif (12 = 16) then...

5 Frank Vahid, www.cs.ucr.edu/~vahid 5 Impact of Parameter Settings Impact on Size and Cost –Each wafer holds tens to hundreds of chips Chips processed concurrently, photographic-like process Wafer processing is slow and expensive –Yield – percentage of good chips on wafer Smaller (and thus more) chips means higher yield –Smaller chips means more good chips per wafer Translates to lower cost per chip ingotsilicon wafer

6 Frank Vahid, www.cs.ucr.edu/~vahid 6 Not all Parameters are Set before IC Fabrication Many parameters are “software configurable” –Values set by software, usually during boot sequence, thus post-fabrication –Don’t give same power, size and cost advantages as pre-fabrication parameters Micro- processor Program memory Peripheral Core library cont_reg1cont_reg2 Reset() cont_reg1 = 0x00 cont_reg2 = 0xFF

7 Frank Vahid, www.cs.ucr.edu/~vahid 7 Key Observation Embedded system software often fixed –Never changes –Often can’t be changed – burned into ROM Thus, those values written to software configurable parameters are really CONSTANTS –If we recognize this, we can obtain further size and power savings After propagating generic parameters After propagating software configurable parameters

8 Frank Vahid, www.cs.ucr.edu/~vahid 8 Example if (cont_reg(0) = ‘0’) then A_out <= ‘1’; else A_in <= ‘1’; end if; if( cont_reg(1) =‘0’) then B_out <= ‘1’; else B_in <= ‘1’; end if; -- Other behavior omitted end process; signal cont_reg: UNSIGNED(1 downto 0); -- declarations for A, B and buffers omitted. process(clk, reset) begin if (reset) then cont_reg = “00”; A_out <= ‘0’; A_in <= ‘1’; B_out <= ‘0’; B_in <= ‘1’; end if; if rising_edge(clk) then -- code to detect write request -- from bus to cont_reg, and -- to update cont_reg omitted AB 1 1 ABcont_reg logic bus After converting the software configurable parameter (cont_reg) to a constant and optimizing

9 Frank Vahid, www.cs.ucr.edu/~vahid 9 Propagating Constants Past Software to Hardware Compiler approach –Compiler outputs information on all writes in the software to memory-mapped I/O registers that are never read in the software –Must replace register by a constant before synthesis Manually or with some tool support CompilerSynthesis SoftwareCore Constants info. SOC structure

10 Frank Vahid, www.cs.ucr.edu/~vahid 10 Propagating Constants Past Software to Hardware Platform tool approach –Modern tools help instantiate cores Ask for values for generics, set those Ask for values for software config. parms, creates appropriate software drivers –Could also ask if fixed value Then, could convert register to constant Software Platform tool Core Constants info. from user Synthesis Compiler SOC structure

11 Frank Vahid, www.cs.ucr.edu/~vahid 11 Experiments Examples –8255A programmable peripheral interface One configuration register to set ports as input or output, and set I/O type (handshake, interr.) We considered three different configurations –8237A DMA controller Several config. registers to select arbitration mode, # channels, base addresses, block size We considered one configuration –16550 UART Several config. registers to enable transmit and receive, select interrupt mode, select baud rate We considered two configurations –DCT (Free-DCT-L from OpenCores) Config. registers to select fwd/rev DCT, and resolution (8, 9, 10 or 12-bit). We considered 1 configuration

12 Frank Vahid, www.cs.ucr.edu/~vahid 12 Results CoresGates, original Gates, with constant propagati on size savings ratio Power, original (micro- watts) Power, with constant propagati on (micro- watts) power savings ratio 8255A mode-0 30698340.72825277219020.31385 8255A mode-1 30699180.70088291520980.28027 8255A mode-2 30699530.689475295221240.28049 8237A single transfer 727623440.677845245320970.14513 PC16550 Tx 250311690.53296146112490.14511 PC16550 Rx 250311880.52537144913070.098 DCT Forward 8-bit 229518610.18910713919620.30841 Average savings 0.5776980.22447

13 Frank Vahid, www.cs.ucr.edu/~vahid 13 Conclusion Treating software configurable parameter values as constants can yield excellent size and power savings –Big question – what’s the best way to do this? –Platform tool approach is probably best –But many designs are made without a platform tool So we need compilers that can help by outputting information on singly-written I/O registers Need synthesis tools that can convert software configurable registers to generics/constants Partial automation would be a big first step


Download ppt "Propagating Constants Past Software to Hardware Peripherals Frank Vahid*, Rilesh Patel and Greg Stitt Dept. of Computer Science and Engineering University."

Similar presentations


Ads by Google