All Projects → SymbiFlow → sphinxcontrib-hdl-diagrams

SymbiFlow / sphinxcontrib-hdl-diagrams

Licence: Apache-2.0 license
Sphinx Extension which generates various types of diagrams from Verilog code.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
Verilog
626 projects

Projects that are alternatives of or similar to sphinxcontrib-hdl-diagrams

virtio
Virtio implementation in SystemVerilog
Stars: ✭ 38 (+2.7%)
Mutual labels:  fpga, rtl, verilog, hdl
sv-tests
Test suite designed to check compliance with the SystemVerilog standard.
Stars: ✭ 148 (+300%)
Mutual labels:  rtl, verilog, hdl, symbiflow
gateware-ts
Hardware definition library and environment for designing and building digital hardware for FPGAs, using only open source tools
Stars: ✭ 83 (+124.32%)
Mutual labels:  fpga, verilog, hdl
Darkriscv
opensouce RISC-V cpu core implemented in Verilog from scratch in one night!
Stars: ✭ 1,062 (+2770.27%)
Mutual labels:  fpga, rtl, verilog
Ustc Rvsoc
FPGA-based RISC-V CPU+SoC.
Stars: ✭ 77 (+108.11%)
Mutual labels:  fpga, rtl, verilog
Verilog
Repository for basic (and not so basic) Verilog blocks with high re-use potential
Stars: ✭ 296 (+700%)
Mutual labels:  fpga, rtl, verilog
Spinalhdl
Scala based HDL
Stars: ✭ 696 (+1781.08%)
Mutual labels:  fpga, rtl, verilog
cnn open
A hardware implementation of CNN, written by Verilog and synthesized on FPGA
Stars: ✭ 157 (+324.32%)
Mutual labels:  fpga, rtl, verilog
Speech256
An FPGA implementation of a classic 80ies speech synthesizer. Done for the Retro Challenge 2017/10.
Stars: ✭ 51 (+37.84%)
Mutual labels:  fpga, verilog, hdl
Fpga readings
Recipe for FPGA cooking
Stars: ✭ 164 (+343.24%)
Mutual labels:  fpga, rtl, verilog
Logic
CMake, SystemVerilog and SystemC utilities for creating, building and testing RTL projects for FPGAs and ASICs.
Stars: ✭ 149 (+302.7%)
Mutual labels:  fpga, rtl, verilog
SpinalDev
Docker Development Environment for SpinalHDL
Stars: ✭ 17 (-54.05%)
Mutual labels:  fpga, rtl, verilog
Cores
Various HDL (Verilog) IP Cores
Stars: ✭ 271 (+632.43%)
Mutual labels:  fpga, rtl, verilog
Fake-SDcard
Imitate SDcard using FPGAs.
Stars: ✭ 26 (-29.73%)
Mutual labels:  fpga, rtl, verilog
xeda
Cross EDA Abstraction and Automation
Stars: ✭ 25 (-32.43%)
Mutual labels:  fpga, verilog, hdl
blarney
Haskell library for hardware description
Stars: ✭ 81 (+118.92%)
Mutual labels:  fpga, rtl, verilog
Rggen
Code generation tool for configuration and status registers
Stars: ✭ 54 (+45.95%)
Mutual labels:  fpga, rtl, verilog
FPGA-USB-Device
FPGA-based USB-device controller to implement USB-CDC, USB-HID, etc.
Stars: ✭ 29 (-21.62%)
Mutual labels:  fpga, rtl, verilog
VGChips
Video Game custom chips reverse-engineered from silicon
Stars: ✭ 86 (+132.43%)
Mutual labels:  fpga, verilog, hdl
Symbiflow Arch Defs
FOSS architecture definitions of FPGA hardware useful for doing PnR device generation.
Stars: ✭ 137 (+270.27%)
Mutual labels:  fpga, sphinx, verilog

sphinxcontrib-hdl-diagrams

PyPI PyPI version Documentation Build Status codecov

Sphinx Extension which generates various types of diagrams from HDL code, supporting Verilog, nMigen and RTLIL.

sphinxcontrib-hdl-diagrams is a Sphinx extension to make it easier to write nice documentation from HDL source files. It primarily uses Yosys to read the source files and generate the diagrams.

Check out the documentation for examples.

Installation

Python 3.5+ is required.

pip install sphinxcontrib-hdl-diagrams

Or,

python3 -m pip install sphinxcontrib-hdl-diagrams

Sphinx Integration

In your conf.py, add the following lines.

extensions = [
    ...,
    'sphinxcontrib_hdl_diagrams',
]

Non-Python Dependencies

These dependencies can be either installed on your system or install using the conda environment.yml file with;

conda XXXX

Required

By default, verilog-diagram uses the yowasp-yosys package provided in PyPI. It can be installed by running pip install -r requirements.txt. However, you could also use Yosys that is installed on your system, or point to the specific Yosys binary using verilog_diagram_yosys variable in the Sphinx conf.py file:

To use Yosys that is available in your system, use the following setting:

verilog_diagram_yosys = "system"

If you want to point to the specific Yosys binary, provide the path to the program:

verilog_diagram_yosys = "<path-to-Yosys>"

Optional

Usage

hdl-diagram

The hdl-diagram RST directive can be used to generate a diagram from Verilog code and include it in your documentation. Check out the examples to see how to use it.

.. hdl-diagram:: file.v
   :type: XXXXX
   :module: XXXX
   :skin: XXXX
   :yosys_script: XXXX
   :flatten:

Options

:type: - HDL Diagram Types;

  • yosys-blackbox - Netlist rendered by Yosys.
  • yosys-aig - Verilog file run through aigmap before image is generated directly in Yosys.
  • netlistsvg - Render output with netlistsvg

:module: - Which module to diagram.

:flatten: - Use the Yosys flatten command before generating the image.

Example

Here is a diagram of a 4-bit carry chain.

4-bit carry chain

no-license

This extension also provides the no-license directive which can be used to include code blocks from a file, but omitting the license header at the top of the file. It behaves like the literalinclude directive, but the lines option is overridden to only show the lines after the license header.

.. no-license:: verilog/dff.v
   :language: verilog
   :linenos:
   :caption: verilog/dff.v

Example

Here is a comparison between the literalinclude and no-license directives.

.. literalinclude:: verilog/dff.v
   :language: verilog
   :caption: verilog/dff.v
/*
 * Copyright (C) 2020-2021  The SymbiFlow Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

// Single flip-flip test.
module top(input clk, input di, output do);
  always @( posedge clk )
    do <= di;
endmodule // top
.. no-license:: verilog/dff.v
   :language: verilog
   :caption: verilog/dff.v
// Single flip-flip test.
module top(input clk, input di, output do);
  always @( posedge clk )
    do <= di;
endmodule // top

Licence

Apache 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].