2022-11-15 05:55:22 -06:00
|
|
|
.. _chapter:prog:
|
|
|
|
|
|
|
|
Programming Yosys extensions
|
|
|
|
============================
|
|
|
|
|
|
|
|
This chapter contains some bits and pieces of information about
|
|
|
|
programming yosys extensions. Also consult the section on programming in
|
|
|
|
the "Yosys Presentation" (can be downloaded from the Yosys website as
|
|
|
|
PDF) and don't be afraid to ask questions on the YosysHQ Slack.
|
|
|
|
|
|
|
|
Guidelines
|
|
|
|
----------
|
|
|
|
|
|
|
|
The guidelines directory contains notes on various aspects of Yosys
|
|
|
|
development. The files GettingStarted and CodingStyle may be of
|
|
|
|
particular interest, and are reproduced here.
|
|
|
|
|
2022-11-24 08:56:44 -06:00
|
|
|
.. literalinclude:: temp/GettingStarted
|
2022-11-15 05:55:22 -06:00
|
|
|
:language: none
|
|
|
|
:caption: guidelines/GettingStarted
|
|
|
|
|
2022-11-24 08:56:44 -06:00
|
|
|
.. literalinclude:: temp/CodingStyle
|
2022-11-15 05:55:22 -06:00
|
|
|
:language: none
|
|
|
|
:caption: guidelines/CodingStyle
|
|
|
|
|
|
|
|
The "stubsnets" example module
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
The following is the complete code of the "stubsnets" example module. It
|
|
|
|
is included in the Yosys source distribution as
|
2022-11-24 08:56:44 -06:00
|
|
|
docs/source/CHAPTER_Prog/stubnets.cc.
|
2022-11-15 05:55:22 -06:00
|
|
|
|
2022-11-24 08:56:44 -06:00
|
|
|
.. literalinclude:: CHAPTER_Prog/stubnets.cc
|
2022-11-15 05:55:22 -06:00
|
|
|
:language: c++
|
|
|
|
:linenos:
|
2022-11-24 08:56:44 -06:00
|
|
|
:caption: docs/source/CHAPTER_Prog/stubnets.cc
|
2022-11-15 05:55:22 -06:00
|
|
|
|
2022-11-24 08:56:44 -06:00
|
|
|
.. literalinclude:: CHAPTER_Prog/Makefile
|
2022-11-15 05:55:22 -06:00
|
|
|
:language: makefile
|
|
|
|
:linenos:
|
2022-11-24 08:56:44 -06:00
|
|
|
:caption: docs/source/CHAPTER_Prog/Makefile
|
2022-11-15 05:55:22 -06:00
|
|
|
|
2022-11-24 08:56:44 -06:00
|
|
|
.. literalinclude:: CHAPTER_Prog/test.v
|
2022-11-15 05:55:22 -06:00
|
|
|
:language: verilog
|
|
|
|
:linenos:
|
2022-11-24 08:56:44 -06:00
|
|
|
:caption: docs/source/CHAPTER_Prog/test.v
|