SlideShare a Scribd company logo
Linux Runs on the SoCKit
Board with the GPGPU
AJ (張仁傑)
<ajblane0612@gmail.com>
2015.1.31
Outline
• Nyuzi processor
• Global System Reference Design (GSRD)
Nyuzi Processor特色-SIMD
• A custom RISC instruction set (load-store architecture)
• 30 general purpose scalar registers
• 32 vector registers, each with 16 lanes
• Instructions are 32-bit fixed length and must be 32-bit aligned
des op2 op1 mask
add_i_mask v1, s2, v2, v3
Nyuzi Processor特色
• 同時抓4個指令,切換執行
對Nyuzi processor看法:
如果在Nyuzi processor上面加上OS,context
switch感覺是個悲劇
不過作者為了3D render,有在上面實作一
個小型OS來切換(?)
如何讓Nyuzi processor開始
執行,需要手動boot 與載
入code
$ jload boot.hex
$ bin/serial_boot program.elf
GPGPU
Niso II
The DE2-115 Board
Ubutun14.10
USB Blaster-JTAG Clock rate: ~60 Mhz
如何實現?
Niso II
The DE2-115 Board
GPGPU
Memory
UART
0
0xffffffff
serial_boot.c
解譯program.ELF
4. boot.c等待serial_boot.c
的command並開始寫入
hex code至memory
5. serial_boot.c告知
boot.c,code已經搬移結束.跳
至start.s
stack
0x2000
code
JTAG Loader
PC
start.s
boot.c stack
0x200000
1. GPGPU reset後從address 0開
始執行
2. start.s 設定sp = 0x2000
3. 跳至boot.c
6. 設置PC開始執行,並把
sp設置0x200000 (?)
boot.hex
Ubutun14.10
step1 step6 step4
告知GPGPU把HEX code 寫至board memory
start.s boot.c
$ jload boot.hex
$ bin/serial_boot program.elf
怎那麼麻煩?
作者沒有在板子上使用
OS(提供服務)
我們有什麼?
• 硬體: the SoCKit board
• RocketBoards.org組織提供的GSRD 14.1 for the SoCKit board
我怎會有這個板子?
• 開放原始碼專案協作 (2014 年暑期)
GSRD
• 提供開發者有一個Linux
環境可以操作FPGA
• Software IP
• Linux Driver
• File I/O來操作Software IP
• 開發流程概念:
• 先有個Image,先run.再針
對各部分update
• 細節可參考
• Booting Linux Using
Prebuilt SD Card Image
• Creating and Updating SD
Card
來看Altera Hard Process System (HPS)
• H2F
• High bandwidth
• Light weight
• F2H (FPGA to HPS system)
• F2S (FPGA-to-HPS SDRAM Interface)
Cyclone V HPS Memory Map
• 在SoCKit版中,Cortex-A9可主動透過
H2F傳資料給software IP
• LWAXI
• 0xFF200000 ~0xFF3FFFFF(2MB)
• HPS2FPGA (high bandwidth)
• 0xC000000開始
Golden Hardware
Reference Design
(GHRD)
• On-Chip RAM需高頻寬傳輸,
控制周邊就不須使用高頻寬
F2H
F2S
在SoCKit版中,software IP可透過F2H、F2S主動傳資料到memory與Cortex-A9溝通
如何設計software IP與memory溝通
參考SoCKit Video Server and Video IP (VIP) Reference Design設
LWAXI
F2H
使用Qsys連接AXI master/slave
Software IP使用Qsys,有這麼簡單@@?
• 必須了解AXI master slave
• AMBA AXI and ACE Protocol Specification AXI3, AXI4, and AXI4-Lite, ACE and ACE-Lite
• 我不了解,但我會改 Demo AXI Memory Design Example
• Qsys System Design Tutorial
• 注意細節:
• 所有AXI master或者slave的pin都要宣告
• AXI slave's ID bit width
• If an AXI slave's ID bit width is smaller than required for your system, the AXI slave response
might not reach all AXI
• maximum_master_id_width_in_the_interconnect +
log2(number_of_masters_in_the_same_interconnect)
• 所以我把Nyuzi Processor製作成Qsys元件
Software IP開發者角度
+0xff20 0000
軟體開發者角度
有了GSRD我們可以怎修改
Qsys會自動產生
LWAXI
F2H自動忽略XD
[MOSUT20150131] Linux Runs on SoCKit Board with the GPGPU
經過下列步驟,就可以撰寫程式來測試FPGA是
否有加成功? Yes, it works.
• Converting .sof to .rbf
• Device tree generation
• 給寫driver用的。概念上就是知道I/O的name,就可以透過查詢
Device Tree得到address來操作[跨板子設計]
• Preloader image generation
• 會產生出preloader的source code ,所以有些FPGA初始化設定
可以在這裡撰寫編譯
• Configure Pinmux
• Preloader and U-Boot Customization - v13.1
• Updating SD card
過程與細節可參考我的研究紀錄
這流程是對於GDRD,如果是VIP RD就不行
Niso II
The DE2-115 Board
GPGPU
Memory
UART
0
0xffffffff
serial_boot.c
解譯program.ELF
4. boot.c等待serial_boot.c
的command並開始寫入
hex code至memory
5. serial_boot.c告知
boot.c,code已經搬移結束.跳
至start.s
stack
0x2000
code
JTAG Loader
PC
start.s
boot.c stack
0x200000
1. GPGPU reset後從address 0開
始執行
2. start.s 設定sp = 0x2000
3. 跳至boot.c
6. 設置PC開始執行,並把
sp設置0x200000 (?)
boot.hex
Ubutun14.04
step1 step6 step4
告知GPGPU把HEX code 寫至board memory
start.s boot.c
Cortex-A9
The SoCKit Board
GPGPU
Memory
0 0xffffffff
stackcode
PC
Ubutun14.04
LINUX
HPS
SD card
Program.hex produced by elf2hex
LWAXI
Address data
0xFF200000 RESET
0xFF200004 Code base address
0xFF200008 Stack address
(*highest* stack)
0xFF20000C Heap address
0xFF200010 Frame address
1. 透過Linux宣告code空間,並設置code base
address、stack address
• fd = open(“/dev/mem”,..)
• used_ptr = mmap(..,fd,0xff200000)
2. cortex-A9從SD card搬code至指定memory
3. 透過cortex-A9來控制GPGPU RESET signal
step 1
step 2
F2H
LWAXI
F2H
boot.hex
• How to build
• Elf2hex is as a loader
• Tutorial: Creating an LLVM Backend for the Cpu0 Architecture
LLVM-nyuzi is built to the target
Cortex-A9
The Sockit Board
LINUX
HPS
SD card
ld.mcld
llvm-ar
elf2hex
clang
.s, .c, .cpp .o
.a.o
.elf
.hex
.hex
整個流程打通之後,越來越像…..
實現CPU/GPU無縫切換運算,HSA催生下世代處理器 CUDA LLVM Compiler

More Related Content

PPTX
[SITCON2015] 自己的異質多核心平台自己幹
PPTX
閱讀文章分享@若渴 2016.1.24
PPTX
StackOps step by-step guide
PDF
Cinder isaci 实现原理详解
PDF
分布式Key Value Store漫谈
PPT
Node分享 展烨
PPT
大话处理器
PDF
icecream / icecc:分散式編譯系統簡介
[SITCON2015] 自己的異質多核心平台自己幹
閱讀文章分享@若渴 2016.1.24
StackOps step by-step guide
Cinder isaci 实现原理详解
分布式Key Value Store漫谈
Node分享 展烨
大话处理器
icecream / icecc:分散式編譯系統簡介

What's hot (15)

PPTX
InnoDB Transaction Lock and MVCC
PDF
Kubernetes use-ceph
PDF
Chasingice
PPTX
應用Ceph技術打造軟體定義儲存新局
PPTX
Windows Container 101: dotNET, Container, Kubernetes
PDF
OpenStack Introduction Ecosystem
PDF
Ceph Day Beijing - Leverage Ceph for SDS in China Mobile
PDF
Sheepdog介绍
PPTX
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
PDF
Ceph Day Shanghai - Ceph in Chinau Unicom Labs
PDF
Ceph Day Beijing: One Ceph, Two Ways of Thinking - Between Customers and Deve...
DOCX
Private Cloud vs Public Cloud Analysis
PDF
OpenStack Introduction Ecosystem
PPTX
使用 Visual Studio Code 建構 JavaScript 應用程式
PPTX
Avm2虚拟机浅析与as3性能优化(陈士凯)
InnoDB Transaction Lock and MVCC
Kubernetes use-ceph
Chasingice
應用Ceph技術打造軟體定義儲存新局
Windows Container 101: dotNET, Container, Kubernetes
OpenStack Introduction Ecosystem
Ceph Day Beijing - Leverage Ceph for SDS in China Mobile
Sheepdog介绍
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
Ceph Day Shanghai - Ceph in Chinau Unicom Labs
Ceph Day Beijing: One Ceph, Two Ways of Thinking - Between Customers and Deve...
Private Cloud vs Public Cloud Analysis
OpenStack Introduction Ecosystem
使用 Visual Studio Code 建構 JavaScript 應用程式
Avm2虚拟机浅析与as3性能优化(陈士凯)
Ad

Similar to [MOSUT20150131] Linux Runs on SoCKit Board with the GPGPU (20)

PDF
Lvs在大规模网络环境下的应用pukong
PPTX
專題-2017Linux Driver 實現
PPTX
LinkIt 7697 IoT tutorial
PDF
Deskpool vdi solution introduction
PPT
Godson x86
PDF
Taobao casestudy-yufeng-qcon
PDF
02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf
PDF
[嵌入式系統] 嵌入式系統進階
PDF
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
PDF
08 gaming framework design based on cocos2d-x
PPTX
Some tips
PDF
Tcfsh bootcamp day2
PDF
Python小团队不妨知道的技术
PDF
服务器基准测试-叶金荣@CYOU-20121130
PPTX
OpenRISC whsap
PDF
Ovirt deep dive
PPTX
[students AI workshop] Pytorch
PDF
京东实时消息队列JDQ技术实践与探索
PDF
如何設計電腦 -- 還有讓電腦變快的那些方法
PDF
A bunch of hpc
Lvs在大规模网络环境下的应用pukong
專題-2017Linux Driver 實現
LinkIt 7697 IoT tutorial
Deskpool vdi solution introduction
Godson x86
Taobao casestudy-yufeng-qcon
02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf02CPUISA.pdf
[嵌入式系統] 嵌入式系統進階
探索 ISTIO 新型 DATA PLANE 架構 AMBIENT MESH - GOLANG TAIWAN GATHERING #77 X CNTUG
08 gaming framework design based on cocos2d-x
Some tips
Tcfsh bootcamp day2
Python小团队不妨知道的技术
服务器基准测试-叶金荣@CYOU-20121130
OpenRISC whsap
Ovirt deep dive
[students AI workshop] Pytorch
京东实时消息队列JDQ技术实践与探索
如何設計電腦 -- 還有讓電腦變快的那些方法
A bunch of hpc
Ad

More from Aj MaChInE (17)

PDF
An Intro on Data-oriented Attacks
PDF
A Study on .NET Framework for Red Team - Part I
PDF
A study on NetSpectre
PDF
Introduction to Adversary Evaluation Tools
PDF
[若渴] A preliminary study on attacks against consensus in bitcoin
PDF
[RAT資安小聚] Study on Automatically Evading Malware Detection
PDF
[若渴] Preliminary Study on Design and Exploitation of Trustzone
PDF
[若渴]Study on Side Channel Attacks and Countermeasures
PDF
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
PDF
[若渴計畫] Introduction: Formal Verification for Code
PPTX
[若渴計畫] Studying ASLR^cache
PPTX
[若渴計畫] Black Hat 2017之過去閱讀相關整理
PDF
[若渴計畫] Studying Concurrency
PPTX
[若渴計畫2015.8.18] SMACK
PPTX
[若渴計畫]由GPU硬體概念到coding CUDA
PPTX
[若渴計畫]64-bit Linux Return-Oriented Programming
PPTX
[MOSUT] Format String Attacks
An Intro on Data-oriented Attacks
A Study on .NET Framework for Red Team - Part I
A study on NetSpectre
Introduction to Adversary Evaluation Tools
[若渴] A preliminary study on attacks against consensus in bitcoin
[RAT資安小聚] Study on Automatically Evading Malware Detection
[若渴] Preliminary Study on Design and Exploitation of Trustzone
[若渴]Study on Side Channel Attacks and Countermeasures
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Introduction: Formal Verification for Code
[若渴計畫] Studying ASLR^cache
[若渴計畫] Black Hat 2017之過去閱讀相關整理
[若渴計畫] Studying Concurrency
[若渴計畫2015.8.18] SMACK
[若渴計畫]由GPU硬體概念到coding CUDA
[若渴計畫]64-bit Linux Return-Oriented Programming
[MOSUT] Format String Attacks

[MOSUT20150131] Linux Runs on SoCKit Board with the GPGPU