hardware/software co-design models and reconfigurability...

30
0 Micaela Serra Hardware/Software Co-Design Embedded Systems Design Reconfigurability FPGA Models and Architectures Models and Languages HDL Handel C C++ UML System C Spec C SpecCharts

Upload: others

Post on 19-Jan-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

0Micaela Serra

Hardware/Software Co-Design

Embedded Systems Design

Reconfigurability

FPGA

Models and Architectures Models and

Languages

HDLHandel C

C++UML

System CSpec C

SpecCharts

Page 2: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

1Micaela Serra

What is Hardware / Software Co-Design?

Cooperative design of hardware and software components

Unification of separate hardware and software paths

Free movement of functionality between hardware and software during design exploration

Attempt to utilize the “synergy” between hardware and software

CODESIGNTOOLS

high level

descriptionsystem

HW SWVHDL

C code

HWSYNTHESIS

COMPILER

ASIC / FPGA PROM µP⇔

100110101

if (x>0)a=1;

Page 3: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

2Micaela Serra

What is an Embedded System?

Any item including a programmable device, not intended to be general purpose, with many interface units to measure, control, manipulate the external environment

CPUMEMORY

FPGA/ASIC SOFTWAREA/D & D/A

conversion

ACTUATORS

SENSORS

EXTERNALENVIRONMENT

DIAGNOSTICS

HUMANINTERFACE

Page 4: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

3Micaela Serra

Applications Very diverse applicationsVery diverse domainsWhat are the common characteristics?

Ferrari Testarossa

Page 5: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

4Micaela Serra

Embedded (Mechatronics) Systems

Example: car transmission

Microprocessor observing and controlling a car’s automatic transmission

observe engine rpm, manifold pressurecontrol shifter, engine throttle

real time & fault tolerance requirements in a closed-loop controlinterface with a larger mechanical system (“embedded”)software requirement

Page 6: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

5Micaela Serra

Design issues

portability and remote useReliability

Robustness

critical new wave?Development tools

migrating to high level languages constrained by RAM size

Software

not critical (except video games)Performance

small RAM, large ROMOn-chip memory

Portable or notPower consumptionsmall 8-bit often acceptableSizemany optionsI/O capability

Cost

Page 7: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

6Micaela Serra

A block diagram of a microwave oven

ROMProcessor

Inputkeys

Door open

Bus

OutputInterface

InputInterface

Magnetron Fan

Displays Light

Speaker

RAM

EMBEDDED PROCESSOR CHIP

Page 8: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

7Micaela Serra

System Hardware/Software Co-Design

SystemSpecifications

SystemIntegration

incremental evaluation

Integrated Modelling

SoftwareDesign & Test

SoftwareRequirements

HardwareArchitecture

HardwareFunctionality

Page 9: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

8Micaela Serra

What are the Goals of Co-Design?

Integrating the Software and Hardware processes

Unified design environment

Incremental evaluation of process

Requirements

Design

Testing

Page 10: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

9Micaela Serra

What are the Challenges in Co-Design?

HW/SW split decided early, on ad hoc basis

Ability to explore HW/SW trade-offs is restricted

Different cultures hamper integration

Cost increases and schedule over-runs

Page 11: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

10Micaela Serra

What are the Co-Design Research Areas?

(1) Co-specification

How to model the system?

(2) Partitioning

What functions go in hardware versus software?

(3) Co-synthesis

Generate HW/SW componentsCreate HW/SW communication

(4) Co-simulation

Simulate HW/SW components interacting in

real time

Page 12: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

11Micaela Serra

Modelling

What is the best methodology for specifying HW/SW system?

a high-level functional / algorithmic spec?HW-type language (VHDL, HW-C) or SW-type (C, C++)?formal spec language? (provably correct)same/different methods for HW vs. SW specs? (avoid too early binding)

Internal Representation (Co-modelling)

Page 13: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

12Micaela Serra

Elevator Controller“If the elevator is stationary and the

floor requested is equal to the current floor, then the elevator remains idle.

If the elevator is stationary and the floor requested is less than the current floor, then lower the elevator to the requested floor.

If the elevator is stationary and the floor requested is greater than the current floor, then raise the elevator to the requested floor”

loopif (req_floor = curr_floor) then

direction := idle;elseif (req_floor < curr_floor) then

direction := down;elseif (req_floor > curr_floor) then

direction := up;end if;

end loop;

idledown upreq_floor=curr_floor req_floor=curr_floorreq_floor>curr_floorreq_floor<curr_floor

req_floor<curr_floorreq_floor>curr_floor

req_floor>curr_floorreq_floor=curr_floorreq_floor<curr_floor

Page 14: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

13Micaela Serra

PartitioningHow to divide specified functions between HW & SW?

based on functional spec + constraints (timing, cost, size, power)primarily manual so far; want to automategeneric specs, use heuristics or interactive guidance (with quick evaluation) to divide

Approachesstart with all HW, extract functions to move to SW, stop when performance constraints are violatedstart with all SW, extract performance critical portions

CriteriaFor system tasks:

Does task interact closely with the O.S? ==> S/WDoes task interact closely with external signals? ==> H/W

For remaining tasks: cost and speed.

Efficiency of a system is directly related to how the functionality in H/W or S/W is allocated

Page 15: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

14Micaela Serra

Co-synthesis and Co-simulation

Generating the HW & SW componentsHW synthesis built on existing CAD tools generate HW / SW interprocess communicationschedule SW processes to meet timing constraints (static vs. dynamic)

H/W \ S/W IntegrationSW and HW operate as separate processes and communicate through suitable IPC (inter-process communication) mechanisms (e.g. Unix sockets)

Co-simulation: evaluating the synthesized designsimulate SW & HW components interacting in real timefor design / constraint verification, performance estimationfor feedback to partitioning step

Page 16: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

15Micaela Serra

Hardware/Software Co-Design Process

Feedback from co-simulation to partitioning

Interface designAs partition changes so must

the interface between hardware and software

Implicit in the process is a unified system representation that can move to a hardware, software, and interface representation

System Specification

System Partitioning

Co-Synthesis

Co- SimulationSystem Integration

InterfaceSoftware Hardware

Page 17: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

16Micaela Serra

What is the hardest task? Interface Development

Application Operating System PCI Bus PCI

Interface Experiment

Host System FPGA

Device Driver

SoftwareInterfaceController

HardwareInterfaceController

Interface

Page 18: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

17Micaela Serra

Multidisciplinary Topic

New product

CAD engineer• develop tools

Design Architect• specifications, behavior• operating range• environment• architecture

Design Engineer• design of functional blocks• interconnection between blocks• e.g., schematic

Design Technician• select technology• actual hardware realization• block implementation• gate/transistor

Testing Engineer• develop test strategies• checks specifications, e.g., setup time

Manufacturing Engineer• dimensions of objects• layout, location, etc

Marketing• study market needs • determine requirements• common English language

Software Engineer• design the code

Page 19: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

18Micaela Serra

Some Observations on Embedded Systems

Embedded system's behavior is defined by its interaction with its environmentCPU is only a specialized part of the systemThe functionality provided is specific to the applicationOne does not design an embedded computer one designs an embedded systemOften there is dedicated software / OS (customizable)Often it replaces electromechanical componentPossibly no keyboardInterdisciplinary design area

Page 20: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

19Micaela Serra

System Types

Data-dominated

Transform input stream into output stream

Heavy digital signal processing

Often modeled using dataflow diagrams

Cell Phone

Control-dominated

Reactive real-time stimulus/response

Often modeled with state transition diagramsAutomatic Teller Machine (ATM)

But how do we describe these systems?

Page 21: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

20Micaela Serra

Typical Characteristics of Embedded Systems - Functionalities

State TransitionsIntrinsically state-based Constant transitions from one mode/state to another

Behavioral HierarchyFunctionality is more easily conceptualized as behavior

Behavioral CompletionFinite activities may not terminate solely by external events but continue until behavior completion May need to initiate a new activity at time of completion

Concurrency Both Task-level and Statement-level concurrency

Exceptions Certain events require an instantaneous response Interrupt handling is crucial

Complex algorithmsUsually with complex programming constructs

Complex Users InterfacesMultiple menus & options (e.g. navigational maps for GPS)

Page 22: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

21Micaela Serra

Typical Characteristics of Embedded Systems – Timing and Costs

Real TimeCorrectness of computation depends on the time it is delivered Failure to meet deadlines might create safety issues or simply unhappy customersMostly reactive computation –it executes as a response to external events

MultirateSeveral real time activities at the same time (e.g. audio and video portions in multimedia)

Manufacturing CostsCrucial for marketingMicroprocessor, flash memory, I/O, sensors

Power Battery life! Heat dissipation!Peaks of use!

Page 23: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

22Micaela Serra

Typical Embedded Systems Functional Requirements

Control laws (e.g. PID control, fuzzy control)

Sequencing control (e.g. FSMs, mode changes, switching between control laws)

Signal processing (e.g. voice, video)

Fault response (e.g. detection, reconfiguration)

Application-specific user interface device

(e.g. buttons, bells, lights)

Page 24: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

23Micaela Serra

Typical Embedded Systems Non-functional Requirements

Performance

Power consumption

CostPhysical sizeand weight

Purpose Usability

Page 25: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

24Micaela Serra

Development and Debugging

ParallelI/O ports

SerialI/O ports

Counter/Timer

Processorcore

Internalmemory

A-to-D conversion

D-to-A conversion

Host System

Target Systemcross-compilers

testbench hardware

testbench software

Page 26: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

25Micaela Serra

Questions in Designs?

Complex testingLimited observabilityand controllability

Restricted developmentenvironment

How much hardware do

we really need?

How do we meet

deadlines?

How do we minimize power consumption?

How do we design for

upgradeability?

Does it really work?

Page 27: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

26Micaela Serra

Models & Languages

PureModellingSystems

PureImplementation

Languages

A model provides an abstract view of:

•its functionality•its characteristics•how the system works

set of functional

objects

methods for composing

objects+

compiled into

machine code

simulation for testing and verification

configuration files

Page 28: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

27Micaela Serra

Characteristics of Models

Comprehensibledesigners can understand it

Formalcontains no

ambiguity

Flexibleeasy to modify its functionality

Completedescribes the entire system

Naturalaids rather than

impedes the design

To be useful

a model must be:

Page 29: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

28Micaela Serra

Model Taxonomy

state-oriented activity-oriented

structure-oriented data-orientedheterogeneous

finitestate

machines

Petrinets

hierarchicalconcurrent finitestate machines

transition(Mealy)

state(Moore)

dataflowgraphs

flowcharts

block diagram;schematic

entityrelationship

control/dataflowgraphs

programstate

machine

Page 30: Hardware/Software Co-Design Models and Reconfigurability …webhome.cs.uvic.ca/~mserra/AttachedFiles/Codesign... · 2006. 4. 23. · Hardware/Software Co-Design Embedded Systems Design

29Micaela Serra

Acknowledgements

“Computers as Components”by W. Wolf, Morgan Kaufmann Pub.

“Specification and Design of Embedded Systems”by D. Gajski, F. Vahid, S. Narayan, J. Gong, Prentice Hall.

“Embedded System Design: A Unified Hardware/Software Introduction”

by F. Vahid and T. Givargis, John Wiley & Sons.“Embedded System Design Issues (the Rest of the Story)”

by P. Koopman, CMU