tutorial my first hardware design
play

TUTORIAL MY FIRST HARDWARE DESIGN Tristan Gingold - - PowerPoint PPT Presentation

TUTORIAL MY FIRST HARDWARE DESIGN Tristan Gingold - tgingold@free.fr - FOSDEM17 ITS A TALK ABOUT HARDWARE! Things like that There are many talks at FOSDEM about software. Try a different room ITS A TALK ABOUT CHIP DESIGN This


  1. TUTORIAL MY FIRST HARDWARE DESIGN Tristan Gingold - tgingold@free.fr - FOSDEM’17

  2. IT’S A TALK ABOUT HARDWARE! Things like that… There are many talks at FOSDEM about software. Try a different room

  3. IT’S A TALK ABOUT CHIP DESIGN This • This This is a PCB (Printed Circuit Board) KiCad is a tool to design boards, you also need electronic knowledge

  4. MORE SPECIFICALLY, DIGITAL CHIPS Analog chip Numeric chip See the difference ?

  5. DESIGNING AN IC IS COMPLEX… DFT Netlist Place SCE Layout LVS Clock domains STA DRC Power Route Cells There aren’t many OSS tools for ASICs. X-talk qflow Timing magic VLSI Double patterning Masks

  6. … AND VERY EXPENSIVE ASML lithography machine Expect $$$ for the first chip…

  7. BUT SOME ARE PROGRAMMABLE! There are other kinds of programmable circuits: Normal chip FPGA Gate array CPLD …

  8. FPGA ARCHITECTURE Programmable pad: Programmable Direction logic (LUT) Strength Level… Programmable switch box That’s a very simple view… Most FPGAs also have PLL, memories, multipliers, or even SERDES/PCI-e blocks. See FPGA databooks

  9. DIGITAL IS ABOUT 0 AND 1 That’s simple ! Assuming you know about binary computation For analog design, see gnucap or spice (There are always analog parts in a circuit)

  10. DIGITAL IS ABOUT LOGIC BASIC OPERATIONS NOT gate OR gate D = ~A Z = D | E Output Inputs Inputs Inputs AND gate bbc.co.uk D = B & C

  11. COMBINE THEM! Q = A ^ B wikipedia.org Symbol for XOR gate

  12. OR DO MATH (ONE BIT) Q = A ^ B = A + B = A ~= B wikipedia.org A B Q 0 0 0 0 1 1 1 0 1 1 1 0

  13. THE ADDER S : SUM C : CARRY wikipedia.org Full Adder

  14. MULTIPLE BIT ADDER S = A + B There are more efficient way to design large adders Search for Digital Logic Architecture

  15. IF YOU CAN ADD, YOU CAN MULTIPLY! 0 0 0 0 B0 A3 A2 A1 A0 P = A * B 0 B1 A3 A2 A1 A0 0 B2 A3 A2 A1 A0 0 B3 A3 A2 A1 A0 0 There are more efficient way to design multipliers P7 P6 P5 P4 P3 P2 P1 P0

  16. YOU CAN DESIGN ANY LOGICAL/ARITH FUNCTION Inputs F() Outputs Well, many functions… But this is not very efficient (can take a lot of gates)

  17. MORE POWERFUL: RECURSION! Inputs F() Outputs In math, recursion is very powerful. In digital design, it doesn’t work directly!

  18. TIMING SYNCHRONISATION Do you remember the full adder ? wikipedia.org It takes time for a signal to propagate through gates. (due to capacities). So the arrival times at S and Cout differ.

  19. TIMING DIAGRAM What you expect: +1 What you get: Thanks to http://wavedrom.com/editor.html Outputs are not available at the same time.

  20. SYNCHRONOUS DESIGN You can try to balance paths, but: •It’s very hard •propagation time depends on too many factors You can use a logic that is not affected by delay variation (like gray code), but: •works only in some cases. Rule #1: no direct loop/feedback So how to do ?

  21. SYNCHRONOUS DESIGN B +1 A Flip Flop: update output on rising edge of the clock Clean clk Clock

  22. DIGITAL DESIGN It’s a mix of: •logic gates •flip flops There are other way to synchronise (latch, falling edge, double edge…) It is possible to use schematic editors, but •tedious •doesn’t scale well Use an HDL Hardware Description Language I will use VHDL

  23. MY FIRST DESIGN BLINKING LEDS latticesemi.com Leds Using OSS tools: •ghdl Target: Lattice iCEstick •yosys ~ 22 euros •arachne-pnr Supported by OSS tools •iceStorm

  24. VHDL: EXTERNAL INTERFACE boilerplate Comment (to not forget leds position) interface Input: clock outputs: leds (externally generated 3Mhz)

  25. INTERNALS Internals Internal wire Process: concurrent execution, triggered on clk concurrent assignments There are many VHDL or Verilog tutorials on the web.

  26. SYNTHESIS Translating (or compiling) sources to gates (netlist) First, analysing sources: unit name output file Synthesis: synthesis script frontend command

  27. PLACE & ROUTE Allocate resources on the FPGA device input output place file IC pin #

  28. PROGRAM Write into the FPGA USB interface flash Create the binary file: Write to flash: The FPGA is automatically reset and then load the new config

  29. TOOLS USED Synthesis: http://www.clifford.at/yosys/ VHDL front-end: https://github.com/tgingold/ghdlsynth-beta https://github.com/tgingold/ghdl Place and route: https://github.com/cseed/arachne-pnr iCE40 tools: http://www.clifford.at/icestorm/

  30. QUESTIONS ?

Recommend


More recommend