-
Notifications
You must be signed in to change notification settings - Fork 16
vhdl support and configuration page #72
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- | ||
-- Copyright (C) 2020 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 | ||
|
||
library IEEE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add some VHDL 2008 example too? That's one relevant feature of GHDL compared to almost any other available VHDL parsing tool. |
||
use IEEE.std_logic_1164.all; | ||
use IEEE.numeric_std.all; | ||
|
||
entity alu is | ||
port( | ||
a : in unsigned(3 downto 0); | ||
b : in unsigned(3 downto 0); | ||
s : in unsigned(1 downto 0); | ||
y : out unsigned(3 downto 0) | ||
); | ||
end alu; | ||
|
||
architecture rtl of alu is | ||
|
||
begin | ||
|
||
y <= a when s="00" else | ||
b when s="01" else | ||
"0000" when s="10" else | ||
a + b when s="11" else (others => '0'); | ||
|
||
end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Configuration | ||
============= | ||
|
||
This is the list of possible configurations that go in ``conf.py``. | ||
|
||
Yosys | ||
+++++ | ||
|
||
``hdl_diagram_yosys`` tells the program what version or binary of Yosys to use. | ||
By default it is set to ``YoWASP``. Setting it to ``system``, the program will | ||
use Yosys available in the current PATH. It can also contain the path to a specific | ||
Yosys binary.:: | ||
|
||
hdl_diagram_yosys = "yowasp" # default | ||
|
||
hdl_diagram_yosys = "system" # use yosys from PATH | ||
|
||
hdl_diagram_yosys = "<path-to-Yosys>" # use specific yosys binary | ||
|
||
|
||
netlistsvg | ||
++++++++++ | ||
|
||
netlistsvg can take various skin files for use when creating diagrams. It is | ||
set to ``default`` by default, using the built-in netlistsvg skin.:: | ||
|
||
hdl_diagram_skin = "<path-to-skin>" | ||
|
||
|
||
Output format | ||
+++++++++++++ | ||
|
||
The output format for the generated diagrams can either be set to ``svg`` or ``png``.:: | ||
|
||
hdl_diagram_output_format = "svg" | ||
|
||
hdl_diagram_output_format = "png" | ||
|
||
|
||
GHDL | ||
++++ | ||
|
||
ghdl-yosys-plugin can either be built into Yosys or loaded at runtime. If it is built into Yosys, | ||
then set this configuration option to ``built-in``. If it is loaded at runtime, then this can | ||
either be set to ``module`` if the shared library is located at ``YOSYS_PREFIX/share/yosys/plugins/ | ||
ghdl.so``, or as a path to the ``ghdl.so`` shared library. :: | ||
|
||
hdl_diagram_ghdl = "built-in" # default, if ghdl-yosys-plugin is built into Yosys | ||
|
||
hdl_diagram_ghdl = "module" # passes `-m ghdl` to Yosys | ||
|
||
hdl_diagram_ghdl = "<path-to-GHDL-shared-library>" # path to specific ghdl.so, | ||
# passes `-m '<path>'` to Yosys | ||
|
||
The VHDL standard used for GHDL can be set globally using this configuration option.:: | ||
|
||
hdl_diagram_ghdl_std = "08" # default, for VHDL 2008 | ||
|
||
hdl_diagram_ghdl_std = "97" # for VHDL 1993 | ||
|
||
Common Errors | ||
+++++++++++++ | ||
|
||
.. code-block:: | ||
|
||
ERROR: | ||
This version of Yosys cannot load plugins at runtime. | ||
Some plugins may have been included at build time. | ||
Use option `-H' to see the available built-in and plugin commands. | ||
|
||
This error signifies that the current version of Yosys cannot load plugins | ||
at runtime, and so all plugins must be prebuit. For VHDL, ``hdl_diagram_ghdl`` | ||
nobodywasishere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
must be set to ``built-in``. | ||
|
||
.. code-block:: | ||
|
||
ERROR: Can't guess frontend for input file `' (missing -f option)! | ||
|
||
This error signifies that the version of Yosys being used cannot figure out | ||
how to interpret the input file. For VHDL, this signifies that either GHDL | ||
isn't being loaded properly, or that the current version of Yosys isn't compatible | ||
with GHDL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
4 bit ALU in VHDL | ||
================= | ||
|
||
VHDL Code | ||
+++++++++ | ||
|
||
RST Directive | ||
************* | ||
|
||
.. code-block:: rst | ||
:linenos: | ||
|
||
.. no-license:: ../code/vhdl/alu.vhdl | ||
:language: vhdl | ||
:linenos: | ||
|
||
|
||
Result | ||
****** | ||
|
||
.. no-license:: ../code/vhdl/alu.vhdl | ||
:language: vhdl | ||
:linenos: | ||
|
||
Yosys BlackBox Diagram | ||
++++++++++++++++++++++ | ||
|
||
RST Directive | ||
************* | ||
|
||
.. code-block:: rst | ||
:linenos: | ||
:emphasize-lines: 2 | ||
|
||
.. hdl-diagram:: ../code/vhdl/alu.vhdl | ||
:type: yosys-bb | ||
:module: alu | ||
|
||
Result | ||
****** | ||
|
||
.. hdl-diagram:: ../code/vhdl/alu.vhdl | ||
:type: yosys-bb | ||
:module: alu | ||
|
||
|
||
Yosys AIG Diagram | ||
+++++++++++++++++ | ||
|
||
RST Directive | ||
************* | ||
|
||
.. code-block:: rst | ||
:linenos: | ||
:emphasize-lines: 2 | ||
|
||
.. hdl-diagram:: ../code/vhdl/alu.vhdl | ||
:type: yosys-aig | ||
:module: alu | ||
|
||
Result | ||
****** | ||
|
||
.. hdl-diagram:: ../code/vhdl/alu.vhdl | ||
:type: yosys-aig | ||
:module: alu | ||
|
||
|
||
NetlistSVG Diagram | ||
++++++++++++++++++ | ||
|
||
RST Directive | ||
************* | ||
|
||
.. code-block:: rst | ||
:linenos: | ||
:emphasize-lines: 2 | ||
|
||
.. hdl-diagram:: ../code/vhdl/alu.vhdl | ||
:type: netlistsvg | ||
:module: alu | ||
|
||
|
||
Result | ||
****** | ||
|
||
.. hdl-diagram:: ../code/vhdl/alu.vhdl | ||
:type: netlistsvg | ||
:module: alu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Examples | |
.. toctree:: | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
comb-full-adder | ||
carry4 | ||
carry4 | ||
alu-vhdl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.