1 / 13

Propagating Constants Past Software to Hardware Peripherals

This article explores the propagation of constants from software to hardware peripherals, discussing the impact on power, size, and cost. It also examines different approaches, including compiler and platform tools, and provides examples of programmable peripherals.

shanaj
Download Presentation

Propagating Constants Past Software to Hardware Peripherals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Board Processor Memory Peripheral Core library Peripheral Mem PeripheralA Processor PeripheralB IP cores ProcessorX 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 SOC

  3. Memory CCD D/A A/D MIPS I$ JPEG CODEC Bridge D$ DMA UART LCD Driver Field-programmable logic 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, ...); SOC

  4. Memory CCD D/A A/D MIPS I$ JPEG CODEC Bridge D$ DMA UART LCD Driver Field-programmable logic 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 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. ingot silicon wafer 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

  6. Reset() cont_reg1 = 0x00 cont_reg2 = 0xFF Core library Program memory Micro-processor Peripheral Peripheral cont_reg1 cont_reg2 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

  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 software configurable parameters After propagating generic parameters

  8. bus cont_reg A B logic A B 1 1 Example 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 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; end if; -- Other behavior omitted end process; After converting the software configurable parameter (cont_reg) to a constant and optimizing

  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 Software Core Core Core SOC structure Compiler Constants info. Synthesis

  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 Platform tool Constants info. from user Software Core Core Core SOC structure Synthesis Compiler

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

  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

More Related