Professional Documents
Culture Documents
Embedded Applications They are everywhere! ! ! ! ! ! ! wristwatches, washing machines, microwave ovens, elevators, mobile telephones, printers, FAX machines, telephone exchanges, automobiles, aircrafts
IIT Bombay
Embedded Apps
! A modern home + has o$e 'e$eral %,r%ose deskto% -C + b,t has a do.e$ o embedded systems/
IIT Bombay
Embedded Applications
A$ embedded system ty%i0ally has a di'ital si'$al %ro0essor a$d a variety o I/2 devi0es 0o$$e0ted to se$sors a$d a0t,ators/
Com%,ter 30o$troller4 is s,rro,$ded by other s,bsystems5 se$sors a$d a0t,ators
Com%,ter 66 Co$troller7s ,$0tio$ is 8 ! to mo$itor %arameters o %hysi0al %ro0esses o its s,rro,$di$' system ! to 0o$trol these %ro0esses whe$ever $eeded /
Krithi Ramamritham / Kavi Arya IIT Bombay
Simple Examples
A simple thermostat controller ! periodically reads temperature of chamber ! switches on or off the cooling system/ A pacema+er ! constantly monitors the heart ! paces the heart when heart beats are missed
IIT Bombay
IIT Bombay
IIT Bombay
/e0uirements Specification1 0nitial specification may be very general and come from mar+eting dept/
! E/'/5 short do0,me$t detaili$' market $eed or a low6 e$d di'ital 0amera that8
+ + + + + + captures and stores at least 45 low"res images and uploads to '-, costs around 6755 with single medium"si&e 0- costing less that 684, has long as possible battery life, has expected sales volume of 855,555 if mar+et entry 9 : months, 755,555 if between : and 78 months, insignificant sales beyond 78 months
IIT Bombay
! ;ptimi&ation metrics
+ Im%rove as m,0h as %ossible to im%rove %rod,0t
IIT Bombay
! Energy
+ Red,0i$' %ower or time red,0es e$er'y + 2%timi.ed metri08 wa$t battery to last as lo$' as %ossible
IIT Bombay
2onfunctional re0uirements1
! 'erformance
+ F,st %ro0ess ima'e ast e$o,'h to be ,se ,l + 1 se0 reaso$able 0o$strai$t
! Slower wo,ld be a$$oyi$' ! "aster $ot $e0essary or low6e$d o market
! %i&e
+ F,st ,se IC that its i$ reaso$ably si.ed 0amera + Co$strai$ed a$d o%timi.atio$ metri0
! Co$strai$t may be 2<<5<<< 'ates5 b,t smaller wo,ld be 0hea%er
Krithi Ramamritham / Kavi Arya IIT Bombay
2esign
+ "o,r im%leme$tatio$s + Iss,es8
! Ge$eral6%,r%ose vs/ si$'le6 %,r%ose %ro0essorsH ! -artitio$i$' o ,$0tio$ality amo$' di ere$t %ro0essor ty%esH
IIT Bombay
F1
F5 F4
Functional Design
Source: Source: Ian Phillips, ARM Ian Phillips, ARM
F3
(F2)
Architectural Design
(F3) (F4)
(F5)
HW1
HW2
HW3
HW4
IIT Bombay
Thread
*ntroduction to a simple digital camera ! -aptures images ! %tores images in digital format
+ =o ilm + F,lti%le ima'es stored i$ 0amera
! =,mber de%e$ds o$ memory a$d bits/ima'e
! 2ownloads images to '+ Serial 0omm 3ISB5 et0/4 + Wireless 3Bl,etooth5 :<2/115 D4
IIT Bombay
%lectromechanical shutter activates to expose cells to light &ircuitr! discharges cells' activates shutter' reads 8-bit value o" each cell (alues clocked out o" &&) b! external logic through std parallel bus inter"ace
lectronic circuitr!
Pixel columns
IIT Bombay
5ero8bias error
! ,anufacturing errors cause cells to measure slightly above or below actual light intensity ! Error typically same across columns, but different across rows ! %ome of left most columns bloc+ed by blac+ paint to detect &ero"bias error
+ Readi$' o $o$6.ero i$ blo0ked 0ells is .ero6bias error + Ea0h row is 0orre0ted by s,btra0ti$' the avera'e error o,$d i$ blo0ked 0ells or that row
IIT Bombay
5ero8bias error1
&overed cells
*ero-bias ad$ustment
IIT Bombay
Compression ! %tore more images ! Transmit image to '- in less time ! E'EF !Eoint 'hotographic Experts Froup#
IIT Bombay
Compression1
E'EF !Eoint 'hotographic Experts Froup#
+ 'opular standard format for representing digital images in a compressed form + 'rovides for a number of different modes of operation + Sequential ,ode used in this lecture provides high compression ratios using 2-T !discrete cosine transform# (others are -- progressive, lossless, hierarchical) + 0mage data divided into bloc+s of = x = pixels + @ steps performed on each bloc+
2-T,Guanti&ation,Cuffman encoding
Krithi Ramamritham / Kavi Arya IIT Bombay
IIT Bombay
9uanti:ation step1
21 61 21 (1 1< 2< ( 6)
11 22 19 61: 9 621 12 9
* < 61 6: 2 61 61 62
6* 1) < 62 * 61 ( 61
61 6; 6* 62 61 61 61 62
( 61 ( * 1 ( < 61
1 ( 2 62 1 6( 2 1
* 61 6* 1 61 2 6( 61
#sually, first item of bloc$s are store" "ifferentially %igzag brings equal values together &' run-length enco"ing
Krithi Ramamritham / Kavi Arya IIT Bombay
IIT Bombay
5u%%man tree
3 ,
/2 . -
5u%%man codes
61 < 62 1 2 ( * 6( 6* 61< 1)) 6; 6: 6) 1 1)
<< 1<< 11< <1< 111< 1<1< <11< 1111< 1<11< <111< 111111 11111< 1<1111 1<111< <11111 <1111<
"+ +
+ -
+ ,
+ 1 2
+ 4 + 0
Traverse tree from root to leaf to obtain binary code for leaf.s pixel value
+ Append 5 for left traversal, 7 for right traversal
3 "/ / ". ,
+ +
0
,
"+0 / + +,
. /
. + ",
3 / + "2 + +,,
/ + "1
"+ 3
IIT Bombay
Arc"ive step
! ! ecord starting address and image si&e
+ -an use lin+ed list
;ne possible way to archive images + 0f max number of images archived is NO ! %et aside memory for N addresses and N image"si&e variables ! Peep counter for location of next available address ! 0nitiali&e addresses and image"si&e variables to 5 ! %et global memory address to N x >
+ Assuming addresses, image"si&e variables occupy N x > bytes
! First image archived starting at address N x > ! Flobal memory address updated to N x > L !compressed image si&e# ,emory re1uirement based on N, image si&e, and average compression ratio
IIT Bombay
IIT Bombay
7ero"'ias ad(ust
DC)
8uanti&e
!es no Done;
Archive in memor!
!es
no
)ransmit seriall!
IIT Bombay
Done;
!es
no
)ransmit seriall!
IIT Bombay
C>D C6C
IIT Bombay
CCD6C
CCDPP6C
image %ile
C>D C6C
C<)RL6C
+0+0+0+0+0+0+0+0+0+0+0+0+0+06 66
=AR)6C
output %ile
IIT Bombay
IIT Bombay
CCD module
! %imulates real --2 ! (c")nitialize is passed name of image file ! (c"(apture reads RimageS from file into buffer ! (c"*op*i+el outputs pixels one at a time from buffer
IIT Bombay
CCD module
! ! ! ! %imulates real --2 (c")nitialize is passed name of image file (c"(apture reads RimageS from file (c"*op*i+el outputs pixels one at a time
st tic !"L# $i% &e!ile' ndle( st tic ch ) *uffe)+SZ_ROW,+SZ_COL,( st tic unsi&ned )o-"nde./ col"nde.(
IIT Bombay
CCD*nitiali:e module
0oid Ccd"niti li1e is passed name of image file (const ch ) $i% &e!ile2 %e) 3 i% &e!ile' ndle 4 fo5en(i% &e!ile2 %e/ 6)6)( )o-"nde. 4 78( col"nde. 4 78( 9
IIT Bombay
CCDCapture module
0oid CcdC 5tu)e(0oid) 3reads int 5i.el( )e-ind(i% &e!ile' ndle)( fo)()o-"nde.4:( )o-"nde.<SZ_ROW( )o-"nde.++) 3 fo)(col"nde.4:( col"nde.<SZ_COL( col"nde.++) 3 if( fsc nf(i% &e!ile' ndle/ 6;i6/ <5i.el) 44 8 ) 3 *uffe)+)o-"nde.,+col"nde., 4 (ch ))5i.el( 9 9 9 9 )o-"nde. 4 :( col"nde. 4 :(
IIT Bombay Krithi Ramamritham / Kavi Arya
CCD3op3ixel module
! (c"*op*i+el outputs pixels one at a time from buffer
ch ) Ccd=o5=i.el(0oid) 3 ch ) 5i.el( 5i.el 4 *uffe)+)o-"nde.,+col"nde.,( if( ++col"nde. 44 SZ_COL ) 3 col"nde. 4 :( if( ++)o-"nde. 44 SZ_ROW ) 3 col"nde. 4 78( )o-"nde. 4 78( 9 9 )etu)n 5i.el( 9
Krithi Ramamritham / Kavi Arya IIT Bombay
CCD module
! ! ! ! %imulates real --2 (c")nitialize is passed name of image file (c"(apture reads RimageS from file (c"*op*i+el outputs pixels one at a time
#include <stdio.h> #define SZ_ROW #define SZ_COL 64 (64 + 2) 0oid Ccd"niti li1e(const ch ) $i% &e!ile2 %e) 3 i% &e!ile' ndle 4 fo5en(i% &e!ile2 %e/ 6)6)( )o-"nde. 4 78( col"nde. 4 78( 9 0oid CcdC 5tu)e(0oid) 3 int 5i.el( )e-ind(i% &e!ile' ndle)( fo)()o-"nde.4:( )o-"nde.<SZ_ROW( )o-"nde.++) 3 fo)(col"nde.4:( col"nde.<SZ_COL( col"nde.++) 3 if( fsc nf(i% &e!ile' ndle/ 6;i6/ <5i.el) 44 8 ) 3 *uffe)+)o-"nde.,+col"nde., 4 (ch ))5i.el( 9 9 9 )o-"nde. 4 :( col"nde. 4 :( 9
st tic !"L# $i% &e!ile' ndle( st tic ch ) *uffe)+SZ_ROW,+SZ_COL,( st tic unsi&ned )o-"nde./ col"nde.( ch ) Ccd=o5=i.el(0oid) 3 ch ) 5i.el( 5i.el 4 *uffe)+)o-"nde.,+col"nde.,( if( ++col"nde. 44 SZ_COL ) 3 col"nde. 4 :( if( ++)o-"nde. 44 SZ_ROW ) 3 col"nde. 4 78( )o-"nde. 4 78( 9 9 )etu)n 5i.el( 9
IIT Bombay
CCD6C
CCDPP6C
image %ile
C>D C6C
C<)RL6C
+0+0+0+0+0+0+0+0+0+0+0+0+0+06 66
=AR)6C
output %ile
IIT Bombay
IIT Bombay
64 64
#define SZ_COL
st tic ch ) *uffe)+SZ_ROW,+SZ_COL,( st tic unsi&ned )o-"nde./ col"nde.( 0oid Ccd55"niti li1e() 3 )o-"nde. 4 78( col"nde. 4 78(
IIT Bombay
CCD33Capture module
0oid Ccd55C 5tu)e(0oid) 3 ch ) *i s( CcdC 5tu)e()( fo)()o-"nde.4:( )o-"nde.<SZ_ROW( )o-"nde.++) 3 fo)(col"nde.4:( col"nde.<SZ_COL( col"nde.++) 3 *uffe)+)o-"nde.,+col"nde., 4 Ccd=o5=i.el()( 9 *i s 4 (Ccd=o5=i.el() + Ccd=o5=i.el()) > 2( fo)(col"nde.4:( col"nde.<SZ_COL( col"nde.++) 3 *uffe)+)o-"nde.,+col"nde., 74 *i s( 9 9 )o-"nde. 4 :( col"nde. 4 :(
IIT Bombay
9 Krithi Ramamritham / Kavi Arya
CCD6C
CCDPP6C
image %ile
C>D C6C
C<)RL6C
+0+0+0+0+0+0+0+0+0+0+0+0+0+06 66
=AR)6C
output %ile
IIT Bombay
<A/$ module
! Actually a half $A T + 2$ly tra$smits5 does $ot re0eive ! #art)nitialize is passed name of file to output to ! #artSen" transmits !writes to output file# bytes at a time
#include <stdio.h> st tic !"L# $out5ut!ile' ndle( 0oid ? )t"niti li1e(const ch ) $out5ut!ile2 %e) 3 out5ut!ile' ndle 4 fo5en(out5ut!ile2 %e/ 6-6)( 9 0oid ? )tSend(ch ) d) 3 f5)intf(out5ut!ile' ndle/ 6;i@n6/ (int)d)( 9
IIT Bombay
CCD6C
CCDPP6C
image %ile
C>D C6C
C<)RL6C
+0+0+0+0+0+0+0+0+0+0+0+0+0+06 66
=AR)6C
output %ile
IIT Bombay
C=DEC module
! ! ! ! ,odels F2-TT encoding ibuffer holds original = x = bloc+ obuffer holds encoded = x = bloc+ (o"ec*ush*i+el called :> times to fill ibuffer with original bloc+ ! (o"ec,o-"ct called once to transform = x = bloc+ + EE%lai$ed i$ $eEt slide ! (o"ec*op*i+el called :> times to retrieve encoded bloc+ from obuffer
*Forward Discrete Cosine Transform Krithi Ramamritham / Kavi Arya IIT Bombay
C=DEC module
! ! ! ! ,odels F2-T encoding 0oid Codec"niti li1e(0oid) 3 id. 4 :( 9 ibuffer holds original = x = bloc+ 0oid Codec=ush=i.el(sho)t 5) 3 obuffer holds encoded = x = bloc+ if( id. 44 64 ) id. 4 :( i*uffe)+id. > A,+id. ; A, 4 5( id.++( (o"ec*ush*i+el called :> times to 9 fill ibuffer with original bloc+ 0oid CodecBo!dct(0oid) 3 int ./ C( ! (o"ec,o-"ct called once to fo)(.4:( .<A( .++) 3 fo)(C4:( C<A( C++) transform = x = bloc+ o*uffe)+.,+C, 4 !BCD(./ C/ i*uffe))( 9 + EE%lai$ed i$ $eEt slide id. 4 :( 9 ! (o"ec*op*i+el called :> times to sho)t Codec=o5=i.el(0oid) 3 retrieve encoded bloc+ from obuffer sho)t 5(
st tic sho)t i*uffe)+A,+A,/ o*uffe)+A,+A,/ id.( if( id. 44 64 ) id. 4 :( 5 4 o*uffe)+id. > A,+id. ; A,( id.++( )etu)n 5( 9
IIT Bombay
"3,5v4 L M E C3,4 E C3v4 NEL<//9 NyL<//9 &Ey E 0os3O32E P 14,/114 E 0os3O32y P 14v/11 L M E C3,4 E C3v4 NEL<//9 0os3O32E P 14,/114 E NyL<//9 &Ey E 0os3O32y P 14v/11 ! Fives encoded pixel at row u, column v ! 2xy is original pixel value at row x, column y
Krithi Ramamritham / Kavi Arya IIT Bombay
C=DEC1
! 0mplementing F2-T formula ! ;nly :> possible inputs to (.S, so table can be used to save performance time
+ "loati$'6%oi$t val,es m,lti%lied by (2519: a$d ro,$ded to $earest i$te'er + (2519: 0hose$ i$ order to store ea0h val,e i$ 2 bytes o memory + "iEed6%oi$t re%rese$tatio$ eE%lai$ed more later
! -,(/ unrolls inner loop of summation, implements outer summation as two consecutive for loops
Krithi Ramamritham / Kavi Arya IIT Bombay
C=DEC1
! ! 0mplementing F2-T formula ;nly :> possible inputs to (.S, so table can be used to save performance time
+ + + Floating"point values multiplied by @8,:D= and rounded to nearest integer @8,:D= chosen in order to store each value in 8 bytes of memory Fixed"point representation explained more later
9( st tic int !BCD(int u/ int 0/ sho)t i%&+A,+A,) 3 dou*le s+A,/ ) 4 :( int .( fo)(.4:( .<A( .++) 3
static short ONE_OVER_SQRT_TWO = 23170; static double retur" 2 static double !i"t h' ( OS!i"t #$% i"t u&' ( OS_T)*+E,#$-,u&- . 327/010;
st tic const sho)t COS_DEFL#+A,+A, 4 3 3 G2H6A/ 3 G2H6A/ 3 G2H6A/ 3 G2H6A/ 3 G2H6A/ G28GA/ 2H24I/ G:2HG/ 82IGJ/ 2H24I/ 2G8H:/ 8A2:4/ 82IGJ/ 6GJ2 9/
8A2:4/ 782IGJ/ 7G28GA/ 72G8H:/ 6GJ2/ 7G:2HG/ 78A2:4/ 76GJ2/ 7G:2HG/ 8A2:4/ 2G8H:/
-,(/ unrolls inner loop of summation, implements outer summation as two consecutive for loops
G:2HG/ 72H24I/
2G8H:/ 78A2:4/
s+., 4 i%&+.,+:, $ COS(:/ 0) + i%&+.,+8, $ COS(8/ 0) + i%&+.,+2, $ COS(2/ 0) + i%&+.,+G, $ COS(G/ 0) + i%&+.,+4, $ COS(4/ 0) + i%&+.,+I, $ COS(I/ 0) + i%&+.,+6, $ COS(6/ 0) + i%&+.,+H, $ COS(H/ 0)( 9 fo)(.4:( .<A( .++) ) +4 s+., $ COS(./ u)( )etu)n (sho)t)() $ .2I $ C(u) $ C(0))( 9
IIT Bombay
CCD6C
CCDPP6C
image %ile
C>D C6C
C<)RL6C
+0+0+0+0+0+0+0+0+0+0+0+0+0+06 66
=AR)6C
output %ile
IIT Bombay
IIT Bombay
0oid Cnt)lC 5tu)e"% &e(0oid) 3 Ccd55C 5tu)e()( fo)(i4:( i<SZ_ROW( i++) fo)(K4:( K<SZ_COL( K++) *uffe)+i,+K, 4 Ccd55=o5=i.el()( 9 #define SZ_ROW #define SZ_COL #define 2?L_ROW_FLOCMS #define 2?L_COL_FLOCMS
IIT Bombay
odecAo6Ai#el!';
IIT Bombay
int % in(int )&c/ ch ) $ )&0+,) 3 ch ) $u )tOut5ut!ile2 %e 4 )&c > 8 P )&0+8, Q 6u )t_out.t.t6( ch ) $i% &e!ile2 %e 4 )&c > 2 P )&0+2, Q 6i% &e.t.t6( >$ initi li1e the %odules $> ? )t"niti li1e(u )tOut5ut!ile2 %e)( Ccd"niti li1e(i% &e!ile2 %e)( Ccd55"niti li1e()( Codec"niti li1e()( Cnt)l"niti li1e()( >$ si%ul te function litC $> Cnt)lC 5tu)e"% &e()( Cnt)lCo%5)ess"% &e()( Cnt)lSend"% &e()( 9
IIT Bombay
Design
! 2etermine system.s architecture
+ -ro0essors ! A$y 0ombi$atio$ o si$'le6%,r%ose 30,stom or sta$dard4 or 'e$eral6%,r%ose %ro0essors + Femories5 b,ses
IIT Bombay
Design..
! 0mplementation + A %arti0,lar ar0hite0t,re a$d ma%%i$' + Sol,tio$ s%a0e is set o all im%leme$tatio$s ! %tarting point + Qow6e$d 'e$eral6%,r%ose %ro0essor 0o$$e0ted to lash memory ! All ,$0tio$ality ma%%ed to so tware r,$$i$' o$ %ro0essor ! Is,ally satis ies %ower5 si.e5 time6to6market 0o$strai$ts ! I timi$' 0o$strai$t $ot satis ied the$ try8 + ,se si$'le6%,r%ose %ro0essors or time60riti0al ,$0tio$s + rewrite ,$0tio$al s%e0i i0atio$
Krithi Ramamritham / Kavi Arya IIT Bombay
IIT Bombay
S,&
=AR)
CCDPP
IIT Bombay
! --2'' function on custom single"purpose processor + Im%roves %er orma$0e + less mi0ro0o$troller 0y0les + I$0reases =RE 0ost a$d time6to6market + Easy to im%leme$t8 Sim%le data%ath5 "ew states i$ 0o$troller ! %imple $A T easy to implement as single"purpose processor also ! EE' ;, for program memory and A, for data memory added as well
IIT Bombay
Microcontroller
$loc: diagram o% Intel 10-+ processor core
Instruction Decoder
,? R>M Controller
AL=
+/1 RAM
IIT Bombay
Microcontroller
Controller AL=
+/1 RAM
! %ynthesi&able version of 0ntel =547 available + Writte$ i$ #J&Q + Ca%t,red at re'ister tra$s er level 3RTQ4 ! Fetches instruction from ;, ! 2ecodes using 0nstruction 2ecoder ! AA$ executes arithmetic operations + So,r0e a$d desti$atio$ re'isters reside i$ RAF ! %pecial data movement instructions used to load and store externally ! %pecial program generates BC2A description of ;, from output of - compilerHlin+er
Krithi Ramamritham / Kavi Arya IIT Bombay
<A/$
0dle
: I@0 IA1
! $A T in idle mode until invo+ed )ata: Stop: )ransmit )ransmi + IART i$voked whe$ :<*1 eEe0,tes dataCID, t 5IF5 then IEE I@1 store i$str,0tio$ with IARTAs e$able re'ister as tar'et address ! Femory6ma%%ed 0omm,$i0atio$ ! Qower :6bits o memory address or RAF ! I%%er :6bits o memory address or memory6ma%%ed I/2 devi0es ! %tart state transmits 5 indicating start of byte transmission then transitions to 2ata state ! 2ata state sends = bits serially then transitions to %top state, %top state transmits 7 indicating transmission done then transitions bac+ to idle mode
IIT Bombay
CCD33
! ! ! ! ! ! ! ! Cardware implementation of &ero"bias operations 0nteracts with external --2 chip
+ --2 chip resides external to our %;- mainly because combining --2 with ordinary logic not feasible
0nternal buffer, 1, memory"mapped to =547 Bariables 2, ( are buffer.s row, column indices Fet ow state reads in one row from --2 to 1
+ 11 bytes8 1) %iEels P 2 bla0ked6o,t %iEels
1et2ow:
$GRHGCH@Pxl C@CE+
C A 33
C @ 33
-omputeMias state computes bias for that row 3ext2ow: and stores in variable 1ias REE C@0 FixMias state iterates over same row subtracting 1ias from each element C @ 3, Next ow transitions to Fet ow for repeat of process on next row or to 0dle state when all :> rows completed
&ompute/ias:
$ias@C$GRHG++H E $GRHG+0HD I / C@0
4ix/ias: $GRHGCH@$GRHGCH"$ias
IIT Bombay
IIT Bombay
Soft>are
! %ystem"level model provides maNority of code + Fod,le hierar0hy5 %ro0ed,re $ames5 a$d mai$ %ro'ram ,$0ha$'ed ! -ode for $A T and --2'' modules must be redesigned + Sim%ly re%la0e with memory assi'$me$ts ! xdata ,sed to load/store variables over eEter$al memory b,s ! _at_ s%e0i ies memory address to store these variables ! Byte se$t to U_TX_RE by %ro0essor will i$voke IART ! U_!TAT_RE ,sed by IART to i$di0ate its ready or $eEt byte + IART may be m,0h slower tha$ %ro0essor + Similar modi i0atio$ or CC&-- 0ode ! All other modules untouched
IIT Bombay
Soft>are1
#include <stdio.h> st tic !"L# $out5ut!ile' ndle( 0oid ? )t"niti li1e(const ch ) $out5ut!ile2 %e) 3 out5ut!ile' ndle 4 fo5en(out5ut!ile2 %e/ 6-6)( 9 0oid ? )tSend(ch ) d) 3 f5)intf(out5ut!ile' ndle/ 6;i@n6/ (int)d)( 9
IIT Bombay
st tic unsi&ned ch ) .d t ?_DR_R#S _ t_ 6IIGI( st tic unsi&ned ch ) .d t ?_SDED_R#S _ t_ 6IIG4( 0oid ?ERD"niti li1e(0oid) 39 0oid ?ERDSend(unsi&ned ch ) d) 3 -hile( ?_SDED_R#S 44 8 ) 3 >$ *usC - it $> 9 ?_DR_R#S 4 d( 9
Analysis
! Entire %;- tested on BC2A simulator
+ I$ter%rets #J&Q des0ri%tio$s a$d ,$0tio$ally sim,lates eEe0,tio$ o system ! Re0all %ro'ram 0ode tra$slated to #J&Q des0ri%tio$ o R2F + Tests or 0orre0t ,$0tio$ality + Feas,res 0lo0k 0y0les to %ro0ess o$e ima'e 3%er orma$0e4
,btaining design metrics o" interest
J5DL J5DL J5DL Po#er e*uation S!nthesis tool Fate level simulator gates gates gates
J5DL simulator
xecution time
Sum gates
IIT Bombay
Analysis1
! Fate"level description obtained through synthesis + Sy$thesis tool like 0om%iler or S--s + Sim,late 'ate6level models to obtai$ data or %ower a$alysis ! =,mber o times 'ates swit0h rom 1 to < or < to 1 + Co,$t $,mber o 'ates or 0hi% area
J5DL simulator
xecution time
Sum gates
IIT Bombay
IIT Bombay
+ Th,s5 R 1< millio$ i$te'er o%eratio$s %er ima'e + -ro0ed,res i$0rease 0ode si.e ! Fixed"point arithmetic can improve on this
Krithi Ramamritham / Kavi Arya IIT Bombay
Fixed8point arit"metic ! 0nteger used to represent a real number + Co$sta$t $,mber o i$te'erAs bits re%rese$ts ra0tio$al %ortio$ o real $,mber ! Fore bits5 more a00,rate the re%rese$tatio$ + Remai$i$' bits re%rese$t %ortio$ o real $,mber be ore de0imal %oi$t
Krithi Ramamritham / Kavi Arya IIT Bombay
Fixed8point arit"metic1
Translating a real constant to a fixed"point representation
+ F,lti%ly real val,e by 2 V 3W o bits ,sed or ra0tio$al %art4 + Ro,$d to $earest i$te'er + E/'/5 re%rese$t (/1) as :6bit i$te'er with ) bits or ra0tio$ ! 2V) L 11 ! (/1) E 11 L *</2) X *< L <<11<<1< ! 11 32V)4 %ossible val,es or ra0tio$5 ea0h re%rese$ts </<12* 31/114 ! Qast ) bits 3<<1<4 L 2 ! 2 E </<12* L </12* ! (3<<114 P </12* L (/12* X (/1) 3more bits or ra0tio$ wo,ld i$0rease a00,ra0y4
IIT Bombay
! (/1) Y *< L <<11<<1< ! 2/91 Y )( L <<1<1<11 ! *< P )( L ;( L <1<111<1 ! *3<1<14 P 1(311<14 E </<12* L */:12* X */:* ,ultiply
+ F,lti%ly i$te'er re%rese$tatio$s + Shi t res,lt ri'ht by W o bits i$ ra0tio$al %art + E/'/5 (/1) K 2/91 L :/*<;)
! *< K )( L 21*< L 1<<<<11<<11< ! RR ) L 1<<<<11< ! :31<<<4 P 13<11<4 E </<12* L :/(9* X :/*<;) ange of real values used limited by bit widths of possible resulting values
IIT Bombay
! !
st tic unsi&ned ch ) C(int h) 3 )etu)n h P 64 Q O2#_OT#R_SURD_DWO(9 st tic int !(int u/ int 0/ sho)t i%&+A,+A,) 3
0oid Codec"niti li1e(0oid) 3 id. 4 :( 9 0oid Codec=ush=i.el(sho)t 5) 3 if( id. 44 64 ) id. 4 :( inFuffe)+id. > A,+id. ; A, 4 5 << 6( id.++(
IIT Bombay
S,&
C>D C
=AR)
CCDPP
! 'erformance close but not good enough ! ,ust resort to implementing -;2E- in hardware
+ Si$'le6%,r%ose %ro0essor to %er orm &CT o$ : E : blo0k
Krithi Ramamritham / Kavi Arya IIT Bombay
C=DEC design
! > memory mapped registers + C_DATA"_RE /C_DATA#_RE ,sed to %,sh/%o% : E : blo0k i$to a$d o,t o C2&EC + C_C$%D_RE ,sed to 0omma$d C2&EC ! Writi$' 1 to this re'ister i$vokes C2&EC + C_!TAT_RE i$di0ates C2&EC do$e a$d ready or $eEt blo0k ! -olled i$ so tware ! 2irect translation of - code to BC2A for actual hardware implementation + "iEed6%oi$t versio$ ,sed ! -;2E- module in software changed similar to $A TH--2'' in implementation 8
Krithi Ramamritham / Kavi Arya IIT Bombay
+ Total eEe0,tio$ time or %ro0essi$' o$e ima'e8 ! </<;; se0o$ds 3well ,$der 1 se04 + -ower 0o$s,m%tio$8 ! </<)< watt ! I$0rease over 2 a$d ( be0a,se S2C has a$other %ro0essor + E$er'y 0o$s,m%tio$8 ! </<<<)< To,le 3</<;; s E </<)< watt4 ! Battery li e 12E lo$'er tha$ %revio,s im%leme$tatio$ZZ + Total 0hi% area8 ! 12:5<<< 'ates5 si'$i i0a$t i$0rease over %revio,s im%leme$tatio$s
Krithi Ramamritham / Kavi Arya IIT Bombay
Summary of implementations
0mplementation 8 0mplementation @ 0mplementation > ! 0mplementation @ ;/1 1/* </<;; + Close i$ %er orma$0e -er orma$0e 3se0o$d4 -ower 3watt4 </<(( </<(( </<)< + Chea%er Si.e 3'ate4 ;:5<<< ;<5<<< 12:5<<< + Qess time to b,ild E$er'y 3To,le4 </(< </<*< </<<)< ! 0mplementation > + Great %er orma$0e a$d e$er'y 0o$s,m%tio$ + Fore eE%e$sive a$d may miss time6to6market wi$dow ! I &CT desi'$ed o,rselves the$ i$0reased =RE 0ost a$d time6to6market ! I eEisti$' &CT %,r0hased the$ i$0reased IC 0ost ! Qhich is betterW
Krithi Ramamritham / Kavi Arya IIT Bombay
! %everal implementations
+ + + + Fi0ro0o$troller8 too slow Fi0ro0o$troller a$d 0o%ro0essor8 better5 b,t still too slow "iEed6%oi$t arithmeti08 almost ast e$o,'h Additio$al 0o%ro0essor or 0om%ressio$8 ast e$o,'h5 b,t eE%e$sive a$d hard to desi'$ + Tradeo s betwee$ hw/sw + the mai$ lesso$ o this 0o,rseZ
IIT Bombay
The world 'ets eE0iti$'D ! A%%le i-ad5 i$telli'e$t tra$s%ortatio$ systems5 servi0e robots5 D
Krithi Ramamritham / Kavi Arya IIT Bombay