• No results found

ECE 448 Lecture 19. Software/Hardware Co-design Using the FPro System Part 1: Sorting Core. George Mason University

N/A
N/A
Protected

Academic year: 2021

Share "ECE 448 Lecture 19. Software/Hardware Co-design Using the FPro System Part 1: Sorting Core. George Mason University"

Copied!
29
0
0

Loading.... (view fulltext now)

Full text

(1)

George Mason University

Software/Hardware Co-design

Using the FPro System

Part 1: Sorting Core

ECE 448

(2)

2

Developing a software/hardware

implementation using an FPro system

Conceptual Design:

C1. Software/hardware partitioning C2. I/O register map of the IP core

Hardware Design:

H1. Basic circuit performing the required functionality

* datapath * controller * top-level * functional verification H2. A wrapper matching the interface of an MMIO core

* design adjustments * coding * functional verification

Software Design:

S1. Software driver

* declarations (.h) * implementations (.cpp) * testing

(3)

3

Software/Hardware Co-design

(4)

4

Software/Hardware Co-design

time C1 C2 H1 H2 S1 S2 C1 C2 H1 H2 S1 S2 C1 C2 H1 H2 S1’ S1”

Approach 1 Approach 2 Approach 3

S2’

S2’’

Driver development

App development Part 1 & preliminary testing

Driver testing

App development Part 2 & final testing

SW/HW partitioning

Custom core – basic function

I/O Register Map

(5)

Software/Hardware Partitioning: Lab 5

5

• Setting Size of Memory • Initializing Memory

• Display Mode

• Sorting in Software • Cycle Count Display

• Sorting in Hardware Application [main_sorting.cpp]: Custom Core [sorting_core.vhd]: Custom Driver [sorting_core.h, sorting_core.cpp]: • SortingCore class • Transfer of Data SW=>HW • Sorting in Hardware • Reading Results HW=>SW

Independent of hardware core:

(6)

Standard Drivers to be Used

6

Driver Major Functionality Description of functions in

TimerCore Measuring Time timer_core.h GpiCore Reading positions

of switches

gpio_cores.h

DebounceCore Detecting which button was pressed

gpio_cores.h

SsegCore Writing to seven segment displays

sseg_core.h

UartCore Debugging using

messages displayed in a terminal window of your computer

(7)

#include "chu_init.h" #include "gpio_cores.h" #include "sseg_core.h"

Beginning of

main_sorting.cpp

No need to have #include "timer_core.h" #include "uart_core.h"

(8)

8

Developing a software/hardware

implementation using an FPro system

Conceptual Design:

C1. Software/hardware partitioning

C2. I/O register map of the IP core

Hardware Design:

H1. Basic circuit performing the required functionality

* datapath * controller * top-level * functional verification

H2. A wrapper matching the interface of an MMIO core * design adjustments * coding * functional verification

Software Design:

S1. Software driver

* declarations (.h) * implementations (.cpp) * testing

(9)

Sorting

Sorting

clk reset DataIn w DataOut w Done RAdd k WrInit s (0=initialization/readout 1=computations) Rd

(10)

Simulation results for the sort operation (1)

Loading memory and starting sorting

clk reset

(11)

Simulation results for the sort operation (2)

Completing sorting and reading out memory

clk reset

(12)

Before sorting

During Sorting

After

sorting Address

0

1

2

3

3

3

2

2

1

1

1

1

2

2

3

3

3

3

2

2

4

4

4

4

4

4

4

3

1

1

1

1

2

2

3

4

i=0 i=0 i=0 i=1 i=1 i=2 j=1 j=2 j=3 j=2 j=3 j=3 Mi Mj Legend: position of memory indexed by i position of memory indexed by j

(13)

Pseudocode

wait for s=1 for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(14)

DINA DOUTA ADDRA WEA DINB ADDRB WEB DOUTB RAM 2k x w Mi Mj w w k w w k

(15)

Pseudocode

wait for s=1 // initialize internal memory for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(16)

DINA DOUTA ADDRA WEA 0 1 s WrInit clk Wr DataIn w w

Block diagram of the Datapath

s 0 1 DINB ADDRB WEB Wr DOUTB RAM 2k x w Mi Mj w w w w Addr s 0 1 RAdd k i j k k w w k

(17)

Pseudocode

wait for s=1 for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(18)

DINA DOUTA ADDRA WEA 0 1 s WrInit clk Wr Addr s 0 1 DataIn RAdd ld en Li Ei clk w k k k w w i j 0 k +1

Block diagram of the Datapath

s 0 1 counter DINB ADDRB WEB Wr DOUTB RAM 2k x w w Mi Mj w ld en Lj Ej clk counter w w w k k k

(19)

Pseudocode

wait for s=1 for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(20)

DINA DOUTA ADDRA WEA 0 1 s WrInit clk Wr Addr s 0 1 DataIn RAdd ld en Li Ei clk == N-2 == N-1 zi zj w k k k w w i j 0 k +1

Block diagram of the Datapath

s 0 1 counter DINB ADDRB WEB Wr DOUTB RAM 2k x w w Mi Mj w ld en Lj Ej clk counter w w w k k k

(21)

Pseudocode

wait for s=1 for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(22)

DINA DOUTA ADDRA WEA A>B 0 1 s WrInit clk Wr MigtMj Addr s 0 1 DataIn RAdd ld en Li Ei clk == N-2 == N-1 zi zj w k k k w w A i j 0 k +1

Block diagram of the Datapath

s 0 1 counter DINB ADDRB WEB Wr DOUTB RAM 2k x w B AgtB w Mi Mj w ld en Lj Ej clk counter w w w k k k

(23)

Pseudocode

wait for s=1 // read out results

for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(24)

DINA DOUTA ADDRA WEA A>B 0 1 s WrInit clk Wr 1 0 MigtMj Addr s 0 1 DataIn RAdd Rd DataOut ld en Li Ei clk == N-2 == N-1 zi zj w k k k w w w A i j 0 k +1

Block diagram of the Datapath

s 0 1 counter DINB ADDRB WEB Wr DOUTB RAM 2k x w B AgtB w Mi Mj w 0 w ld en Lj Ej clk counter w w w k k k

(25)

w clk DataOut w WrInit s Done Wr Li Ei Lj Ej Datapath Controller RAddr k zi

Interface with the division into

the Datapath and Controller

DataIn Rd

MigtMj zj

(26)

Pseudocode

wait for s=1 for i=0 to N-2 do for j=i+1 to N-1 do if Mi > Mj then Swap Mi with Mj end if end for end for Done wait for s=0 go to the beginning

(27)

ASM

Chart

i=0 s j=i+1 Read Mi Read Mj Mi>Mj Swap Mi with Mj j=N-1 i=N-2 s Done j++ i++ reset 0 1 T F T F F T 0 1 S0 S1 S2 S4 S3

(28)

ASM

Chart

Li s Lj MigtMj zj zi s Done Ej Ei reset 0 1 1 0 1 0 0 1 0 1 S0 S1 S2 S4 S3 Wr

(29)

Timing Analysis

S2 S3 S2 S3 State new j new j j new Mi new Mi Mi new Mj new Mj Mj

new MigtMj new MigtMj MigtMj

new Wr new Wr Wr

References

Related documents

- Ak bude bielizeň následne sušená v sušičke bielizne, zvoľte otáčky odstredenia podľa návodu výrobcu sušičky.. Downloaded From

Kala III dimulai sejak bayi lahir sampai lahirnya plasenta. Proses ini merupakan kelanjutan dari proses persalinan sebelumnya. Selama kala III proses pemisahan

The second column shows our estimated production coefficients (in person-hours per item produced) based on the data shown in Table 5.. The third column shows the values from Banker

An area of imbalance in the debate is that allegations surrounding autism cause outrage, while measles, for example, is understood as a benign rite of passage

In this paper, we propose a hybrid method as a feature selection, based on the central points of attribute values and an Association Rule Mining algorithm to

D. Selbst ¨andigkeitserkl ¨arung 120.. The three components of RuPd1. Localization of excited states in Rudppz. Absorption and emission spectra of Rudppz1, Rudppz4 and

I wish to explore this issue in the contest of administrative proceedings before a Canadian provincial securities commission (the example I will use is the British Columbia Securities

Banks can successfully manage bank risks by recognizing the strategic role of risk management, by using the paradox of analysis and management to increase efficiency, by