2. 今日の話: PyCoRAMについて
n 高位合成技術とメモリシステム抽象化を用いた
アクセラレータIPコア開発のためのフレームワーク
l キーワード
• FPGAアクセラレータ・IPコア設計・Python-Verilog高位合成・
メモリシステム抽象化・AXI4インターコネクト
2014-03-10 @shtaxxx 2
User
I/O
User Logic
CoRAM
Channel
CoRAM
Register
Control
Thread
DMAC
CoRAM
Memory
DMAC
CoRAM
Stream FSM
GPIO
Modeled in RTL
(Verilog HDL)
Memory Access
Pattern
in Python
3. PyCoRAM and Pyverilog are released for public!
n PyCoRAM
l http://shtaxxx.github.io/PyCoRAM/
n Pyverilog
l http://shtaxxx.github.io/Pyverilog/
2014-03-10 @shtaxxx 3
13. Motivation: CoRAM for Modern EDKs
n CoRAMのメモリ抽象化を今時のEDKで使いたい
l 標準的なインターコネクト( AMBA AXI4)に繋ぎたい
l そうすれば他の普通のIPコアとも簡単に共存できそう
2014-03-10 @shtaxxx 13
Standard On-chip Interconnect
CoRAM
Abstraction
Accelerator logic
Standard IP-core
Device-dependent Interfaces
CPU core
Portable application
design with CoRAM Cooperation with standard IP-cores
22. サポートされているPyCoRAMオブジェクト
n データ置き場(メモリ)
l CoramMemory
• Block RAM that the data is replaced by the control thread
l CoramInStream
• Input FIFO from off-chip DRAM
l CoramOutStream
• Output FIFO to off-chip DRAM
n ユーザロジックとコンロールスレッド間のチャネル
l CoramChannel
• Communication FIFO between user-logic and control-thread
l CoramRegister
• Communication latch between user-logic and control-thread
2014-03-10 @shtaxxx 22
23. PyCoRAM IPコアを用いたFPGAアクセラレータ
2014-03-10 @shtaxxx 23
Control
Thread
FSM
AXI4 Interconnect
DRAM Controller
DRAM (Off-chip)
DMAC
AXI I/F
CoRAM
Memory
CoRAM
Memory
AXI I/F
CoRAM
Memory
CoRAM
Memory
DMAC DMAC
AXI I/F
CoRAM
Stream
DMAC
AXI I/F
CoRAM
Stream
CoRAM
Channel
HW Kernels
(Computing Logics)
DMA
Cluster
DMA
Cluster
FPGA
Other
AXI
IP-core
or
CPU
PyCoRAM IP
(Application)
37. Python-to-Verilog HLSのコード生成例
2014-03-10 @shtaxxx 37
addr = 0�
size = 0�
for i in range(8):�
# some ops�
Control Thread
(Python)
Compile
FSM part
(Verilog HDL)
Assignment part
(Verilog HDL)
case(state)�
/* … */�
1: begin �
state <= 2;�
end �
2: begin �
state <= 3;�
end �
3: begin �
state <= 4;�
end �
4: begin �
if((__s0_i < 8)) state <= 5; �
else state <= 12;�
end �
/* … */�
11: begin �
state <= 4;�
end �
/* … */�
endcase�
case(state)�
/* … */�
1: begin �
__s0_addr <= 0;�
end �
2: begin �
__s0_sum <= 0;�
end �
3: begin �
__s0_i <= 0;�
end �
�
�
�
�
/* … */�
11: begin �
__s0_i <= (__s0_i + 1);�
end �
/* … */�
endcase�