yosys and nextpnr update · 4 yosys – new features cxxrtl (whitequark) c++ “backend” similar...

25
1 Yosys and nextpnr Update David Shah Griffith Research Ltd

Upload: others

Post on 24-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

1

Yosys and nextpnr Update

David ShahGriffith Research Ltd

Page 2: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

2

Yosys● Open source synthesis framework● Multiple FPGA families● ASIC synthesis, formal verification, …

Page 3: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

3

Yosys – new features● ABC9 (Eddie Hung)● New interface to ABC optimisation/mapping

framework● Improved timing-driven synthesis● Sequential (flip-flop) optimisations

Page 4: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

4

Yosys – new features● cxxrtl (whitequark)● C++ “backend” similar to Verilator but built into

Yosys● Efficient handling of multiple clock domains,

loops, etc● Can be used for mixed-language sim

Page 5: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

5

Yosys – new features● GHDL plugin (tgingold)● Adds an open VHDL frontend● Still experimental, but good language coverage● Capable of building Microwatt, MiST SNES

core, ...

Page 6: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

6

nextpnr● Open source FPGA place and route,

development started May 2018● Multi-architecture, aimed at real-world FPGAs

including advanced functionality● Timing driven● Python API for extensibility and experimentation

Page 7: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

7

Current Status● Stable support for iCE40 and ECP5 devices● Experimental Xilinx and generic Python deivce

support● Extensively tested up to ~100kLUT designs● DDR3 controllers, Gigabit Ethernet, 64-bit SoCs

Page 8: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

8

Current Status● Analytical and simulated annealing placers● Two congestion-based routers● Packing is per-architecture

Page 9: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

9

nextpnr-xilinx● Current ongoing efforts to support Xilinx devices● Not yet upstream● RapidWright: UltraScale+, Vivado bitgen● Project X-Ray: 7-series, FOSS bitgen

Page 10: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

10

nextpnr-xilinx● Highly experimental, but can build complex

designs● Linux SoC with DDR3● Main issue is runtime scaling for larger devices

Page 11: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

11

nextpnr flowVerilog

Yosys(synthesis)

BLIF,EDIF,

etc

Other FPGA PnR, ASIC, etc

nextpnr(place and

route)

JSON

icestormiCE40bitstream

trellisECP5bitstream

RapidWright

Vivado UltraScale+bitstream

asc

textcfg

JSON

dcp

Open Source

Closed Source

fasmXray

7-seriesbitstream

RapidWright

Page 12: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

12

Inside nextpnr● Architectures are code, not data● Implement arbitrarily complex constraints to

support real-world architectures● Custom packing, DRC, bitstream generation,

etc● Multiple choices of placer and router

Page 13: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

13

Inside nextpnr

JSON Frontend Packer

Placer

Chip Data

Router

Design Export

Bitstream Gen

Bitstream

Timing Model

Timing Analysis

JSON backend

nextpnr

icestorm/Trellis/...

Yosys (synthesis)

Mapping rulesSynthesis & map

Optimisation

Verilog Frontend

Verilog design

Page 14: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

14

router2● New congestion driven router based on CRoute

(Ghent University)● Negotiated congestion, overlaps allowed during

early phases● Penalty for most congested wires

Page 15: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

15

router2● Region-based parallelisation● Arcs that don’t cross determined regions routed

in their own thread● Long arcs or arcs not containable to a bounding

box are single-threaded

Page 16: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

16

router2 - parallelisation

Page 17: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

17

router2● Parts of the router are arch-overrideable● Architectures can choose to route (or try to route)

some segments themselves ● Used to speed-up constant routing for Xilinx FPGAs● Scope to replace current pre-route clock routing

pass

Page 18: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

18

router2● Architectures can break arcs into segments to

force use of dedicated resources● Example use cases:

– UltraScale leaf clock buffers for high fanout signals– Cross-SLR routing for SSI FPGAs– Special-case IO/IP routing?

Page 19: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

19

router2 - segments

LUT

LUT

LUT

LUT

FF

LUT

LUT

LUT

LUT

FF

BUFCE_LEAF

Page 20: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

20

RippleFPGA placer● Routeability driven analytical placement● Several heuristics to reduce routing congestion● Avoids placement in congested areas● Pack-and-place based on fine grain elements

Page 21: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

21

RippleFPGA placer● Core similarities to existing HeAP placer● Assign higher “area” to congested cells to

spread them more● Partition at start to improve initial placement

Page 22: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

22

Hypergraph Partitioning

Page 23: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

23

Hypergraph Partitioning● Not only useful for Ripple● Logic Regioning (chiplet) partitioning for large

FPGAs● Parellelisation of various algorithms● Multi-device designs?

Page 24: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

24

Fine-Grain Placement

SLICE

LUT4

LUT4 DFFLUT4

DFFCarry

LUT4+carry

LUT4+carry

DFF

DFF

Page 25: Yosys and nextpnr Update · 4 Yosys – new features cxxrtl (whitequark) C++ “backend” similar to Verilator but built into Yosys Efficient handling of multiple clock domains,

25

Future Work● Finishing Ripple placer● Improved timing constraints● Retiming and resynthesis framework