24
A Comparison of the RTU Hardware RTOS A Comparison of the RTU Hardware RTOS with a Hardware/Software RTOS with a Hardware/Software RTOS Jaehwan Jaehwan Lee Lee + + , Vincent J. Mooney III , Vincent J. Mooney III ++ ++ { { jaehwan jaehwan , , mooney}@ece.gatech.edu mooney}@ece.gatech.edu , http:// , http:// codesign.ece.gatech.edu codesign.ece.gatech.edu ++ ++ Assistant Professor, Assistant Professor, + + School of Electrical and Computer Engineering School of Electrical and Computer Engineering ++ ++ Adjunct Assistant Professor, College of Computing Adjunct Assistant Professor, College of Computing Georgia Institute of Technology, Atlanta, GA, U.S.A. Georgia Institute of Technology, Atlanta, GA, U.S.A. Anders Anders Daleby Daleby *, Karl *, Karl Ingstr Ingstr ö ö m m *, *, Tommy Tommy Klevin Klevin ** and ** and Lennart Lennart Lindh Lindh ** ** {ady99002, kim99001, {ady99002, kim99001, klevin klevin , , llh}@mdh.se llh}@mdh.se * * M M ä ä lardalens lardalens University, University, Västerås, Sweden ** ** M M ä ä lardalens lardalens University and University and RealFast RealFast , , Västerås, Sweden Sweden 24 Jan 2003 at ASP 24 Jan 2003 at ASP - - DAC 2003 DAC 2003 HW/SW RTOS Project HW/SW RTOS Project ©Vincent J. Mooney III, 2003

A Comparison of the RTU Hardware RTOS with a Hardware

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Comparison of the RTU Hardware RTOS with a Hardware

A Comparison of the RTU Hardware RTOS A Comparison of the RTU Hardware RTOS with a Hardware/Software RTOSwith a Hardware/Software RTOS

JaehwanJaehwan LeeLee++, Vincent J. Mooney III, Vincent J. Mooney III++++

{{jaehwanjaehwan, , mooney}@ece.gatech.edumooney}@ece.gatech.edu, http://, http://codesign.ece.gatech.educodesign.ece.gatech.edu++++Assistant Professor, Assistant Professor, ++School of Electrical and Computer EngineeringSchool of Electrical and Computer Engineering

++++Adjunct Assistant Professor, College of ComputingAdjunct Assistant Professor, College of ComputingGeorgia Institute of Technology, Atlanta, GA, U.S.A.Georgia Institute of Technology, Atlanta, GA, U.S.A.

Anders Anders DalebyDaleby*, Karl *, Karl IngstrIngströömm*,*,Tommy Tommy KlevinKlevin** and ** and LennartLennart LindhLindh****{ady99002, kim99001, {ady99002, kim99001, klevinklevin, , llh}@mdh.sellh}@mdh.se

**MMäälardalenslardalens University, University, Västerås, Sweden****MMäälardalenslardalens University and University and RealFastRealFast, , Västerås, SwedenSweden

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

Page 2: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

22

OutlineOutlineIntroduction

Goal

Motivation

Methodology

Implementation

Experimental Results

Conclusion

Page 3: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

33

IntroductionIntroductionTrends in chip design

• multiple processor cores in system-on-a-chip (SoC)

• functionality moving from hardware to software

Trends in RTOS design• traditional software RTOS

• hardware/software RTOS

• hardware RTOS

Automatic configuration • for multiprocessor system-on-a-chip

• to support current trends

• to compare and contrast benefits of different RTOS options

Page 4: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

44

GoalGoal

To help the user examine different system-on-a-chip (SoC) architectures utilizing a hardware and/or software RTOS

Page 5: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

55

Motivation (1/5)Motivation (1/5)

An RTOS in hardware LOCALBUS

TDBI GBI

AcceleratorInterface

MsgQLib Scheduler

RTC

IRQReal-Time Unit (RTU)• scheduling• IPC• dynamic task creation• timers

Custom hw => upper bound on # tasksReconfigurable hw => can alter max. # tasks, max. # prioritiesProf. Lennart Lindh, Mälardalens U., Västerås, SwedenRealFast, www.realfast.se

Page 6: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

66

Motivation (2/5)Motivation (2/5)System-on-a-Chip Lock Cache

• A hardware mechanism that resolves the critical section (CS) interactions among PEs

• Lock variables are moved into a separate “lock cache”outside of the memory

• Improving the performance criteria in terms of lock latency, lock delay and bandwidth consumption

Pr1 Pr2 … PrN Lv2

Pr1 Pr2 … PrN LvK

Pr1 Pr2 … PrN Lv1

Data

Interrupts

Decoder

Control Logic

REWE

Address

Lv k : Lock variable k (k : 1 to K, K : number of locks)Pr i : Processor i (i : 1 to N, N : number of processors)RE : Read EnableWE : Write Enablep1, p2,…,pN: signals designating transactions from PE1, PE2,…,PEN,

respectively

. . .

Lock Unit

p1p2

pN

Page 7: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

77

Motivation (3/5)Motivation (3/5)SoCDMMU: System-on-a-Chip Dynamic Memory Management Unit

• Provides fast, deterministic and yet dynamic memory management of a global on-chip memory

• Achieves flexible, efficient memory utilization

• Provides APIs for applications

Page 8: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

88

Motivation (4/5)Motivation (4/5)SoCDDU: System-on-a-Chip Deadlock Detection Unit

• Performs a novel parallel hardware deadlock detection based on implementing deadlock searches on the resource allocation matrix in hardware

• Provides a very fast deadlock detection at run-time with dedicated hardware performing simple bit-wise boolean operations

• Reduces deadlock detection time by 99% as compared to software

• Requires at most O(2*min(m,n)) iterations as opposed to O(m*n) required by all previously reported (sequential) software algorithms

Page 9: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

99

Motivation (5/5)Motivation (5/5)δ framework

• Enables automatic generation of different mixes of the HW/SW RTOS

• Can be generalized to instantiate additional HW or SW RTOS components

Configuration and Comparison• RTU Hardware RTOS

• A HW/SW RTOS

Page 10: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1010

MethodologyMethodology

An SoC architecture with the RTU Hardware RTOS

RTU inReconfig.

Logic

Memory Controller

and Memory

Arbiter,Intr.

Controller,Clock

MPC755-2

L1

MPC755-1

L1

MPC755-3

L1

Page 11: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1111

MethodologyMethodology

An SoC architecture with a hardware/software RTOS

HW RTOS components in

Reconfig. Logic

Memory (Atalanta

RTOS)

Bus Arbiter,Intr.

Controller,Clock

MPC755-2

L1

MPC755-1

L1

MPC755-3

L1

Page 12: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1212

MethodologyMethodologyδ Framework

RTURTOS Info.

Makefile

User.h

Top.v

Hardware Description

Library

GUI Tool

SoftwareRTOS Info.

SWCompile

HWCompile

UserInput

Resultand

Feedback

Application RTOS Library

Compiled Hardware

Library

ExecutableHW

Simulation in

Seamless CVE

ExecutableSW

XRAY

Modelsim

Page 13: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1313

MethodologyMethodologyδ Framework – GUI

Page 14: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1414

Our RTOS and Possible Target Our RTOS and Possible Target SoCSoC

A multiprocessor System-on-a-Chip (Base architecture)

A multiprocessor RTOS

Application(s) running on the SoC using the RTOS APIs

H/WS/W

RTOS

MethodologyMethodology

Page 15: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1515

Our RTOS in DetailOur RTOS in Detail

Atalanta software RTOS• A multiprocessor SoC RTOS

the RTOS and device drivers are loaded into the L2 cache memory

• All Processing Elements (PEs)

share the kernel code and data structures

MethodologyMethodology

Page 16: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1616

Selectable RTOS IP componentsSelectable RTOS IP componentsSoftware (Atalanta RTOS)

• Inter-Process Communication (IPC) components

(semaphore, queue, event, mailbox, etc)

• Memory management module (gmm)

• Deadlock detection module (ddm)

Hardware• RTU Hardware RTOS

• SoC Lock Cache for fast IPC (SoCLC)

• Dynamic Memory Management Unit (SoCDMMU)

• Deadlock Detection Unit (SoCDDU)

MethodologyMethodology

Page 17: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1717

ImplementationImplementationRTU HW RTOS component integration method

RTU inReconfig.

Logic

Memory Controller

and Memory

Arbiter,Intr.

Controller,Clock

MPC755-2

L1

MPC755-1

L1

MPC755-3

L1

• Integrate user-selected HW RTOS components into the Base architecture

• RTU selection from GUI

• Start with architecture description

• Generate a Verilog top file

Page 18: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1818

ImplementationImplementationVerilog top file generation example

Desc RTU~~~

enddesc

IP Library• Start with RTU description clock clock_gen (SYSCLK);

cpu_mpc750 cpu1 (…);

\rtu.rtu(struct) rtu_comp (…);

arbiter arb (br_bar, bg_bar…);

(i)Generate

code• Generate instantiation code

multiple instantiations of same unit if needed (e.g., PEs) (ii) Add wires

and initial states

wire ADDR;wire DATA;wire BR_BAR;wire BG_BAR;wire SYSCLK;

…initial begin … end;

• Add wires and initial statements

(iii)After Instan-tiation

PEs 1,2,3,…

Memory 1,2,…

SoCLC

Arbiter

Clock

Page 19: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

1919

Experimental Results (1/4)Experimental Results (1/4)Application: Database transaction example [1]

[1] M. A. Olson, “Selecting and implementing an embedded database system,” IEEE Computer, pp.27-34, September 2000.

long_Req1

Access of Object O2

by transaction1

transaction1

transaction2

transaction3 O4

transaction4

short_Req4short_Req3

O2

O3

long_Req3

O4

O2

Access of Object O4

by transaction3

ServerClient

Page 20: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

2020

Experimental Results (2/4)Experimental Results (2/4)Comparison

• A system with RTU hardware RTOS

• A system with SoCLC hardware and software RTOS

• A system with pure software RTOS

* A semaphore is used in pure software and a hardware mechanism is used in SoCLC and RTU.

36%19%0%Speedup

279480317916379440(in cycles)30 tasks

50%41%0%Speedup

6703871365100398(in cycles)6 tasks

With RTUWith SoCLCPure SW *Total Execution Time

Page 21: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

2121

Experimental Results (3/4)Experimental Results (3/4)The number of interactions

5810Number of short locks

303Number of context switches

6012Number of semaphore interactions

30 tasks6 tasksTimes

Page 22: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

2222

Experimental Results (4/4)Experimental Results (4/4)The average number of cycles spent on communication, context switch

and computation (6 task case)

842185778523computation

283532313218context switch

2075373018944communication

With RTUWith SoCLCPure SWcycles

Page 23: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

2323

Hardware AreaHardware Area

About 250000 gates7435 gatesTSMC 0.25μm

library from LEDA

RTU for 3 processorsSoCLC (64 short CS locks + 64 long CS locks)Total area

Page 24: A Comparison of the RTU Hardware RTOS with a Hardware

24 Jan 2003 at ASP24 Jan 2003 at ASP--DAC 2003DAC 2003 HW/SW RTOS ProjectHW/SW RTOS Project©Vincent J. Mooney III, 2003

2424

ConclusionConclusion

Comparison between RTU hardware RTOS and a hardware/software RTOS

δ framework for automatic generation of configuration files for a custom HW/SW RTOS

Future work

• support for heterogeneous processors

• support for multiple bus systems/structures