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 "GetSize(foobar)" instead
65 of "foobar.size()". (GetSize() is defined by kernel/yosys.h)
67 Use range-based for loops whenever applicable.
71 Creating the Visual Studio Template Project
72 ===========================================
74 1. Create an empty Visual C++ Win32 Console App project
76 Microsoft Visual Studio Express 2013 for Windows Desktop
77 Open New Project Wizard (File -> New Project..)
80 Solution Name: YosysVS
81 [X] Create directory for solution
82 [ ] Add to source control
84 [X] Console applications
88 2. Open YosysVS Project Properties
90 Select Configuration: All Configurations
92 C/C++ -> General -> Additional Include Directories
95 C/C++ -> Preprocessor -> Preprocessor Definitions
96 Add: _YOSYS_;_CRT_SECURE_NO_WARNINGS
98 3. Resulting file system tree:
102 YosysVS/YosysVS/YosysVS.vcxproj
103 YosysVS/YosysVS/YosysVS.vcxproj.filters
106 YosysVS/YosysVS.v12.suo
108 4. Zip YosysVS as YosysVS-Tpl-v1.zip
112 Checklist for adding internal cell types
113 ========================================
115 Things to do right away:
117 - Add to kernel/celltypes.h (incl. eval() handling for non-mem cells)
118 - Add to InternalCellChecker::check() in kernel/rtlil.cc
119 - Add to techlibs/common/simlib.v
120 - Add to techlibs/common/techmap.v
122 Things to do after finalizing the cell interface:
124 - Add support to kernel/satgen.h for the new cell type
125 - Add to manual/CHAPTER_CellLib.tex (or just add a fixme to the bottom)
126 - Maybe add support to the verilog backend for dumping such cells as expression
130 Checklist for creating Yosys releases
131 =====================================
133 Update the CHANGELOG file:
140 Run all tests with "make config-{clang,gcc,gcc-4.6}":
152 make purge gen_issues gen_samples
153 make SYN_LIST="yosys" SIM_LIST="icarus yosim verilator" REPORT_FULL=1 world
154 chromium-browser report.html
157 Then with default config setting:
160 ./yosys -p 'proc; show' tests/simple/fiedler-cooley.v
161 ./yosys -p 'proc; opt; show' tests/simple/fiedler-cooley.v
162 ./yosys -p 'synth; show' tests/simple/fiedler-cooley.v
166 - sanity check the figures in the appnotes and presentation
167 - if there are any odd things -> investigate
168 - make cosmetic changes to the .tex files if necessary
171 Also with default config setting:
173 cd ~yosys/techlibs/cmos
176 cd ~yosys/techlibs/xilinx/example_sim_counter
179 cd ~yosys/techlibs/xilinx/example_mojo_counter
183 Finally if a current verific library is available:
186 cat frontends/verific/build_amd64.txt
187 - follow instructions
190 ../../yosys test_navre.ys
195 - create branch yosys-x.y.z-rc and push to github
196 - contact the usual suspects per mail and ask them to test
197 - post on the reddit and ask people to test
198 - commit KISS fixes to the -rc branch if necessary
203 - set YOSYS_VER to x.y.z in Makefile
204 - update version string in CHANGELOG
205 git commit -am "Yosys x.y.z"
208 - post changelog on github
209 - post short release note on reddit
210 - delete -rc branch from github
213 Updating the website:
219 - update pdf files on the website
224 git commit -am update
230 git merge {release-tag}
231 - set version to x.y.z+ in Makefile
232 - add section "Yosys x.y.z .. x.y.z+" to CHANGELOG
233 git commit --amend -am "Yosys x.y.z+"