From d8dffc8c81995abb12852d7e80ad1d10b47415b8 Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Sun, 6 Nov 2016 16:24:45 +0200 Subject: [PATCH] Initial page. A lot of stuff is missing, I will continue a bit later. --- Migrating-from-Vivado.md | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Migrating-from-Vivado.md diff --git a/Migrating-from-Vivado.md b/Migrating-from-Vivado.md new file mode 100644 index 0000000..be317bf --- /dev/null +++ b/Migrating-from-Vivado.md @@ -0,0 +1,60 @@ +At this point it is not possible to work with Xilinx FPGAs by using only free software. If you are looking for a full free software toolchain for working with FPGAs, see [Project IceStorm](http://www.clifford.at/icestorm/). + +That being said, most of your workflow can still be done using Yosys, Icarus Verilog and other free software tools. You will have to use Vivado for place&route, bitstream generation and writing your bit file onto your device. However, all these can be done by using tcl scripts, meaning that you will not have to open Vivado GUI at all. + +This page will show how to get commonly used Vivado functionality with Yosys. + +# Testing +TODO + +# Wave Viewer +TODO + +# Elaborated Design Schematic / RTL Schematic +All you have to do is load your Verilog source files and run [``prep``](http://www.clifford.at/yosys/cmd_prep.html). Then, use [``show``](http://www.clifford.at/yosys/cmd_prep.html) to see parts that are of any interest to you. You probably also want to use ``-colors`` and ``-stretch`` flags to make the graph a bit more readable. + +Therefore, the command you want to use is: +```bash +yosys -p 'prep; show -colors 42 -stretch show top' top.sv foo.sv bar.sv +``` + +You can also export this graph directly to SVG file: +```bash +yosys -p 'prep; show -colors 42 -stretch -format svg -prefix mygraph show top' top.sv foo.sv bar.sv +``` + +See also [Yosys AppNote 011: Interactive Design Investigation](http://www.clifford.at/yosys/files/yosys_appnote_011_design_investigation.pdf). + +# Synthesized Design Schematic / Technology Schematic +TODO + +# Bitstream and Programming + +You can run Vivado in ``batch`` or ``tcl`` modes. The difference is that in ``batch`` mode it will run the script and exit, while in ``tcl`` you will be left with the tcl shell. The problem with Vivado is that it has a very long startup delay, therefore running it in ``batch`` mode is very likely not what you want (but you can still do it, if you wish). + +1. [place&route and bitstream generation](https://github.com/cliffordwolf/yosys/blob/master/examples/basys3/run_vivado.tcl) +1. [writing the bitstream file to your device](https://github.com/cliffordwolf/yosys/blob/master/examples/basys3/run_prog.tcl) + +The first one is where all of the magic happens. Feel free to add a couple of other commands, for example ``report_power``. You may also want to modify the second file if you are working with multiple devices at the same time. + +You will also need an ``.xdc`` file (you are probably already aware of it). See [this example](https://github.com/cliffordwolf/yosys/blob/master/examples/basys3/example.xdc). You can use Vivado GUI to generate it, or you can just write it by hand. The structure of the file is simple enough so there should be no problem. + +So, you can run it in ``batch`` mode: +```bash +vivado -mode batch -source run_vivado.tcl +``` + +Or, you can run it ``tcl`` mode: +```bash +vivado -mode tcl +``` +Once it is loaded, you will see the tcl shell. Write ``source run_vivado.tcl`` to run your tcl script. +The latter approach might be slightly more preferable to you if you do not like the startup delay of vivado. + +Both examples assume that you have ``vivado`` binary in your PATH. If you don't, feel free to substitute it with an actual path (e.g. ``~/opt/Xilinx/Vivado/2016.2/bin/vivado``). + +# Makefile to the Rescue! +TODO + +# Conclusion ? +TODO \ No newline at end of file