Open Source FPGA Toolchain FPGA LSE Summer Week 2015 iCE40 Flow - - PowerPoint PPT Presentation

open source fpga toolchain
SMART_READER_LITE
LIVE PREVIEW

Open Source FPGA Toolchain FPGA LSE Summer Week 2015 iCE40 Flow - - PowerPoint PPT Presentation

Open Source FPGA Toolchain Vincent Gatine Introduction Open Source FPGA Toolchain FPGA LSE Summer Week 2015 iCE40 Flow Conclusion Vincent Gatine EPITA July 15, 2015 Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 1


slide-1
SLIDE 1

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Open Source FPGA Toolchain

LSE Summer Week 2015 Vincent Gatine

EPITA

July 15, 2015

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 1 / 25

slide-2
SLIDE 2

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

What is a FPGA?

Field Programmable Gate Array

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 2 / 25

slide-3
SLIDE 3

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Usage

SDR (BladeRF, USRP) Pebble Time watch LSE-PC Prototypage

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 3 / 25

slide-4
SLIDE 4

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

FPGA manufacturers

Majors (80% market share): Altera, Xilinx Minors: Lattice, Blue Silicon, Microsemi,. . .

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 4 / 25

slide-5
SLIDE 5

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

How to program a FPGA?

Hardware Description Language (Verilog, VHDL) Verilog example module toplevel(input clock, input reset); reg cnt; always @ (posedge reset or posedge clock) if (reset) cnt <= 0; else cnt <= cnt + 1; endmodule

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 5 / 25

slide-6
SLIDE 6

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Synthesis tools

Quartus by Altera Diamond (or Icecube 2) by Lattice

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 6 / 25

slide-7
SLIDE 7

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Why would we want an open source toolchain?

Quartus > 13.1 can’t program (old) cyclones Linux support? Knowledge Why not?

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 7 / 25

slide-8
SLIDE 8

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

iCE40

Produced by Lattice semiconductor Low cost, low power FPGA Cheap boards and well documented Perfect platform to do some reverse engineering

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 8 / 25

slide-9
SLIDE 9

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Project Icestorm

iCE40 bitstream RE by Clifford Wolf and Mathias Lasser Aim to document iCE40 programming bits Many tools to pack, unpack, explain structures

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 9 / 25

slide-10
SLIDE 10

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

iCE40 Structure

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 10 / 25

slide-11
SLIDE 11

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

PLB Structure

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 11 / 25

slide-12
SLIDE 12

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Routing

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 12 / 25

slide-13
SLIDE 13

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

IntraPLB routing

Local tracks Each PLB has 32 local tracks Organized in 4 groups of 8 wires each

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 13 / 25

slide-14
SLIDE 14

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

InterPLB routing

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 14 / 25

slide-15
SLIDE 15

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

InterPLB routing

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 15 / 25

slide-16
SLIDE 16

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Programming process

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 16 / 25

slide-17
SLIDE 17

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Yosys

Yosys Open Synthesis Suite Created by Clifford Wolf HDL to RTL synthesis tool

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 17 / 25

slide-18
SLIDE 18

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Yosys

Example # read design read_verilog mydesign.v # generic synthesis synth -top mytop # write synthesized design write_verilog synth.v

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 18 / 25

slide-19
SLIDE 19

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Arachne-pnr

Place and route software aimed at iCE40LP/HX1K Written by Cotton Seed Takes RTL and constraints files (pin assignation) Output plain text cells configurations constraints.pcf set_io a 1 set_io b 10 set_io y 11

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 19 / 25

slide-20
SLIDE 20

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Icestorm

Icepack: plain text to bitstream Iceunpack: bitstream to plain text IceProg: Program board

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 20 / 25

slide-21
SLIDE 21

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Example

and.v module top (input a, b, output y); assign y = a & b; endmodule and.pcf set_io a 1 set_io b 10 set_io y 11

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 21 / 25

slide-22
SLIDE 22

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Example

.io_tile 0 14 IOB_1 PINTYPE_0 IoCtrl IE_1 IoCtrl REN_0 buffer io_1/D_IN_0 span4_horz_28 .logic_tile 1 11 LC_2 0000000001010101 0000 buffer local_g1_4 lutff_2/in_3 buffer local_g3_1 lutff_2/in_0 buffer neigh_op_lft_4 local_g1_4 buffer sp4_r_v_b_41 local_g3_1

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 22 / 25

slide-23
SLIDE 23

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Conclusion

This is still a proof of concept

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 23 / 25

slide-24
SLIDE 24

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Questions?

Questions?

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 24 / 25

slide-25
SLIDE 25

Open Source FPGA Toolchain Vincent Gatine Introduction FPGA iCE40 Flow Conclusion

Thanks!

mail: nurelin@lse.epita.fr Links Yosys arachne-pnr icestorm

Vincent Gatine (EPITA) Open Source FPGA Toolchain July 15, 2015 25 / 25