yosys - open source synthesis tool

yosys - open source synthesis tool

Yosys is oen source synthesis tool. You provide it an RTL, and it spits out optimized gate level netlist.

yosys details are on this link: http://www.clifford.at/yosys/about.html

yosys download and installation. I'll show steps for both debian based OS (as Linux Mint or Ubuntu) and Fedora based OS (as CentOS). I haven't gotten to installing Yosys on LinuxMint, so will provide instructions for it later.

A CentOS: I will show steps for yosys installation on CentOS 7.5 1804 distro.

1. download python3 => see instructions for downloading python3 on python page. Do these steps:

  •  I. First do "sudo yum install epel-release".
  •  II. Next do "sudo yum install python3.4"
  •  III. sudo curl -O https://bootstrap.pypa.io/get-pip.py
  •  IV. sudo /usr/bin/python3.4 get-pip.py

2. download tcl/tk => see instructions for downloading tcl/tk in tcl/tk page. Use manual download and install from tcl8.7a

3. download libffi => run "sudo yum install libffi libffi-devel". Run "locate libffi" This will show libffi.so lib in /usr/lib64 and docs in /usr/share/doc. ffi.h file will be in /usr/include/libffi.h

4. install readline => sudo yum install readline-devel. This creates /usr/include/readline/readline.h

5. Now download yosys from here: http://www.clifford.at/yosys/download.html. Steps below:

 A. download yosys-0.8.tar.gz. Extract it within the file windows manager using right click and choosing "extract". That will create another dir named "yosys-yosys-0.8"

 B. type "make config-gcc". This will create Makefile with gcc as the compiler. this will suffice, as gcc can compile C++ also. There is no need to install clang.

 C. type "make" => this will start compilation process using gcc (should show CONFIG := gcc from Makefile.conf). Possible Errors:

  • tcl.h not found (called in kernel/yosys.h) => tclsh not installed or found. See bullet 2 above.
  • tclsh command not found => If you see this error and tclsh is alrready installed, probably the link or path for tclsh is not correct.
  • readline/readline.h not found (called in kernel/driver.cc) => readline not installed. See bullet 4 above.
  • ffi.h not found (called in frontends/ast/dpicall.cc) => libffl not installed. See bullet 3 above.

     If no errors found, we should see 100% build for yosys, then it downloads "abc" from berkeley, does 95% build for abc binary, and then finally "Build successful" message.

7. make test => runs all tests. Needs icarus verilog or "icarus"

8. sudo make install => This is final step where it just puts binaries for yosys in /usr/local/bin/yosys. Other yosys related binaries also here.

9. Now running yosys (typing yosys or /usr/local/bin/yosys) should bring up yosys tool. However, if we get "error while loading shared libraries: libtcl8.7.so: cannot open shared object file: No such file or directory" , that means LD_LIBRARY_PATH var is not set.   If we find "libtcl8.7.so", we see it in /usr/local/lib/libtcl.8.7.so". "echo $LD_LIBRARY_PATH" shows blank. For bash shell, type "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/". Now, "echo $LD_LIBRARY_PATH" will show ":/usr/local/lib/". Type "export LD_LIBRARY_PATH". Now typing yosys brings up cmd line yosys tool. To make this change permanent, add this line in ~/.bashrc (assuming you are using bash)

  • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/

10. Install open src s/w graphviz for graphical viewing: sudo yum install graphviz => installs graphviz-2.30*

10. All yosys cmds and scripts available on yosys webpage.

 

yosys usage:

 1. Read Yosys manual which explains everything in very good detail. http://www.clifford.at/yosys/files/yosys_manual.pdf

 

Yosys example: TO DO ---