Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add second verion of glossary documentation #869

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
98eb096
Add second verion of glossary documentation
AllysonProlisko Aug 16, 2023
21bd9b4
Change wave form to waveform
AllysonProlisko Aug 16, 2023
9c25ed8
Fully-edited, version 3, of Glossary
AllysonProlisko Aug 18, 2023
9e7d6a9
Removing double spaces
AllysonProlisko Aug 18, 2023
6f51d98
Testing cross referencing within text
AllysonProlisko Aug 23, 2023
e4a0f96
Testing expansion of text on rollover
AllysonProlisko Aug 23, 2023
2058335
Retry abbreviation text
AllysonProlisko Aug 23, 2023
c091bc1
Attemp to fix abbr
AllysonProlisko Aug 23, 2023
62b8ba5
testing :term:
AllysonProlisko Aug 23, 2023
1175560
glossary tag
AllysonProlisko Aug 23, 2023
72f5380
Was it a blank line?
AllysonProlisko Aug 23, 2023
90f528c
testing indent
AllysonProlisko Aug 24, 2023
4a41fa8
indentation
AllysonProlisko Aug 24, 2023
0637067
more testing
AllysonProlisko Aug 24, 2023
a7409a2
more testing
AllysonProlisko Aug 24, 2023
2fb4a95
angle brackets
AllysonProlisko Aug 24, 2023
39144b2
changing link
AllysonProlisko Aug 24, 2023
d3ebf34
use amaranth
AllysonProlisko Aug 24, 2023
d6659d4
roll back
AllysonProlisko Aug 24, 2023
52353df
Expansion of terms in glossary
AllysonProlisko Aug 29, 2023
fa750d5
Expanded new terms
AllysonProlisko Aug 30, 2023
e434886
typos
AllysonProlisko Aug 30, 2023
13f064a
links in a row
AllysonProlisko Aug 30, 2023
99a97e4
test
AllysonProlisko Aug 30, 2023
b7186e7
more testing
AllysonProlisko Aug 30, 2023
8f5f4ff
spacing
AllysonProlisko Aug 30, 2023
f51b9cf
more spacing
AllysonProlisko Aug 30, 2023
04551f0
more spacing testing
AllysonProlisko Aug 30, 2023
65434cd
testing :term:
AllysonProlisko Aug 31, 2023
f4736dc
change to clb
AllysonProlisko Aug 31, 2023
00a9d54
chagne to clb
AllysonProlisko Aug 31, 2023
e63827f
clb second time
AllysonProlisko Aug 31, 2023
33add18
clb again
AllysonProlisko Aug 31, 2023
d4a7f99
links and more links
AllysonProlisko Aug 31, 2023
3468c4d
fixed errors
AllysonProlisko Aug 31, 2023
91d248e
Last error
AllysonProlisko Aug 31, 2023
7114bc2
The last last change
AllysonProlisko Aug 31, 2023
8f63d13
Edits
AllysonProlisko Aug 31, 2023
c76c826
Testing glossary links from other articles
AllysonProlisko Sep 4, 2023
0f12f9d
Abbreviations
AllysonProlisko Sep 4, 2023
e9a7a68
abbr
AllysonProlisko Sep 4, 2023
e5711a0
abbr 2
AllysonProlisko Sep 4, 2023
456970a
looking for abbr
AllysonProlisko Sep 4, 2023
d3ca050
Additional entries and edits
AllysonProlisko Sep 20, 2023
b997f0f
Link checking
AllysonProlisko Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added amaranth/.DS_Store
Binary file not shown.
332 changes: 332 additions & 0 deletions docs/glossary.rst

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Language & toolchain
platform
changes
contrib
glossary
16 changes: 8 additions & 8 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Introduction

The Amaranth project provides an open-source toolchain for developing hardware based on synchronous digital logic using the Python programming language. It aims to be easy to learn and use, reduce or eliminate common coding mistakes, and simplify the design of complex hardware with reusable components.

The Amaranth toolchain consists of the :ref:`Amaranth language <intro-lang>`, the :ref:`standard library <intro-stdlib>`, the :ref:`simulator <intro-sim>`, and the :ref:`build system <intro-build>`, covering all steps of a typical FPGA development workflow. At the same time, it does not restrict the designer's choice of tools: existing industry-standard (System)Verilog or VHDL code can be integrated into an Amaranth-based design flow, or, conversely, Amaranth code can be integrated into an existing Verilog-based design flow.
The Amaranth toolchain consists of the :ref:`Amaranth language <intro-lang>`, the :ref:`standard library <intro-stdlib>`, the :ref:`simulator <intro-sim>`, and the :ref:`build system <intro-build>`, covering all steps of a typical :abbr:`FPGA(Field Programmable Gate Array)` development workflow. At the same time, it does not restrict the designer's choice of tools: existing industry-standard (System)Verilog or VHDL code can be integrated into an Amaranth-based design flow, or, conversely, Amaranth code can be integrated into an existing Verilog-based design flow.

.. TODO: add links to connect_rpc docs once they exist

Expand All @@ -16,11 +16,11 @@ The Amaranth toolchain consists of the :ref:`Amaranth language <intro-lang>`, th
The Amaranth language
=====================

The :doc:`Amaranth hardware description language <lang>` is a Python library for register transfer level modeling of synchronous logic. Ordinary Python code is used to construct a netlist of a digital circuit, which can be simulated, directly synthesized via Yosys_, or converted to human-readable Verilog code for use with industry-standard toolchains.
The :doc:`Amaranth hardware description language <lang>` is a Python library for modeling of synchronous logic. Ordinary Python code is used to construct a netlist of a digital circuit, which can be simulated, directly synthesized via Yosys_, or converted to human-readable Verilog code for use with industry-standard toolchains.

By relying on the flexibility, rich functionality and widespread adoption of the Python language, the Amaranth language is focused on a single task: modeling digital logic well. It has first-class support for building blocks like clock domains and finite state machines, and uses simple rules for arithmetic operations that closely match the Python semantics. Python classes, functions, loops and conditionals can be used to build organized and flexible designs; Python libraries can be seamlessly used with Amaranth during design or verification; and Python development tools can process Amaranth code.
By relying on the flexibility, rich functionality and widespread adoption of the Python language, the Amaranth language is focused on a single task: modeling digital logic well. It has first-class support for building blocks like clock domains and :term:`finite state machines<Finite state machine>`, and uses simple rules for arithmetic operations that closely match the Python semantics. Python classes, functions, loops and conditionals can be used to build organized and flexible designs; Python libraries can be seamlessly used with Amaranth during design or verification; and Python development tools can process Amaranth code.

A core design principle of the Amaranth language is to be not only easy to use, but also hard to accidentally misuse. Some HDLs provide functionality that has unexpected and undesirable behavior in synthesis, often with expensive consequences, and require a significant effort in learning a "safe" coding style and adopting third-party linting tools. Amaranth lacks non-synthesizable constructs and avoids error-prone inference in favor of explicit instantiation. It has many diagnostics (and regularly adds new ones) highlighting potential design issues. Most importantly, all usability issues are considered `reportable bugs`_.
A core design principle of the Amaranth language is to be not only easy to use, but also hard to accidentally misuse. Some :abbr:`HDLs(Hardware defintion language)` provide functionality that has unexpected and undesirable behavior in synthesis, often with expensive consequences, and require a significant effort in learning a "safe" coding style and adopting third-party linting tools. Amaranth lacks non-synthesizable constructs and avoids error-prone inference in favor of explicit instantiation. It has many diagnostics (and regularly adds new ones) highlighting potential design issues. Most importantly, all usability issues are considered `reportable bugs`_.

.. _Yosys: https://yosyshq.net/yosys/
.. _reportable bugs: https://github.com/amaranth-lang/amaranth/issues
Expand All @@ -31,11 +31,11 @@ A core design principle of the Amaranth language is to be not only easy to use,
The Amaranth standard library
=============================

The Amaranth language comes with a standard library---a collection of essential digital design components and interfaces. It includes clock domain crossing primitives, synchronous and asynchronous FIFOs, a flexible I/O buffer interface, and more. By providing reliable building blocks out of the box, Amaranth allows the designer to focus on their application and avoids subtle differences in behavior between different designs.
The Amaranth language comes with a standard library---a collection of essential digital design components and interfaces. It includes clock domain crossing primitives, synchronous and asynchronous :abbr:`FIFOs(first in, first out)`, a flexible I/O buffer interface, and more. By providing reliable building blocks out of the box, Amaranth allows the designer to focus on their application and avoids subtle differences in behavior between different designs.

.. TODO: link to stdlib here

Clock domain crossing often requires special treatment, such as using vendor-defined attributes or instantiating device-specific primitives. The CDC primitives in the Amaranth standard library can be overridden by the platform integration, and every platform integration included with Amaranth follows the vendor recommendations for CDC.
Clock domain crossing (CDC) often requires special treatment, such as using vendor-defined attributes or instantiating device-specific primitives. The CDC primitives in the Amaranth standard library can be overridden by the platform integration, and every platform integration included with Amaranth follows the vendor recommendations for CDC.

High-speed designs usually require the use of registered (and sometimes, geared) I/O buffers. The Amaranth standard library provides a common interface to be used between I/O buffers and peripheral implementations. The Amaranth build system, if used, can instantiate I/O buffers for every platform integration included with Amaranth.

Expand Down Expand Up @@ -78,15 +78,15 @@ FPGA toolchain integration

Each FPGA family requires the use of synthesis and place & route tools specific for that device family. The Amaranth build system directly integrates with every major open-source and commercial FPGA toolchain, and can be easily extended to cover others.

Through this integration, Amaranth can specialize the CDC primitives and I/O buffers for a particular device and toolchain; generate I/O and clock constraints from board definition files; synchronize the power-on reset in single-clock designs; include (System)Verilog and VHDL files in the design (if supported by the toolchain); and finally, generate a script running synthesis, placement, routing, and timing analysis. The generated code can be customized to insert additional options, commands, constraints, and so on.
Through this integration, Amaranth can specialize the :abbr:`CDC(Clock domain crossing)` primitives and I/O buffers for a particular device and toolchain; generate I/O and clock constraints from board definition files; synchronize the power-on reset in single-clock designs; include (System)Verilog and VHDL files in the design (if supported by the toolchain); and finally, generate a script running synthesis, placement, routing, and timing analysis. The generated code can be customized to insert additional options, commands, constraints, and so on.

The Amaranth build system produces self-contained, portable build trees that require only the toolchain to be present in the environment. This makes builds easier to reproduce, or to run on a remote machine. The generated build scripts are always provided for both \*nix and Windows.


Development board definitions
-----------------------------

Getting started with a new FPGA development board often requires going through a laborous and error-prone process of deriving toolchain configuration and constraint files from the supplied documentation. The Amaranth project includes a community-maintained repository of definitions for many open-source and commercial FPGA development boards.
Getting started with a new FPGA development board often requires going through a laborious and error-prone process of deriving toolchain configuration and constraint files from the supplied documentation. The Amaranth project includes a community-maintained repository of definitions for many open-source and commercial FPGA development boards.

These board definitions contain everything that is necessary to start using the board: FPGA family and model, clocks and resets, descriptions of on-board peripherals (including pin direction and attributes such as I/O standard), connector pinouts, and for boards with a built-in debug probe, the steps required to program the board. It takes a single Python invocation to generate, build, and download a test design that shows whether the board, toolchain, and programmer are working correctly.

Expand Down
12 changes: 6 additions & 6 deletions docs/lang.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ All values have a ``.shape()`` method that computes their shape. The width of a
Values
======

The basic building block of the Amaranth language is a *value*, which is a term for a binary number that is computed or stored anywhere in the design. Each value has a *width*---the amount of bits used to represent the value---and a *signedness*---the interpretation of the value by arithmetic operations---collectively called its *shape*. Signed values always use `two's complement`_ representation.
The basic building block of the Amaranth language is a *value*, which is a term for a binary number that is computed or stored anywhere in the design. Each value has a *width*---the number of bits used to represent the value---and a *signedness*---the interpretation of the value by arithmetic operations---collectively called its *shape*. Signed values always use `two's complement`_ representation.

.. _two's complement: https://en.wikipedia.org/wiki/Two's_complement

Expand All @@ -98,7 +98,7 @@ The simplest Amaranth value is a *constant*, representing a fixed number, and in
>>> ten = Const(10)
>>> minus_two = C(-2)

The code above does not specify any shape for the constants. If the shape is omitted, Amaranth uses unsigned shape for positive numbers and signed shape for negative numbers, with the width inferred from the smallest amount of bits necessary to represent the number. As a special case, in order to get the same inferred shape for ``True`` and ``False``, ``0`` is considered to be 1-bit unsigned.
The code above does not specify any shape for the constants. If the shape is omitted, Amaranth uses unsigned shape for positive numbers and signed shape for negative numbers, with the width inferred from the smallest number of bits necessary to represent the number. As a special case, to get the same inferred shape for ``True`` and ``False``, ``0`` is considered to be 1-bit unsigned.

.. doctest::

Expand Down Expand Up @@ -468,7 +468,7 @@ Although the syntax is similar, it is important to remember that Amaranth values
...
TypeError: Attempted to convert Amaranth value to Python boolean

Because the value of ``a``, and therefore ``a == 0``, is not known at the time when the ``if`` statement is executed, there is no way to decide whether the body of the statement should be executed---in fact, if the design is synthesized, by the time ``a`` has any concrete value, the Python program has long finished! To solve this problem, Amaranth provides its own :ref:`control structures <lang-control>` that, also, manipulate circuits.
Because the value of ``a``, and therefore ``a == 0``, is not known at the time the ``if`` statement is executed, there is no way to decide whether the body of the statement should be executed---in fact, if the design is synthesized, by the time ``a`` has any concrete value, the Python program has long finished! To solve this problem, Amaranth provides its own :ref:`control structures <lang-control>` that, also, manipulate circuits.


.. _lang-widthext:
Expand All @@ -486,7 +486,7 @@ Arithmetic operators

Most arithmetic operations on integers provided by Python can be used on Amaranth values, too.

Although Python integers have unlimited precision and Amaranth values are represented with a :ref:`finite amount of bits <lang-values>`, arithmetics on Amaranth values never overflows because the width of the arithmetic expression is always sufficient to represent all possible results.
Although Python integers have unlimited precision and Amaranth values are represented with a :ref:`finite number of bits <lang-values>`, arithmetic computations on Amaranth values never overflows because the width of the arithmetic expression is always sufficient to represent all possible results.

.. doctest::

Expand Down Expand Up @@ -785,7 +785,7 @@ A *control domain* is a named group of :ref:`signals <lang-signals>` that change

All designs have a single predefined *combinatorial domain*, containing all signals that change immediately when any value used to compute them changes. The name ``comb`` is reserved for the combinatorial domain.

A design can also have any amount of user-defined *synchronous domains*, also called *clock domains*, containing signals that change when a specific edge occurs on the domain's clock signal or, for domains with asynchronous reset, on the domain's reset signal. Most modules only use a single synchronous domain, conventionally called ``sync``, but the name ``sync`` does not have to be used, and lacks any special meaning beyond being the default.
A design can also have any number of user-defined *synchronous domains*, also called *clock domains*, containing signals that change when a specific edge occurs on the domain's clock signal or, for domains with asynchronous reset, on the domain's reset signal. Most modules only use a single synchronous domain, conventionally called ``sync``, but the name ``sync`` does not have to be used, and lacks any special meaning beyond being the default.

The behavior of assignments differs for signals in :ref:`combinatorial <lang-comb>` and :ref:`synchronous <lang-sync>` domains. Collectively, signals in synchronous domains contain the state of a design, whereas signals in the combinatorial domain cannot form feedback loops or hold state.

Expand Down Expand Up @@ -887,7 +887,7 @@ Every signal included in the target of an assignment becomes a part of the domai
Assignment order
----------------

Unlike with two different domains, adding multiple assignments to the same signal to the same domain is well-defined.
In contrast to working with two different domains, adding multiple assignments to the same signal to the same domain is well-defined.

Assignments to different signal bits apply independently. For example, the following two snippets are equivalent:

Expand Down
2 changes: 1 addition & 1 deletion docs/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The test bench is implemented as a Python generator function that is co-simulate

.. TODO: link to simulator reference

When run, the test bench finishes successfully, since all of the assertions hold, and produces a VCD file with waveforms recorded for every ``Signal`` as well as the clock of the ``sync`` domain:
When run, the test bench finishes successfully, since all of the assertions hold, and produces a VCD (Value Change Dump) file with waveforms recorded for every ``Signal`` as well as the clock of the ``sync`` domain:

.. image:: _images/up_counter_gtkwave.png
:alt: A screenshot of GTKWave displaying waveforms near the clock cycle where the counter overflows.
Expand Down