Skip to content

Commit

Permalink
split CodingReadme into multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
nakengelhardt committed Mar 22, 2021
1 parent 92d5550 commit d9ec35a
Show file tree
Hide file tree
Showing 11 changed files with 295 additions and 318 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false

# From CodingReadme
# From guidelines/CodingStyle
TabWidth: 8
ContinuationIndentWidth: 2
ColumnLimit: 150
Expand Down
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
Dockerfile
README.md
manual
CodingReadme
guidelines
CodeOfConduct
.travis
.travis.yml

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The "Documentation" page on the web site contains links to more resources,
including a manual that even describes some of the Yosys internals:
- http://www.clifford.at/yosys/documentation.html

The file `CodingReadme` in this directory contains additional information
The directory `guidelines` contains additional information
for people interested in using the Yosys C++ APIs.

Users interested in formal verification might want to use the formal verification
Expand Down
120 changes: 120 additions & 0 deletions guidelines/Checklists
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
Checklist for adding internal cell types
========================================

Things to do right away:

- Add to kernel/celltypes.h (incl. eval() handling for non-mem cells)
- Add to InternalCellChecker::check() in kernel/rtlil.cc
- Add to techlibs/common/simlib.v
- Add to techlibs/common/techmap.v

Things to do after finalizing the cell interface:

- Add support to kernel/satgen.h for the new cell type
- Add to manual/CHAPTER_CellLib.tex (or just add a fixme to the bottom)
- Maybe add support to the Verilog backend for dumping such cells as expression



Checklist for creating Yosys releases
=====================================

Update the CHANGELOG file:

cd ~yosys
gitk &
vi CHANGELOG


Update and check documentation:

cd ~yosys
make update-manual
make manual
- sanity check the figures in the appnotes and presentation
- if there are any odd things -> investigate
- make cosmetic changes to the .tex files if necessary

cd ~yosys
vi README guidelines/*
- is the information provided in those file still up to date


Then with default config setting:

cd ~yosys
make vgtest

cd ~yosys
./yosys -p 'proc; show' tests/simple/fiedler-cooley.v
./yosys -p 'proc; opt; show' tests/simple/fiedler-cooley.v
./yosys -p 'synth; show' tests/simple/fiedler-cooley.v
./yosys -p 'synth_xilinx -top up3down5; show' tests/simple/fiedler-cooley.v

cd ~yosys/examples/cmos
bash testbench.sh

cd ~yosys/examples/basys3
bash run.sh


Test building plugins with various of the standard passes:

yosys-config --build test.so equiv_simple.cc
- also check the code examples in guidelines/GettingStarted


And if a version of the verific library is currently available:

cd ~yosys
cat frontends/verific/build_amd64.txt
- follow instructions

cd frontends/verific
../../yosys test_navre.ys


Finally run all tests with "make config-{clang,gcc,gcc-4.8}":

cd ~yosys
make clean
make test
make ystests
make vloghtb
make install

cd ~yosys-bigsim
make clean
make full

cd ~vloghammer
make purge gen_issues gen_samples
make SYN_LIST="yosys" SIM_LIST="icarus yosim verilator" REPORT_FULL=1 world
chromium-browser report.html


Release:

- set YOSYS_VER to x.y.z in Makefile
- remove "bumpversion" target from Makefile
- update version string in CHANGELOG
git commit -am "Yosys x.y.z"

- push tag to github
- post changelog on github
- post short release note on reddit


Updating the website:

cd ~yosys
make manual
make install

- update pdf files on the website

cd ~yosys-web
make update_cmd
make update_show
git commit -am update
make push
File renamed without changes.
35 changes: 35 additions & 0 deletions guidelines/CodingStyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Coding Style
============


Formatting of code
------------------

- Yosys code is using tabs for indentation. Tabs are 8 characters.

- A continuation of a statement in the following line is indented by
two additional tabs.

- Lines are as long as you want them to be. A good rule of thumb is
to break lines at about column 150.

- Opening braces can be put on the same or next line as the statement
opening the block (if, switch, for, while, do). Put the opening brace
on its own line for larger blocks, especially blocks that contains
blank lines.

- Otherwise stick to the Linux Kernel Coding Style:
https://www.kernel.org/doc/Documentation/CodingStyle


C++ Language
-------------

Yosys is written in C++11. At the moment only constructs supported by
gcc 4.8 are allowed in Yosys code. This will change in future releases.

In general Yosys uses "int" instead of "size_t". To avoid compiler
warnings for implicit type casts, always use "GetSize(foobar)" instead
of "foobar.size()". (GetSize() is defined in kernel/yosys.h)

Use range-based for loops whenever applicable.
Loading

0 comments on commit d9ec35a

Please sign in to comment.