10 To write Yosys C++ code you need to know at least the following classes in kernel/rtlil.h:
17 The following yosys commands are a good starting point if you are looking for examples
18 of how to use the Yosys API:
21 passes/techmap/maccmap.cc
24 Notes on the existing codebase
25 ------------------------------
27 For historical reasons not all parts of Yosys adhere to the current coding
28 styles. When adding code to existing parts of the system, adhere to this guide
29 for the new code instead of trying to mimic the style of the surrounding code.
40 - Yosys code is using tabs for indentation. Tabs are 8 characters.
42 - A continuation of a statement in the following line is indented by
45 - Lines are as long as you want them to be. A good rule of thumb is
46 to break lines at about column 150.
48 - Opening braces can be put on the same or next line as the statement
49 opening the block (if, switch, for, while, do). Put the opening brace
50 on its own line for larger blocks, especially blocks that contains
53 - Otherwise stick to the Linux Kernel Coding Stlye:
54 https://www.kernel.org/doc/Documentation/CodingStyle
60 Yosys is written in C++11. At the moment only constructs supported by
61 gcc 4.6 is allowed in Yosys code. This will change in future releases.
63 In general Yosys uses "int" instead of "size_t". To avoid compiler
64 warnings for implicit type casts, always use "SIZE(foobar)" instead
65 of "foobar.size()". (the macro SIZE() is defined by kernel/yosys.h)
67 Use range-based for loops whenever applicable.
71 Checklist for adding internal cell types
72 ========================================
74 Things to do right away:
76 - Add to kernel/celltypes.h (incl. eval() handling for non-mem cells)
77 - Add to InternalCellChecker::check() in kernel/rtlil.cc
78 - Add to techlibs/common/simlib.v
79 - Add to techlibs/common/techmap.v
81 Things to do after finalizing the cell interface:
83 - Add support to kernel/satgen.h for the new cell type
84 - Add to manual/CHAPTER_CellLib.tex (or just add a fixme to the bottom)
85 - Maybe add support to the verilog backend for dumping such cells as expression
89 Checklist for creating Yosys releases
90 =====================================
92 Update the CHANGELOG file:
99 Run all tests with "make config-{clang-debug,gcc-debug,gcc-4.6,release}":
112 make gen_issues gen_samples
113 make SYN_LIST="yosys" SIM_LIST="icarus yosim verilator" FULL=1 world
114 chromium-browser report.html
117 Then with default config setting:
120 ./yosys -p 'proc; show' tests/simple/fiedler-cooley.v
121 ./yosys -p 'proc; opt; show' tests/simple/fiedler-cooley.v
125 - sanity check the figures in the appnotes and presentation
126 - if there are any odd things -> investigate
127 - make cosmetic changes to the .tex files if necessary
130 Also with default config setting:
132 cd ~yosys/techlibs/cmos
135 cd ~yosys/techlibs/xilinx/example_sim_counter
138 cd ~yosys/techlibs/xilinx/example_mojo_counter
142 Finally if a current verific library is available:
145 cat frontends/verific/build_amd64.txt
146 - follow instructions
149 ../../yosys test_navre.ys
154 - create branch yosys-x.y.z-rc and push to github
155 - contact the usual suspects per mail and ask them to test
156 - post on the reddit and ask people to test
157 - commit KISS fixes to the -rc branch if necessary
162 - set YOSYS_VER to x.y.z in Makefile
163 - update version string in CHANGELOG
164 git commit -am "Yosys x.y.z"
167 - post changelog on github
168 - post short release note on reddit
169 - delete -rc branch from github
172 Updating the website:
178 - update pdf files on the website
183 git commit -am update
189 git merge {release-tag}
190 - set version to x.y.z+ in Makefile
191 - add section "Yosys x.y.z .. x.y.z+" to CHANGELOG
192 git commit --amend -am "Yosys x.y.z+"