19
Young Won Lim 7/16/16 HW / SW Implementation Overview (0A)

HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

Young Won Lim7/16/16

HW / SW Implementation Overview (0A)

Page 2: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

Young Won Lim7/16/16

Copyright (c) 2013 - 2016 Young W. Lim.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Please send corrections (or suggestions) to [email protected].

This document was produced by using OpenOffice and Octave.

Page 3: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 3 Young Won Lim

7/16/16

HW Implementation

RTL design

Gate netlist

GDS

i0

i1s

sb

a0

a1

zU0

U1

U2

U3

D Q

clk

always @(posedge clk) if (load) q = d;

Logic Synthesis

Physical Synthesismask

ASIC (Application Specific Integrated Circuit)

Page 4: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 4 Young Won Lim

7/16/16

NAND Gate

A Transistor Level A Layout

A Wafer processed

A Gate Level

Page 5: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 5 Young Won Lim

7/16/16

SW Implementation

C++ / Java Code

Assembly Code

ELF

int i, s=0;for(i=0; i<10; ++i) s+= i;

Compile

Link with libraries

addi $s1, $0, 0add $s0, $0, $0addi $t0, $0, 10...

Page 6: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 6 Young Won Lim

7/16/16

OS Kernel

● Process Management

● Multitasking

● Interrupts

● Modes

● Memory Management

● Virtual Memory

● Disk access

● File System

● Device Drivers

Page 7: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 7 Young Won Lim

7/16/16

Interrupt

INT

ISR2

SWI

ISR4

SoftwareInterrupt

Instruction

ISR2

ISR4

Hardware Interrupt

Software InterruptUser Mode

Non-user Mode

User Mode

Non-user Mode

Synchronous

Asynchronous

INT 0x80...

Page 8: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 8 Young Won Lim

7/16/16

Interrupt and Parallelism

INT

ISR2 ISR2

Hardware InterruptUser Mode

Non-user Mode

Asynchronous

Two parallel threads of execution

Simulate parallelism

Time sharing

Page 9: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 9 Young Won Lim

7/16/16

Timer & Interrupt

INT

ISR

Hardware Interrupt

Timer

TMR_Init()

TRG_IncTick()

CheckCallbacks()

void main(void) { TMR_Init(); TRG_Init(); EnableInterrupt();

for ( ; ; );}

callback(data)

TRG_SetTrigger( … );Setting callback function & data

Page 10: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 10 Young Won Lim

7/16/16

Multi-tasking

A

● Time Slice● Time Sharing● Round Robin Scheduling● Context Switching

B

C

A

B

C

timer tick interrupt

Task A Thread

Task B Thread

Task C Thread

Page 11: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 11 Young Won Lim

7/16/16

GPIO

D Q

D Q

● write to port address

● read from port address

● write to port direction register

Page 12: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 12 Young Won Lim

7/16/16

HW (ASIC) & SW Implementations

RTL design

Gate netlist

GDS

Logic Synthesis

Physical Synthesis

C++ / Java Code

Assembly Code

ELF

Compile

Link with libraries

Parallelism is ensured by spatial allotment in a chip

Parallelism is ensured by temporal processing on a processor

HW (ASIC) SW

Page 13: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 13 Young Won Lim

7/16/16

FPGA Architecture

A Logic Block

A Configurable Interconnection

FPGA (Field Programmable Gate Array)

Page 14: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 14 Young Won Lim

7/16/16

1

0

1

0

0

0

0

1

Implementing Boolean Functions

0 1 1

0 1 0

0 0 1

0 0 0

1 1 1

1 1 0

1 0 1

1 0 0

inputs output

x y z

3

2

0

1

7

6

4

5

index

F

1

0

1

0

0

0

0

1

Size : 23 x 1

address3bits

Data 1 bit

LUT (Look up table)

A Logic Block

Memory

A Truth Table

Combinational Logic

Page 15: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 15 Young Won Lim

7/16/16

Configuring Logic Blocks

A Logic Block

select

LUT SRAM cells

An 2-bit SRAM cell

Page 16: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 16 Young Won Lim

7/16/16

Configuring Interconnections

An 1-bit SRAM cell

An 1-bit SRAM cell

Page 17: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 17 Young Won Lim

7/16/16

HW (FPGA) Implementations

RTL design

Gate netlist *

“Programming File”

Logic Synthesis

Physical Synthesis

FPGA configuration information

HW (FPGA)

select

LUT SRAM cells

An 2-bit SRAM cell

An 1-bit SRAM cell An 1-bit SRAM cell

LUTs, FF, etc

Page 18: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

HW SW Implementation Overview (0A) 18 Young Won Lim

7/16/16

HW (FPGA) & SW Implementations

RTL design

Gate netlist

“Programming File”

Logic Synthesis

Physical Synthesis

FPGA configuration information

HW (FPGA)

C++ / Java Code

Assembly Code

ELF

Compile

Link with libraries

SW

Machine Instructions of a processor

0100101...FPGA configuration information

10111011...

Page 19: HW / SW Implementation Overview (0A) - Wikimedia › wikiversity › en › d › d7 › SOC8.0.A.HW-… · HW SW Implementation Overview (0A) 17 Young Won Lim 7/16/16 HW (FPGA) Implementations

Young Won Lim7/16/16

References

[1] http://en.wikipedia.org/[2] D.M. Harris, S. L. Harris, “Digital Design and Computer Architecture”