Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Embedded System Design (BEE-446) : General-Purpose Processors (Software)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Embedded System Design (BEE-446)

BEE-446 2011

Winter in Islamabad 2011

Lecture #06

General-Purpose Processors (Software)


Muhammad Jameel <muhammad.jameel@seecs.edu.pk>

Outline
Parallel Port Driver Example Application Specific Instruction Set Processors (ASIPs) Selecting a microporcessor

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

Example: parallel port driver


LPT Connection Pin 1 2-9 10,11,12,13,15 14,16,17 I/O Direction Output Output Input Output Register Address 0th bit of register #2 0th bit of register #2 6,7,5,4,3th bit of register #1

Pin 13

PC Parallel port
Pin 2 LED

Switch

1,2,3th bit of register #2

Using assembly language programming we can configure a PC parallel port to perform digital I/O
parallel port monitors the input switch and turns the LED on/off accordingly

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

Parallel Port Example


; This program consists of a sub-routine that reads ; the state of the input pin, determining the on/off state ; of our switch and asserts the output pin, turning the LED ; on/off accordingly .386 CheckPort push push dx mov in and cmp jne SwitchOff: mov in and out jmp SwitchOn: mov in or out Done: pop pop CheckPort proc ax extern C CheckPort(void); // defined in // assembly void main(void) { while( 1 ) { CheckPort(); } }

; ; dx, 3BCh + 1 ; al, dx ; al, 10h ; al, 0 ; SwitchOn ;

save the content save the content base + 1 for register #1 read register #1 mask out all but bit # 4 is it 0? if not, we need to turn the LED on

Pin 13

PC Parallel port
Pin 2 LED

Switch

dx, 3BCh + 0 ; base + 0 for register #0 al, dx ; read the current state of the port al, f7h ; clear first bit (masking) dx, al ; write it out to the port Done ; we are done

LPT Connection Pin


dx, al, al, dx, 3BCh + 0 ; base + 0 for register #0 dx ; read the current state of the port 01h ; set first bit (masking) al ; write it out to the port ; restore the content ; restore the content

I/O Direction Output Output Input Output

Register Address 0th bit of register #2 0th bit of register #2 6,7,5,4,3th bit of register #1 1,2,3th bit of register #2

1 2-9 10,11,12,13,15

dx ax endp

14,16,17

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

Application-Specific Instruction-Set Processors (ASIPs)


General-Purpose Processors (GPPs)
Sometimes too general to be effective in demanding application
e.g., video processing requires huge video buffers and operations on large arrays of data, inefficient on a GPP

Single-Purpose Processor (SPP) has high NRE, not programmable

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

Application-Specific Instruction-Set Processors (ASIPs)


ASIPs targeted to a particular domain
Contain architectural features specific to that domain
e.g., embedded control, digital signal processing, video processing, network processing, telecommunications, etc.

Still programmable

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

A Common ASIP: Microcontroller


For embedded control applications
Reading sensors, setting actuators Mostly dealing with events (bits): data is present, but not in huge amounts e.g., VCR, disk drive, digital camera (assuming SPP for image compression), washing machine, microwave oven

Microcontroller features
On-chip peripherals
Timers, analog-digital converters, serial communication, etc. Tightly integrated for programmer, typically part of register space

On-chip program and data memory Direct programmer access to many of the chips pins Specialized instructions for bit-manipulation
Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik 7

Another Common ASIP: Digital Signal Processors (DSP)


For signal processing applications
Large amounts of digitized data, often streaming Data transformations must be applied fast e.g., cell-phone voice filter, digital TV, music synthesizer

DSP features
Several instruction execution units Multiple-accumulate single-cycle instruction, other instrs. Efficient vector operations e.g., add two arrays

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

Trend: Even More Customized ASIPs


In the past, microprocessors were acquired as chips Today, we increasingly acquire a processor as Intellectual Property (IP)
e.g., synthesizable VHDL model

Opportunity to add a custom datapath hardware and a few custom instructions, or delete a few instructions
Can have significant performance, power and size impacts Problem: need compiler/debugger for customized ASIP
One solution: automatic compiler/debugger generation
e.g., www.tensillica.com

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

Selecting a Microprocessor
Issues
Technical: speed, power, size, cost Non-Technical: development environment, prior expertise, licensing, etc.

Speed: how evaluate a processors speed?


Clock speed but instructions per cycle may differ Instructions per second but work per instr. may differ Dhrystone: Synthetic benchmark, developed in 1984. Dhrystones/sec.
MIPS: 1 MIPS = 1757 Dhrystones per second (based on Digitals VAX 11/780). A.k.a. Dhrystone MIPS. Commonly used today.
So, 750 MIPS = 750*1757 = 1,317,750 Dhrystones per second

SPEC: set of more realistic benchmarks, but oriented to desktops EEMBC EDN Embedded Benchmark Consortium, www.eembc.org
Suites of benchmarks: automotive, consumer electronics, networking, office automation, telecommunications
Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik 10

Selecting a Microprocessor
Dhrystone: Synthetic benchmark, developed in 1984. Dhrystones/sec.
http://www.roylongbottom.org.uk/

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

11

General Purpose Processors


Processor Intel PIII Clock speed 1GHz Periph. 2x16 K L1, 256K L2, MMX 2x32 K L1, 256K L2 2x32 K 2 way set assoc. None Bus Width MIPS General Purpose Processors 32 ~900 Power 97W Trans. ~7M Price $900

IBM PowerPC 750X MIPS R5000 StrongARM SA-110 Intel 8051 Motorola 68HC811

550 MHz

32/64

~1300

5W

~7M

$900

250 MHz 233 MHz

32/64 32

NA 268

NA 1W

3.6M 2.1M

NA NA

12 MHz 3 MHz

4K ROM, 128 RAM, 32 I/O, Timer, UART 4K ROM, 192 RAM, 32 I/O, Timer, WDT, SPI 128K, SRAM, 3 T1 Ports, DMA, 13 ADC, 9 DAC 16K Inst., 2K Data, Serial Ports, DMA

8 8

Microcontroller ~1 ~.5

~0.2W ~0.1W

~10K ~10K

$7 $5

TI C5416

160 MHz

Digital Signal Processors 16/32 ~600

NA

NA

$34

Lucent DSP32C

80 MHz

32

40

NA

NA

$75

Sources: Intel, Motorola, MIPS, ARM, TI, and IBM Website/Datasheet; Embedded Systems Programming, Nov. 1998

Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis And Dr. Osman Hassan, Modified By : Jameel Nawaz Malik

12

You might also like