5. FPGA in Datacenters
n Microsoft Bing Search Engine (Catapult)
l More space density and energy efficiency than GPU
for machine learning (DNN)
5
Putnam+, A Reconfigurable Fabric for Accelerating Large-Scale Datacenter Services, ISCA'14
http://archive.eetindia.co.in/www.eetindia.co.in/STATIC/ARTIC
LE_IMAGES/201408/EEIOL_2014AUG14_PL_NT_01_03.jpg
6. FPGA for low-cost and energy-efficiency
6
http://www.wired.com/2014/06/microsoft-fpga/
Agile Co-Design for a Reconfigurable Datacenter, FPGA'16
7. Phenox: FPGA-based quadcopter
n Programmable drone system with FPGA
l Zynq: SoC FPGA (ARM CPU + FPGA logics in a single chip)
ü Easy to realize software with dedicated hardware support
7
Phenox http://phenoxlab.com/
8. n : RTL (Register Transfer Level)
l
l Timed
l
8
9. 2 (c += a * b)
9
RTL (Verilog HDL): 105 2098 15
10. 2 (c += a * b)
10
RTL (Verilog HDL): 105 2098 15
L
11. n : RTL (Register Transfer Level)
l
l Timed
l
n : HLS: High Level Synthesis
l
l Untimed
ü
ü (Directive)
l
11
14. Xilinx Vivado HLS
n Free (≠Open-source) compiler for Xilinx FPGAs
l Synthesize Verilog HDL/VHDL from C/C++
l Eclipse-based IDE
14Xilinx UG902
15. Altera OpenCL
n OpenCL: parallel programming language for
heterogeneous platforms
n Synthesize Host-SW & FPGA-HW at same time, like GPU
15
http://www.bdti.com/InsideDSP/2013/02/13/Altera
16. OK
n No.
n
l I/F
n RTL
l
l
n :
RTL
l Chisel [Bachrach+,DAC'12]
l PyMTL [Lockhart+,MICRO’14]
l Synthesijer.Scala [ ,IEICE RECONF'15]
16
17. Veriloggen:
Python RTL
17
Design Generator by Python
from veriloggen import *
m = Module('blinkled')
clk = m.Input('CLK')
led = m.Output('LED', 8)
count = m.Reg('count', 32)
m.Assign( led(count[31:24]) )
m.Always(Posedge(clk)(
count( count + 1 ) )
hdl = m.to_verilog()
print(hdl)
blinkled
CLK RST
LED count
assign
always
Veriloggen Object
module blinkled (
input CLK,
output [7:0] LED
);
reg [31:0] count;
assign LED = count[31:24];
always @(posedge CLK) begin
count <= count + 1;
end
endmodule
Verilog Source Code
module
input
CLK
input
RST
blinkled
Verilog AST
to_verilog()
Verilog
AST
Generator
Verilog
Code
Generator
Run on Python Interpreter
Verilog HDL
Python
Verilog HDL
39. FPGA
39
FPGA
On-chip Bus
Application HW
Memory Controller
FPGA DRAM
CPR HW
Context
Manager
Reg Reg
Logic
Logic
Controller
Throttling
Software
Interface
Read/Write
RAM
RAM
RAM
PCI-express
Host CPU
PCIe
On-chip Bus
Mem Ctrl
DRAM
Core
SATA
Disk
Core
Backup/Restore
HW
RAM (FF)FPGA DRAM PCIe
DRAM
DRAM
•
•
•
•
Bus I/F
40. HardCheck:
CPR IP
40
Design Generator
w/ Veriloggen
from veriloggen import *
m = Module('blinkled')
clk = m.Input('CLK')
rst = m.Input('RST')
led = m.Output('LED', 8)
# ...
module blinkled
// ...
endmodule
Verilog Source Code
or
blinkled
CLK RST
LED count
assign
always
Veriloggen
Object
Veriloggen
Verilog Reader
CPR
IP-core
Parameter
Resolver
CPR Port
Inserter
CPR Unit
Generator
IP
Packager
Fixed
Verilog w/o
Parameter
Consumer
Verilog w/
CPR Ports
Verilog w/
CPR
Component
Checkpointable Hardware Synthesis Framework
Unimplemented Unimplemented
Input: Normal Hardware Output:
CPR
Hardware
Veriloggen
Verilog HDL
Veriloggen
IP
IP
(AXI4/Avalon)
41. n RAM
l RTL
ü RAM
41
Reg Reg Reg Reg
Logic
RAM
RAM
M-Bus S-Bus User-logic
Reg: Register
M-Bus/S-Bus: Master/Slave Bus I/F
RAM: On-chip Memory
42. IP
42
Reg Reg Reg Reg
Logic
RAM
RAM
M-Bus S-Bus
SR SR SR SR
ContextManager
(Reader/Writer)
DMA
Ctrl
M-Bus S-Bus M-Bus S-Bus
SW I/F
Logic
Ctrl
Logic Throttling
CPR Shift Registers
Intermediate
Bus I/F
User-logic
43. IP
43
Reg Reg Reg Reg
Logic
RAM
RAM
M-Bus S-Bus
SR SR SR SR
ContextManager
(Reader/Writer)
DMA
Ctrl
M-Bus S-Bus M-Bus S-Bus
SW I/F
Logic
Ctrl
Logic Throttling
CPR Shift Registers
Intermediate
Bus I/F
User-logic
HW
CPR HW
SW
44. CPR HW
44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module blinkled #
(
parameter WIDTH = 8
)
(
input CLK,
input RST,
output reg [WIDTH-1:0] LED
);
reg [32-1:0] count;
always @(posedge CLK) begin
if(RST) begin
count <= 0;
end else begin
if(count == 1023) begin
count <= 0;
end else begin
count <= count + 1;
end
end
end
always @(posedge CLK) begin
if(RST) begin
LED <= 0;
end else begin
if(count == 1023) begin
LED <= LED + 1;
end
end
end
endmodule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module blinkled #
(
parameter WIDTH = 8
)
(
input CLK,
input RST,
output reg [8-1:0] LED,
input cpr_ctrl_read,
input cpr_ctrl_write,
output [8-1:0] cpr_read_LED,
output [32-1:0] cpr_read_count,
input [8-1:0] cpr_write_LED,
input [32-1:0] cpr_write_count
);
reg [32-1:0] count;
always @(posedge CLK) begin
if(RST) begin
count <= 0;
Restore
Restore
Port
Backup
Port
Control
Port
always
45. CPR HW
45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module blinkled #
(
parameter WIDTH = 8
)
(
input CLK,
input RST,
output reg [WIDTH-1:0] LED
);
reg [32-1:0] count;
always @(posedge CLK) begin
if(RST) begin
count <= 0;
end else begin
if(count == 1023) begin
count <= 0;
end else begin
count <= count + 1;
end
end
end
always @(posedge CLK) begin
if(RST) begin
LED <= 0;
end else begin
if(count == 1023) begin
LED <= LED + 1;
end
end
end
endmodule
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
output [8-1:0] cpr_read_LED,
output [32-1:0] cpr_read_count,
input [8-1:0] cpr_write_LED,
input [32-1:0] cpr_write_count
);
reg [32-1:0] count;
always @(posedge CLK) begin
if(RST) begin
count <= 0;
end else if(cpr_ctrl_write) begin
count <= cpr_write_count;
end else if(!cpr_ctrl_read) begin
if(count == 1023) begin
count <= 0;
end else begin
count <= count + 1;
end
end
end
always @(posedge CLK) begin
if(RST) begin
LED <= 0;
end else if(cpr_ctrl_write) begin
LED <= cpr_write_LED;
end else if(!cpr_ctrl_read) begin
if(count == 1023) begin
LED <= LED + 1;
end
end
end
assign cpr_read_LED = LED;
assign cpr_read_count = count;
endmodule
Restore
Normal
Behavior
Restore
Normal
Behavior
Backup
Restore
Port
Backup
Port
always