diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-02-23 18:55:35 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-02-23 18:55:35 +0100 |
commit | e1bda63fb6765dcb064a24f982a6b854ae2a590f (patch) | |
tree | 05baf3fad7b36d9f05ded7d76ae6f4d47eba4cbc /doc | |
parent | ad37a1484212c80764ba3101f07e1d995fd11ad4 (diff) | |
download | ghdl-e1bda63fb6765dcb064a24f982a6b854ae2a590f.tar.gz ghdl-e1bda63fb6765dcb064a24f982a6b854ae2a590f.tar.bz2 ghdl-e1bda63fb6765dcb064a24f982a6b854ae2a590f.zip |
Prepare for release.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ghdl.texi | 1945 |
1 files changed, 1019 insertions, 926 deletions
diff --git a/doc/ghdl.texi b/doc/ghdl.texi index 8a21e6260..ff19c9ce8 100644 --- a/doc/ghdl.texi +++ b/doc/ghdl.texi @@ -21,7 +21,7 @@ @copying @quotation -GHDL 0.36-dev, Dec 15, 2017 +GHDL 0.36-rc1, Feb 23, 2019 Tristan Gingold and contributors @@ -59,17 +59,6 @@ Copyright @copyright{} 2015-2017, Tristan Gingold and contributors @c # define a hard kine break for HTML -@c # This file provides the following shields: travis-ci appveyor release -@c # license mailing gitter issues-new issues-open issues-closed issues-pr -@c # issues-pr-closed github gh-logo - -@c # Use http://b64.io/ to encode any image to base64. Then replace `/` with -@c # `%2F` and `+` with `%2B` (or use http://meyerweb.com/eric/tools/dencoder/). -@c # Beware that `?logo=data:image/png;base64,` must also be converted to -@c # percent encoding so that the URL is properly parsed. - - - __________________________________________________________________ @@ -82,7 +71,7 @@ LRM) is a plus. -This document was generated on Dec 15, 2017 - 06:26. +This document was generated on Feb 23, 2019 - 18:37. @c # preload commonly known graphical characters like (c) @@ -96,7 +85,6 @@ This document was generated on Dec 15, 2017 - 06:26. @c # define a hard kine break for HTML - @menu * About GHDL:: * Contributing:: @@ -145,6 +133,7 @@ Quick Start Guide * The heartbeat program:: * A full adder:: * Starting with a design:: +* Starting with your design:: Invoking GHDL @@ -391,32 +380,21 @@ Several third party projects are supported: VUnit@footnote{https://vunit.github. @c # define a hard kine break for HTML -@c # This file provides the following shields: travis-ci appveyor release -@c # license mailing gitter issues-new issues-open issues-closed issues-pr -@c # issues-pr-closed github gh-logo - -@c # Use http://b64.io/ to encode any image to base64. Then replace `/` with -@c # `%2F` and `+` with `%2B` (or use http://meyerweb.com/eric/tools/dencoder/). -@c # Beware that `?logo=data:image/png;base64,` must also be converted to -@c # percent encoding so that the URL is properly parsed. - - - @node Contributing,Copyrights | Licenses,About GHDL,Top @anchor{contribute contributing}@anchor{a}@anchor{contribute doc}@anchor{b}@anchor{contribute intro-contributing}@anchor{c} @chapter Contributing -The first step might be to use GHDL and explore it’s possibilities in an own project. If you are new to VHDL, see the +The first step might be to use GHDL and explore its possibilities in your own project. If you are new to VHDL, see the @ref{d,,Quick Start Guide} for an introduction. Furthermore, we encourage you to read @ref{e,,Invoking GHDL}, where the most commonly used options are explained. You can also check the complete @ref{f,,Command Reference}. -If you are more familiar with GHDL, you might start asking yourself how it works internally. Then, you might find +If you are more familiar with GHDL, you might start asking yourself how it works internally. If so, you might find @ref{10,,Implementation of VHDL} and @ref{11,,Implementation of VITAL} interesting. -While using GHDL, you might find flaws, such as bugs, missing features, typos in the documentation or topics which are -still not covered. In order to improve GHDL, we welcome bug reports, suggestions and contributions for any aspect of -GHDL. Either if it’s a bug or an enhancement, have a look at the and to see +While using GHDL, you might find flaws, such as bugs, missing features, typos in the documentation, or topics which still are +not covered. In order to improve GHDL, we welcome bug reports, suggestions, and contributions for any aspect of +GHDL. Whether it’s a bug or an enhancement, have a look at the and to see if someone already told us about it. You might find a solution there. If you found no information on your topic, please, report so that we are aware! You can reach us through various ways: @@ -463,19 +441,19 @@ If the compiler emits an error message for a perfectly valid input or does not e If the executable created from your VHDL sources crashes, this may be a bug at runtime or the code itself may be wrong. However, since VHDL has a notion of pointers, an erroneous VHDL program (using invalid pointers for example) may crash. @item -If a compiler message is not clear enough, please tell us. The error messages can be improved, but we have not enough experience with them. +If a compiler message is not clear enough, please tell us. The error messages can be improved, but we do not have enough experience with them. @end itemize @end quotation @end cartouche Please, report issues of this kind through , as this allows us to categorize issues into groups and -assign developers to them. You can track the issue’s state and see how it’s getting solved. +to assign developers to them. You can track the issue’s state and see how it’s getting solved. @cartouche @quotation Important -To make it easier, please elaborate a @cite{Minimum (non) Working Example} (MWE@footnote{https://en.wikipedia.org/wiki/Minimal_Working_Example}) prior to sending the report, so that the possible bug source is isolated. Shall the MWE compile and run, it is a good idea to make it look like a test and make an assert statement should finish the execution; the severity level @cite{note} indicates success, while a severity level @cite{failure} indicates failure. +As suggested in the bug report template, please elaborate a @cite{Minimal (non) Working Example} (MWE@footnote{https://en.wikipedia.org/wiki/Minimal_Working_Example}) prior to sending the report, so that the possible bug source is isolated. Should it fulfill the format requirements of issue-runner@footnote{https://github.com/1138-4EB/issue-runner}, you would be able to test your bug with the latest GHDL version. Please do so in order to ensure that the bug is not solved already. -Then, please include enough information for the maintainers to reproduce the problem. This includes: +Also, please include enough information in the bug report, for the maintainers to reproduce the problem. The template includes: @itemize * @@ -484,7 +462,7 @@ Then, please include enough information for the maintainers to reproduce the pro Operating system and version of GHDL (you can get it with @code{ghdl --version}). @item -Whether you have built GHDL from sources (provide short SHA of the used commit) or used the binary distribution (tell which release/tag). +Whether you have built GHDL from sources (provide short SHA of the used commit) or used the binary distribution (note which release/tag). @itemize * @@ -494,7 +472,7 @@ If you cannot compile, please report which compiler you are using and the versio @end itemize @item -Content of the input files which make the MWE +Content of the input files which comprise the MWE @item Description of the problem: @@ -506,7 +484,7 @@ Description of the problem: Comment explaining whether the MWE should compile or not; if yes, whether or not is should run until the assertion. @item -What you expected to happen and what you actually get. If you know the LRM well enough, please specify the paragraph which might be not well implemented. +What you expect to happen and what you actually get. If you know the LRM well enough, please specify which paragraph might not be implemented well. @item Samples of any log. @@ -520,7 +498,7 @@ Anything else that you think would be helpful. @cartouche @quotation Note -If you don’t know the LRM, be aware that an issue claimed as bug report may be rejected because there is no bug according to it. GHDL aims at implementing VHDL as defined in IEEE 1076@footnote{http://ieeexplore.ieee.org/document/4772740/}. However, some other tools allow constructs which do not fully follow the standard revisions. Therefore, comparisons with other VHDL is not a solid argument. Some of them are supported by GHDL (see @ref{14,,IEEE library pitfalls}), but any such enhancement will have very low priority. +If you don’t know the LRM, be aware that an issue claimed as a bug report may be rejected because there is no bug according to it. GHDL aims at implementing VHDL as defined in IEEE 1076@footnote{http://ieeexplore.ieee.org/document/4772740/}. However, some other tools allow constructs which do not fully follow the standard revisions. Therefore, comparisons with other VHDL is not a solid argument. Some of them are supported by GHDL (see @ref{14,,IEEE library pitfalls}), but any such enhancement will have very low priority. @end quotation @end cartouche @@ -541,7 +519,7 @@ All enhancements and feature requests are welcome. Please open a new issue@footn If you found a mistake in the documentation, please send a comment. If you didn’t understand some parts of this manual, please tell us. English is not our mother tongue, so this documentation may not be well-written. -Likewise, rewriting part of the documentation or missing content (such as, examples) is a good way to improve it. Since +Likewise, rewriting part of the documentation or missing content (such as examples) is a good way to improve it. Since it automatically is built from @cite{reStructuredText} and @cite{Markdown} sources, you can fork, modify and request the maintainers to pull your copy. See @ref{18,,Fork@comma{} modify and pull-request}. @@ -578,7 +556,7 @@ Make a copy (fork@footnote{https://help.github.com/articles/fork-a-repo/}) of th Do the changes you wish (edit, add, rename, move and/or delete). @item -When you think that the changes are ready to be merged, you notify the maintainers by opening a Pull Request@footnote{https://help.github.com/articles/creating-a-pull-request/} (PR). +When you think that the changes are ready to be merged, notify the maintainers by opening a Pull Request@footnote{https://help.github.com/articles/creating-a-pull-request/} (PR). @item The maintainers will review the proposed changes and will reply in the corresponding thread if any further modification is required. If so, you can keep adding commits to the same branch, and the PR will be automatically updated. @@ -622,17 +600,6 @@ If you have an interesting project, please send us feedback or get listed on our @c # define a hard kine break for HTML -@c # This file provides the following shields: travis-ci appveyor release -@c # license mailing gitter issues-new issues-open issues-closed issues-pr -@c # issues-pr-closed github gh-logo - -@c # Use http://b64.io/ to encode any image to base64. Then replace `/` with -@c # `%2F` and `+` with `%2B` (or use http://meyerweb.com/eric/tools/dencoder/). -@c # Beware that `?logo=data:image/png;base64,` must also be converted to -@c # percent encoding so that the URL is properly parsed. - - - @node Copyrights | Licenses,Quick Start Guide,Contributing,Top @anchor{licenses copyrights-licenses}@anchor{1d}@anchor{licenses doc}@anchor{1e}@anchor{licenses intro-copyrights}@anchor{1f} @chapter Copyrights | Licenses @@ -642,7 +609,7 @@ If you have an interesting project, please send us feedback or get listed on our @itemize - @item -The GHDL front-end, package @code{std.textio} and the runtime library, @code{grt}, are given under @ref{20,,GNU GPLv2}. +The GHDL front-end package @code{std.textio}, and the runtime library @code{grt} are given under @ref{20,,GNU GPLv2}. @item The documentation is given under @ref{21,,CC-BY-SA}. @@ -732,13 +699,13 @@ This is a free documentation; you can redistribute it and/or modify it under the @itemize - @item -@strong{Attribution}: you must provide the name of the creator and attribution parties (more info@footnote{https://wiki.creativecommons.org/wiki/License_Versions#Detailed_attribution_comparison_chart}), a copyright notice, a license notice, a disclaimer notice, a link to the material, a link to the license and indicate if changes were made (see marking guide@footnote{https://wiki.creativecommons.org/wiki/Best_practices_for_attribution#This_is_a_good_attribution_for_material_you_modified_slightly} and more info@footnote{https://wiki.creativecommons.org/wiki/License_Versions#Modifications_and_adaptations_must_be_marked_as_such} ). You may do so in any reasonable manner, but not in any way that suggests we endorses you or your use. +@strong{Attribution}: you must provide the name of the creator and attribution parties (more info@footnote{https://wiki.creativecommons.org/wiki/License_Versions#Detailed_attribution_comparison_chart}), a copyright notice, a license notice, a disclaimer notice, a link to the material, a link to the license and indicate if changes were made (see marking guide@footnote{https://wiki.creativecommons.org/wiki/Best_practices_for_attribution#This_is_a_good_attribution_for_material_you_modified_slightly} and more info@footnote{https://wiki.creativecommons.org/wiki/License_Versions#Modifications_and_adaptations_must_be_marked_as_such}). You may do so in any reasonable manner, but not in any way that suggests we endorse you or your use. @item @strong{ShareAlike}: if you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. @item -No additional restrictions: you may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. +@strong{No additional restrictions}: you may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. @end itemize See CC-BY-SA-4.0 Legal Code@footnote{https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt} for more details. @@ -753,7 +720,7 @@ See CC-BY-SA-4.0 Legal Code@footnote{https://creativecommons.org/licenses/by-sa/ @headitem Contributor @footnote{ -In alphabetical order. +In alphabetical order } @tab @@ -795,7 +762,7 @@ GCC 4.8.2 update, OSVVM port, some bugfixes @item Gingold, Tristan @footnote{ -Maintainer. +Maintainer } @tab @@ -855,7 +822,7 @@ Debian packaging Only those who made substantial contributions are shown in the table above, but many others contributed with minor patches. You can find a list at -With apologies to anyone who ought to be either on this table or in the GitHub contributor list, but isn’t. Thanks also to all those who have reported bugs and support issues, and often patches and testcases to either the late gna! website or sourceforge.net/p/ghdl-updates/tickets@footnote{https://sourceforge.net/p/ghdl-updates/tickets/} . +With apologies to anyone who ought to be either on this table or in the GitHub contributor list, but isn’t. Thanks also to all those who have reported bugs and support issues, and often patches and testcases to either the late gna! website or sourceforge.net/p/ghdl-updates/tickets@footnote{https://sourceforge.net/p/ghdl-updates/tickets/}. __________________________________________________________________ @@ -884,6 +851,7 @@ In this chapter, you will learn how to use @cite{GHDL} by working on a few examp * The heartbeat program:: * A full adder:: * Starting with a design:: +* Starting with your design:: @end menu @@ -892,10 +860,10 @@ In this chapter, you will learn how to use @cite{GHDL} by working on a few examp @section The @cite{‘Hello world’} program -To illustrate the large purpose of @cite{VHDL}, here is a commented @cite{‘Hello world’} program which saved in a file named @code{hello.vhdl}: +To illustrate the general purpose of @cite{VHDL}, here is a commented @cite{‘Hello world’} program which is saved in a file named @code{hello.vhdl}: @example --- Hello world program. +-- Hello world program use std.textio.all; -- Imports the standard textio package. -- Defines a design entity, without any ports. @@ -904,13 +872,13 @@ end hello_world; architecture behaviour of hello_world is begin - process - variable l : line; - begin - write (l, String'("Hello world!")); - writeline (output, l); - wait; - end process; + process + variable l : line; + begin + write (l, String'("Hello world!")); + writeline (output, l); + wait; + end process; end behaviour; @end example @@ -953,10 +921,10 @@ If a GCC/LLVM variant of @cite{GHDL} is used: @itemize * @item -@cite{Analysis} generates a file, @code{hello.o}, which is the object file corresponding to your @cite{VHDL} program. This is not created with mcode. +@cite{Analysis} generates a file, @code{hello.o}, which is the object file corresponding to your @cite{VHDL} program. This is not created with mcode. @item -The elaboration step is compulsory after the analysis and prior to launching the simulation; This wil generate an executable binary named @code{hello_world}. +The elaboration step is mandatory after running the analysis and prior to launching the simulation. This will generate an executable binary named @code{hello_world}. @item As a result, @ref{2b,,-r} is just a passthrough to the binary generated in the @cite{elaboration}. Therefore, the executable can be run directly, @code{./hello_world}. See @ref{2b,,-r} for more informartion. @@ -976,11 +944,16 @@ As a result, @ref{2b,,-r} is just a passthrough to the binary generated in the @ @example +library ieee; +use ieee.std_logic_1164.all; + entity heartbeat is - port ( clk: out std_logic; ) -end hearbeat; + port ( clk: out std_logic); +end heartbeat; -architecture behaviour of hello_world is +architecture behaviour of heartbeat +is + constant clk_period : time := 10 ns; begin -- Clock process definition clk_process: process @@ -998,26 +971,26 @@ end behaviour; @section A full adder -VHDL is generally used for hardware design. This example starts with a full adder@footnote{https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder} described in a file named @code{adder.vhdl}: +VHDL is generally used for hardware design. This example starts with a full adder@footnote{https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder} described in a file named @code{adder.vhdl}: @example entity adder is - -- `i0`, `i1` and the carry-in `ci` are inputs of the adder. + -- `i0`, `i1`, and the carry-in `ci` are inputs of the adder. -- `s` is the sum output, `co` is the carry-out. port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); end adder; architecture rtl of adder is begin - -- This full-adder architecture contains two concurrent assignment. - -- Compute the sum. - s <= i0 xor i1 xor ci; - -- Compute the carry. - co <= (i0 and i1) or (i0 and ci) or (i1 and ci); + -- This full-adder architecture contains two concurrent assignments. + -- Compute the sum. + s <= i0 xor i1 xor ci; + -- Compute the carry. + co <= (i0 and i1) or (i0 and ci) or (i1 and ci); end rtl; @end example -You can analyze this design file, @code{ghdl -a adder.vhdl}, and try to execute the @cite{adder} design. But this is useless, since nothing externally visible will happen. In order to check this full adder, a @emph{testbench} has to be run. This testbench is very simple, since the adder is also simple: it checks exhaustively all inputs. Note that only the behaviour is tested, timing constraints are not checked. A file named @code{adder_tb.vhdl} contains the testbench for the adder: +You can analyze this design file, @code{ghdl -a adder.vhdl}, and try to execute the @cite{adder} design. But this is useless, since nothing externally visible will happen. In order to check this full adder, a @emph{testbench} has to be run. This testbench is very simple, since the adder is also simple: it checks exhaustively all inputs. Note that only the behaviour is tested, timing constraints are not checked. A file named @code{adder_tb.vhdl} contains the testbench for the adder: @example -- A testbench has no ports. @@ -1025,57 +998,57 @@ entity adder_tb is end adder_tb; architecture behav of adder_tb is - -- Declaration of the component that will be instantiated. - component adder - port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); - end component; - - -- Specifies which entity is bound with the component. - for adder_0: adder use entity work.adder; - signal i0, i1, ci, s, co : bit; + -- Declaration of the component that will be instantiated. + component adder + port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); + end component; + + -- Specifies which entity is bound with the component. + for adder_0: adder use entity work.adder; + signal i0, i1, ci, s, co : bit; begin - -- Component instantiation. - adder_0: adder port map (i0 => i0, i1 => i1, ci => ci, - s => s, co => co); - - -- This process does the real job. - process - type pattern_type is record - -- The inputs of the adder. - i0, i1, ci : bit; - -- The expected outputs of the adder. - s, co : bit; - end record; - -- The patterns to apply. - type pattern_array is array (natural range <>) of pattern_type; - constant patterns : pattern_array := - (('0', '0', '0', '0', '0'), - ('0', '0', '1', '1', '0'), - ('0', '1', '0', '1', '0'), - ('0', '1', '1', '0', '1'), - ('1', '0', '0', '1', '0'), - ('1', '0', '1', '0', '1'), - ('1', '1', '0', '0', '1'), - ('1', '1', '1', '1', '1')); - begin - -- Check each pattern. - for i in patterns'range loop - -- Set the inputs. - i0 <= patterns(i).i0; - i1 <= patterns(i).i1; - ci <= patterns(i).ci; - -- Wait for the results. - wait for 1 ns; - -- Check the outputs. - assert s = patterns(i).s - report "bad sum value" severity error; - assert co = patterns(i).co - report "bad carry out value" severity error; - end loop; - assert false report "end of test" severity note; - -- Wait forever; this will finish the simulation. - wait; - end process; + -- Component instantiation. + adder_0: adder port map (i0 => i0, i1 => i1, ci => ci, + s => s, co => co); + + -- This process does the real job. + process + type pattern_type is record + -- The inputs of the adder. + i0, i1, ci : bit; + -- The expected outputs of the adder. + s, co : bit; + end record; + -- The patterns to apply. + type pattern_array is array (natural range <>) of pattern_type; + constant patterns : pattern_array := + (('0', '0', '0', '0', '0'), + ('0', '0', '1', '1', '0'), + ('0', '1', '0', '1', '0'), + ('0', '1', '1', '0', '1'), + ('1', '0', '0', '1', '0'), + ('1', '0', '1', '0', '1'), + ('1', '1', '0', '0', '1'), + ('1', '1', '1', '1', '1')); + begin + -- Check each pattern. + for i in patterns'range loop + -- Set the inputs. + i0 <= patterns(i).i0; + i1 <= patterns(i).i1; + ci <= patterns(i).ci; + -- Wait for the results. + wait for 1 ns; + -- Check the outputs. + assert s = patterns(i).s + report "bad sum value" severity error; + assert co = patterns(i).co + report "bad carry out value" severity error; + end loop; + assert false report "end of test" severity note; + -- Wait forever; this will finish the simulation. + wait; + end process; end behav; @end example @@ -1093,13 +1066,13 @@ Now, it is time to run the testbench, @code{ghdl -r adder_tb}, and check the res adder_tb.vhdl:52:7:(assertion note): end of test @end example -If your design is rather complex, you’d like to inspect signals. Signal values can be dumped using multiple formats (see section ‘@ref{2e,,Export waveforms}’ for more information). The resulting file can be read with a wave viewer such as GtkWave@footnote{http://gtkwave.sourceforge.net/}. +If your design is rather complex, you’d like to inspect signals. Signal values can be dumped using multiple formats (see section @ref{2e,,Export waveforms} for more information). The resulting file can be read with a wave viewer such as GtkWave@footnote{http://gtkwave.sourceforge.net/}. As explained in the manual@footnote{http://gtkwave.sourceforge.net/gtkwave.pdf}, GtkWave @emph{‘relies on a post-mortem approach through the use of dumpfiles’}. Therefore, you should first simulate your design and dump a waveform file, say VCD: @code{ghdl -r adder_tb --vcd=adder.vcd}. Then, you can view the dump: @code{gtkwave adder.vcd}. -See section ‘@ref{2f,,Simulation options}’, for more details on other runtime options. +See section @ref{2f,,Simulation options}, for more details on other runtime options. -@node Starting with a design,,A full adder,Quick Start Guide +@node Starting with a design,Starting with your design,A full adder,Quick Start Guide @anchor{using/QuickStartGuide starting-with-a-design}@anchor{30} @section Starting with a design @@ -1115,7 +1088,7 @@ First, untar the sources: @code{tar zxvf dlx.tar.gz}. @cartouche @quotation Hint -In order not to pollute the sources with the library, it is a good idea to create a @code{work/} subdirectory for the @cite{WORK} library. To any GHDL commands, we will add the @code{--workdir=work} option, so that all files generated by the compiler (except the executable) will be placed in this directory. +In order not to pollute the sources with the library, it is a good idea to create a @code{work/} subdirectory for the @cite{WORK} library. To any GHDL commands, we will add the @code{--workdir=work} option, so that all files generated by the compiler (except the executable) will be placed in this directory. @example $ cd dlx @@ -1128,10 +1101,10 @@ $ mkdir work @itemize * @item -Then, we will run the @code{dlx_test_behaviour} design. We need to analyze all the design units for the design hierarchy, in the correct order. GHDL provides an easy way to do this, by importing the sources, @code{ghdl -i --workdir=work *.vhdl}. +Then, we will run the @code{dlx_test_behaviour} design. We need to analyze all the design units for the design hierarchy, in the correct order. GHDL provides an easy way to do this, by importing the sources, @code{ghdl -i --workdir=work *.vhdl}. @item -GHDL knows all the design units of the DLX, but no one have been analyzed. Run the make option, @code{ghdl -m --workdir=work dlx_test_behaviour}, which analyzes and elaborates a design. This creates many files in the @code{work/} directory, and (GCC/LLVM only) the @code{dlx_test_behaviour} executable in the current directory. +GHDL knows all the design units of the DLX, but none of them has been analyzed. Run the make option, @code{ghdl -m --workdir=work dlx_test_behaviour}, which analyzes and elaborates a design. This creates many files in the @code{work/} directory, and (GCC/LLVM only) the @code{dlx_test_behaviour} executable in the current directory. @end itemize @cartouche @@ -1152,7 +1125,7 @@ dlx-behaviour.vhdl:395:11:(assertion note): TRAP instruction @end example @item -Last, since the clock is still running, you have to manually stop the program with the @code{C-c} key sequence. This behavior prevents you from running the test bench in batch mode. However, you may force the simulator to stop when an assertion above or equal a certain severity level occurs. To do so, call run with this option instead: @code{ghdl -r --workdir=work dlx_test_behaviour --assert-level=note`}. With this option, the program stops just after the previous message: +Lastly, since the clock is still running, you have to manually stop the program with the @code{C-c} key sequence. This behavior prevents you from running the test bench in batch mode. However, you may force the simulator to stop when an assertion above or equal a certain severity level occurs. To do so, call run with this option instead: @code{ghdl -r --workdir=work dlx_test_behaviour --assert-level=note`}. With this option, the program stops just after the previous message: @example dlx-behaviour.vhdl:395:11:(assertion note): TRAP instruction @@ -1172,7 +1145,7 @@ If you want to make room on your hard drive, you can either: Clean the design library with the GHDL command @code{ghdl --clean --workdir=work}. This removes the executable and all the object files. If you want to rebuild the design at this point, just do the make command as shown above. @item -Remove the design library with the GHDL command @code{ghdl --remove --workdir=work}. This removes the executable, all the object files and the library file. If you want to rebuild the design, you have to import the sources again, and to make the design. +Remove the design library with the GHDL command @code{ghdl --remove --workdir=work}. This removes the executable, all the object files and the library file. If you want to rebuild the design, you have to import the sources again and make the design. @item Remove the @code{work/} directory: @code{rm -rf work}. Only the executable is kept. If you want to rebuild the design, create the @code{work/} directory, import the sources, and make the design. @@ -1182,10 +1155,46 @@ Remove the @code{work/} directory: @code{rm -rf work}. Only the executable is ke @cartouche @quotation Warning -Sometimes, a design does not fully follow the VHDL standards. For example it uses the badly engineered @code{std_logic_unsigned} package. GHDL supports this VHDL dialect through some options: @code{--ieee=synopsys -fexplicit}. See section ‘@ref{14,,IEEE library pitfalls}’, for more details. +Sometimes, a design does not fully follow the VHDL standards. For example it might use the badly engineered @code{std_logic_unsigned} package. GHDL supports this VHDL dialect through some options: @code{--ieee=synopsys -fexplicit}. See section @ref{14,,IEEE library pitfalls}, for more details. @end quotation @end cartouche +@node Starting with your design,,Starting with a design,Quick Start Guide +@anchor{using/QuickStartGuide starting-with-your-design}@anchor{31} +@section Starting with your design + + +Usually your design is more complex than the previous ones. The main +tips are: + + +@itemize * + +@item +Don’t forget to select the VHDL standard you want to use. The +default is @code{--std=93c} which means VHDL-93 with some relaxed +rules. Use @code{--std=08} for VHDL-2008 (albeit not fully +implemented). All the units must be analyzed with the same standard. + +@item +Use @code{--work=NAME} to analyze files into the @code{NAME} library. +If you analyze other files from a different directory, give the path +of the @code{NAME} library using @code{-P/PATH/TO/NAME/DIRECTORY/}. + +@item +Use @code{--ieee=synopsys} if your design depends on the non-standard +ieee library. + +@item +Use @code{-fexplicit} if needed. + +@item +Use the same options for elaboration. +@end itemize + +So, to analyze a file: @code{ghdl -a --std=08 --work=mylib myfile.vhdl} +To elaborate and run: @code{ghdl --elab-run --std=08 top}. + @c # preload commonly known graphical characters like (c) @c This data file has been placed in the public domain. @@ -1198,7 +1207,7 @@ Sometimes, a design does not fully follow the VHDL standards. For example it use @c # define a hard kine break for HTML @node Invoking GHDL,Simulation and runtime,Quick Start Guide,Top -@anchor{using/InvokingGHDL using-invoking}@anchor{e}@anchor{using/InvokingGHDL doc}@anchor{31}@anchor{using/InvokingGHDL invoking-ghdl}@anchor{32} +@anchor{using/InvokingGHDL using-invoking}@anchor{e}@anchor{using/InvokingGHDL doc}@anchor{32}@anchor{using/InvokingGHDL invoking-ghdl}@anchor{33} @chapter Invoking GHDL @@ -1222,13 +1231,13 @@ If the number of options is large and the command line length is beyond the syst @cartouche @quotation Hint -Only the most common commands and options are shown here. For most advanced and experimental features see section @ref{f,,Command Reference}. +Only the most common commands and options are shown here. For the most advanced and experimental features see section @ref{f,,Command Reference}. @end quotation @end cartouche @cartouche @quotation Warning -During analysis and elaboration GHDL may read the @code{std} and @code{ieee} files. The location of these files is based on the prefix, which is (in priority order): +During analysis and elaboration GHDL may read the @code{std} and @code{ieee} files. The location of these files is based on the prefix, which is (in order of priority): @quotation @@ -1242,13 +1251,13 @@ the @code{--PREFIX} command line option the @geindex GHDL_PREFIX @geindex environment variable; GHDL_PREFIX -@ref{33,,GHDL_PREFIX} environment variable +@ref{34,,GHDL_PREFIX} environment variable @item a built-in default path. It is a hard-coded path on GNU/Linux, and it corresponds to the value of the @code{HKLM\Software\Ghdl\Install_Dir} registry entry on Windows. @end itemize -You should use the @ref{34,,--disp-config} command to display and debug installation problems. +You should use the @ref{35,,--disp-config} command to display and debug installation problems. @end quotation @end quotation @end cartouche @@ -1266,11 +1275,11 @@ You should use the @ref{34,,--disp-config} command to display and debug installa @end menu @node Design building commands,Design rebuilding commands,,Invoking GHDL -@anchor{using/InvokingGHDL design-building-commands}@anchor{35} +@anchor{using/InvokingGHDL design-building-commands}@anchor{36} @section Design building commands -The mostly used commands of GHDL are those to analyze and elaborate a design. +The most commonly used commands of GHDL are those to analyze and elaborate a design. @geindex cmd analysis @@ -1285,23 +1294,23 @@ The mostly used commands of GHDL are those to analyze and elaborate a design. @end menu @node Analysis [-a],Elaboration [-e],,Design building commands -@anchor{using/InvokingGHDL analysis-a}@anchor{36} +@anchor{using/InvokingGHDL analysis-a}@anchor{37} @subsection Analysis [@code{-a}] @geindex ghdl command line option; -a <[options...] file...> -@anchor{using/InvokingGHDL cmdoption-ghdl-a}@anchor{37} +@anchor{using/InvokingGHDL cmdoption-ghdl-a}@anchor{38} @deffn {Option} @w{-}a <[options...] file...> @end deffn Analyzes/compiles one or more files, and creates an object file for each source file. Any argument starting with a dash is an option, the others are filenames. No options are allowed after a filename argument. GHDL analyzes each filename in the given order, and stops the analysis in case of error (remaining files are not analyzed). -See GHDL_options, for details on the GHDL options. For example, to produce debugging information such as line numbers, use: @code{ghdl -a -g my_design.vhdl}. +See @ref{39,,Options}, for details on the GHDL options. For example, to produce debugging information such as line numbers, use: @code{ghdl -a -g my_design.vhdl}. @geindex cmd elaboration @node Elaboration [-e],Run [-r],Analysis [-a],Design building commands -@anchor{using/InvokingGHDL elaboration-e}@anchor{38} +@anchor{using/InvokingGHDL elaboration-e}@anchor{3a}@anchor{using/InvokingGHDL elaboration-command}@anchor{3b} @subsection Elaboration [@code{-e}] @@ -1310,7 +1319,7 @@ See GHDL_options, for details on the GHDL options. For example, to produce debug @deffn {Option} @w{-}e <[options...] primary_unit [secondary_unit]> @end deffn -Re-analyzes all the configurations, entities, architectures and package declarations, and creates the default configurations and the default binding indications according to the LRM rules. It also generates the list of objects files required for the executable. Then, it links all these files with the runtime library. The actual elaboration is performed at runtime. +Re-analyzes all the configurations, entities, architectures and package declarations, and creates the default configurations and the default binding indications according to the LRM rules. It also generates the list of object files required for the executable. Then, it links all these files with the runtime library. The actual elaboration is performed at runtime. @itemize * @@ -1335,22 +1344,22 @@ an entity unit followed by a name of an architecture unit @end quotation @end itemize -Name of the units must be a simple name, without any dot. You can select the name of the @cite{WORK} library with the @code{--work=NAME} option, as described in GHDL_options. See section ‘@ref{39,,Top entity}’, for the restrictions on the root design of a hierarchy. +Name of the units must be a simple name, without any dot. You can select the name of the @cite{WORK} library with the @code{--work=NAME} option, as described in @ref{39,,Options}. See section @ref{3c,,Top entity}, for the restrictions on the root design of a hierarchy. @itemize * @item -If the GCC/LLVM backend was enabled during the compilation of GHDL, the elaboration command creates an executable containing the code of the VHDL sources, the elaboration code and simulation code to execute a design hierarchy. The executable is created in the current directory and the the filename is the name of the primary unit, or for the later case, the concatenation of the name of the primary unit, a dash, and the name of the secondary unit (or architecture). Option @code{-o} followed by a filename can override the default executable filename. +If the GCC/LLVM backend was enabled during the compilation of GHDL, the elaboration command creates an executable containing the code of the VHDL sources, the elaboration code and simulation code to execute a design hierarchy. The executable is created in the current directory and the the filename is the name of the primary unit, or for the latter case, the concatenation of the name of the primary unit, a dash, and the name of the secondary unit (or architecture). Option @code{-o} followed by a filename can override the default executable filename. @item -If mcode is used, this command elaborates the design but does not generate anything. Since the run command also elaborates the design, this con be skipped. +If mcode is used, this command elaborates the design but does not generate anything. Since the run command also elaborates the design, this can be skipped. @end itemize @geindex cmd run @node Run [-r],Elaborate and run [--elab-run],Elaboration [-e],Design building commands -@anchor{using/InvokingGHDL run-r}@anchor{3a} +@anchor{using/InvokingGHDL run-r}@anchor{3d} @subsection Run [@code{-r}] @@ -1380,23 +1389,23 @@ This command exists for three reasons: You are using GCC/LLVM, but you don’t need to create the executable program name. @item -It is coherent with the @ref{37,,-a} and @ref{2a,,-e} commands. +It is coherent with the @ref{38,,-a} and @ref{2a,,-e} commands. @item It works with mcode implementation, where the executable code is generated in memory. @end itemize -See section ‘@ref{3b,,Simulation and runtime}’, for details on options. +See section @ref{3e,,Simulation and runtime}, for details on options. @geindex cmd elaborate and run @node Elaborate and run [--elab-run],Check syntax [-s],Run [-r],Design building commands -@anchor{using/InvokingGHDL elaborate-and-run-elab-run}@anchor{3c} +@anchor{using/InvokingGHDL elaborate-and-run-elab-run}@anchor{3f} @subsection Elaborate and run [@code{--elab-run}] @geindex ghdl command line option; --elab-run <[elab_options...] primary_unit [secondary_unit] [run_options...]> -@anchor{using/InvokingGHDL cmdoption-ghdl-elab-run}@anchor{3d} +@anchor{using/InvokingGHDL cmdoption-ghdl-elab-run}@anchor{40} @deffn {Option} @w{-}@w{-}elab@w{-}run <[elab_options...] primary_unit [secondary_unit] [run_options...]> @end deffn @@ -1405,12 +1414,12 @@ Acts like the elaboration command (see @ref{2a,,-e}) followed by the run command @geindex cmd checking syntax @node Check syntax [-s],Analyze and elaborate [-c],Elaborate and run [--elab-run],Design building commands -@anchor{using/InvokingGHDL check-syntax-s}@anchor{3e} +@anchor{using/InvokingGHDL check-syntax-s}@anchor{41} @subsection Check syntax [@code{-s}] @geindex ghdl command line option; -s <[options] files> -@anchor{using/InvokingGHDL cmdoption-ghdl-s}@anchor{3f} +@anchor{using/InvokingGHDL cmdoption-ghdl-s}@anchor{42} @deffn {Option} @w{-}s <[options] files> @end deffn @@ -1419,12 +1428,12 @@ Analyze files but do not generate code. This command may be used to check the sy @geindex cmd analyze and elaborate @node Analyze and elaborate [-c],,Check syntax [-s],Design building commands -@anchor{using/InvokingGHDL analyze-and-elaborate-c}@anchor{40} +@anchor{using/InvokingGHDL analyze-and-elaborate-c}@anchor{43} @subsection Analyze and elaborate [@code{-c}] @geindex ghdl command line option; -c <[options] file... -<e|r> primary_unit [secondary_unit]> -@anchor{using/InvokingGHDL cmdoption-ghdl-c}@anchor{41} +@anchor{using/InvokingGHDL cmdoption-ghdl-c}@anchor{44} @deffn {Option} @w{-}c <[options] file... @w{-}<e|r> primary_unit [secondary_unit]> @end deffn @@ -1434,7 +1443,7 @@ With GCC/LLVM, @ref{2a,,-e} should be used, and @ref{2b,,-r} with mcode. @end quotation @end cartouche -The files are first parsed, and then a elaboration is performed, which drives an analysis. Effectively, analysis and elaboration are combined, but there is no explicit call to @ref{37,,-a}. With GCC/LLVM, code is generated during the elaboration. With mcode, the simulation is launched after the elaboration. +The files are first parsed, and then a elaboration is performed, which drives an analysis. Effectively, analysis and elaboration are combined, but there is no explicit call to @ref{38,,-a}. With GCC/LLVM, code is generated during the elaboration. With mcode, the simulation is launched after the elaboration. All the units of the files are put into the @cite{work} library. But, the work library is neither read from disk nor saved. Therefore, you must give all the files of the @cite{work} library your design needs. @@ -1453,12 +1462,12 @@ Since the files are only parsed once, the compilation cycle may be faster. You don’t need to know an analysis order. @item -This command produces smaller executable, since unused units and subprograms do not generate code. +This command produces a smaller executable, since unused units and subprograms do not generate code. @end itemize @cartouche @quotation Hint -However, you should know that currently most of the time is spent in code generation and the analyze and elaborate command generate code for all units needed, even units of @code{std} and @code{ieee} libraries. Therefore, according to the design, the time for this command may be higher than the time for the analyze command followed by the elaborate command. +However, you should know that most of the time is spent in code generation and the analyze and elaborate command generates code for all units needed, even units of @code{std} and @code{ieee} libraries. Therefore, according to the design, the time for this command may be higher than the time for the analyze command followed by the elaborate command. @end quotation @end cartouche @@ -1469,11 +1478,11 @@ This command is still under development. In case of problems, you should go back @end cartouche @node Design rebuilding commands,Options,Design building commands,Invoking GHDL -@anchor{using/InvokingGHDL design-rebuilding-commands}@anchor{42} +@anchor{using/InvokingGHDL design-rebuilding-commands}@anchor{45} @section Design rebuilding commands -Analyzing and elaborating a design consisting in several files can be tricky, due to dependencies. GHDL has a few commands to rebuild a design. +Analyzing and elaborating a design consisting of several files can be tricky, due to dependencies. GHDL has a few commands to rebuild a design. @geindex cmd importing files @@ -1486,16 +1495,16 @@ Analyzing and elaborating a design consisting in several files can be tricky, du @end menu @node Import [-i],Make [-m],,Design rebuilding commands -@anchor{using/InvokingGHDL import-i}@anchor{43} +@anchor{using/InvokingGHDL import-i}@anchor{46} @subsection Import [@code{-i}] @geindex ghdl command line option; -i <[options] file...> -@anchor{using/InvokingGHDL cmdoption-ghdl-i}@anchor{44} +@anchor{using/InvokingGHDL cmdoption-ghdl-i}@anchor{47} @deffn {Option} @w{-}i <[options] file...> @end deffn -All the files specified in the command line are scanned, parsed and added in the libraries but as not yet analyzed. No object files are created. It’s purpose is to localize design units in the design files. The make command will then be able to recursively build a hierarchy from an entity name or a configuration name. +All the files specified in the command line are scanned, parsed and added into the libraries but as not yet analyzed. No object files are created. Its purpose is to localize design units in the design files. The make command will then be able to recursively build a hierarchy from an entity name or a configuration name. @cartouche @quotation Hint @@ -1511,35 +1520,35 @@ Since the files are parsed, there must be correct files. However, since they are @end quotation @end cartouche -See @ref{45,,-m}, to actually build the design. +See @ref{48,,-m}, to actually build the design. @geindex cmd make @node Make [-m],Generate Makefile [--gen-makefile],Import [-i],Design rebuilding commands -@anchor{using/InvokingGHDL make-m}@anchor{46} +@anchor{using/InvokingGHDL make-m}@anchor{49} @subsection Make [@code{-m}] @geindex ghdl command line option; -m <[options] primary [secondary]> -@anchor{using/InvokingGHDL cmdoption-ghdl-m}@anchor{45} +@anchor{using/InvokingGHDL cmdoption-ghdl-m}@anchor{48} @deffn {Option} @w{-}m <[options] primary [secondary]> @end deffn -Analyze automatically outdated files and elaborate a design. The primary unit denoted by the @code{primary} argument must already be known by the system, either because you have already analyzed it (even if you have modified it) or because you have imported it. A file may be outdated because it has been modified (e.g. you just have edited it), or because a design unit contained in the file depends on a unit which is outdated. This rule is of course recursive. +Analyze automatically outdated files and elaborate a design. The primary unit denoted by the @code{primary} argument must already be known by the system, either because you have already analyzed it (even if you have modified it) or because you have imported it. A file may be outdated because it has been modified (e.g. you have just edited it), or because a design unit contained in the file depends on a unit which is outdated. This rule is of course recursive. @itemize * @item -With option @ref{47,,--bind}, GHDL will stop before the final linking step. This is useful when the main entry point is not GHDL and you’re linking GHDL object files into a foreign program. +With option @ref{4a,,--bind}, GHDL will stop before the final linking step. This is useful when the main entry point is not GHDL and you’re linking GHDL object files into a foreign program. @item -With option @ref{48,,-f} (force), GHDL analyzes all the units of the work library needed to create the design hierarchy. Not outdated units are recompiled. This is useful if you want to compile a design hierarchy with new compilation flags (for example, to add the @emph{-g} debugging option). +With option @ref{4b,,-f} (force), GHDL analyzes all the units of the work library needed to create the design hierarchy. Outdated units are recompiled. This is useful if you want to compile a design hierarchy with new compilation flags (for example, to add the @emph{-g} debugging option). @end itemize The make command will only re-analyze design units in the work library. GHDL fails if it has to analyze an outdated unit from another library. -The purpose of this command is to be able to compile a design without prior knowledge of file order. In the VHDL model, some units must be analyzed before others (e.g. an entity before its architecture). It might be a nightmare to analyze a full design of several files, if you don’t have the ordered list of file. This command computes an analysis order. +The purpose of this command is to be able to compile a design without prior knowledge of file order. In the VHDL model, some units must be analyzed before others (e.g. an entity before its architecture). It might be a nightmare to analyze a full design of several files if you don’t have the ordered list of files. This command computes an analysis order. The make command fails when a unit was not previously parsed. For example, if you split a file containing several design units into several files, you must either import these new files or analyze them so that GHDL knows in which file these units are. @@ -1550,36 +1559,36 @@ This is not perfect, since the default architecture (the most recently analyzed @geindex cmd generate makefile @node Generate Makefile [--gen-makefile],Generate dependency file command [--gen-depends],Make [-m],Design rebuilding commands -@anchor{using/InvokingGHDL generate-makefile-gen-makefile}@anchor{49} +@anchor{using/InvokingGHDL generate-makefile-gen-makefile}@anchor{4c} @subsection Generate Makefile [@code{--gen-makefile}] @geindex ghdl command line option; --gen-makefile <[options] primary [secondary]> -@anchor{using/InvokingGHDL cmdoption-ghdl-gen-makefile}@anchor{4a} +@anchor{using/InvokingGHDL cmdoption-ghdl-gen-makefile}@anchor{4d} @deffn {Option} @w{-}@w{-}gen@w{-}makefile <[options] primary [secondary]> @end deffn -This command works like the make command (see @ref{45,,-m}), but only a makefile is generated on the standard output. +This command works like the make command (see @ref{48,,-m}), but only a makefile is generated on the standard output. @geindex --gen-depends command @node Generate dependency file command [--gen-depends],,Generate Makefile [--gen-makefile],Design rebuilding commands -@anchor{using/InvokingGHDL generate-dependency-file-command-gen-depends}@anchor{4b} +@anchor{using/InvokingGHDL generate-dependency-file-command-gen-depends}@anchor{4e} @subsection Generate dependency file command [@code{--gen-depends}] @geindex ghdl command line option; --gen-depends <[options] primary [secondary]> -@anchor{using/InvokingGHDL cmdoption-ghdl-gen-depends}@anchor{4c} +@anchor{using/InvokingGHDL cmdoption-ghdl-gen-depends}@anchor{4f} @deffn {Option} @w{-}@w{-}gen@w{-}depends <[options] primary [secondary]> @end deffn Generate a Makefile containing only dependencies to build a design unit. -This command works like the make and gen-makefile commands (see @ref{45,,-m}), but instead of a full makefile only dependencies without rules are generated on the standard output. +This command works like the make and gen-makefile commands (see @ref{48,,-m}), but instead of a full makefile only dependencies without rules are generated on the standard output. Theses rules can then be integrated in another Makefile. @node Options,Warnings,Design rebuilding commands,Invoking GHDL -@anchor{using/InvokingGHDL options}@anchor{4d} +@anchor{using/InvokingGHDL ghdl-options}@anchor{39}@anchor{using/InvokingGHDL options}@anchor{50} @section Options @@ -1593,42 +1602,42 @@ Theses rules can then be integrated in another Makefile. @cartouche @quotation Hint -Besides the options described below, @cite{GHDL} passes any debugging options (those that begin with -g@footnote{http://poc-library.readthedocs.io/en/release/References/CmdRefs/PoC.html#cmdoption-poc-py-xsim-g}) and optimizations options (those that begin with -O@footnote{https://docs.python.org/3.6/using/cmdline.html#cmdoption-o} or @ref{48,,-f}) to @cite{GCC}. Refer to the @cite{GCC} manual for details. +Besides the options described below, @cite{GHDL} passes any debugging options (those that begin with @code{-g}) and optimizations options (those that begin with -O@footnote{https://docs.python.org/3.6/using/cmdline.html#cmdoption-o} or @ref{4b,,-f}) to @cite{GCC}. Refer to the @cite{GCC} manual for details. @end quotation @end cartouche @geindex WORK library -@geindex ghdl command line option; --work<=NAME> -@anchor{using/InvokingGHDL cmdoption-ghdl-work}@anchor{4e} -@deffn {Option} @w{-}@w{-}work<=NAME> +@geindex ghdl command line option; --work=<NAME> +@anchor{using/InvokingGHDL cmdoption-ghdl-work}@anchor{51} +@deffn {Option} @w{-}@w{-}work=<NAME> -Specify the name of the @code{WORK} library. Analyzed units are always placed in the library logically named @code{WORK}. With this option, you can set its name. By default, the name is @code{work}. +Specify the name of the @code{WORK} library. Analyzed units are always placed in the library logically named @code{WORK}. With this option, you can set its name. By default, the name is @code{work}. -@cite{GHDL} checks whether @code{WORK} is a valid identifier. Although being more or less supported, the @code{WORK} identifier should not be an extended identifier, since the filesystem may prevent it from correctly working (due to case sensitivity or forbidden characters in filenames). +@cite{GHDL} checks whether @code{WORK} is a valid identifier. Although being more or less supported, the @code{WORK} identifier should not be an extended identifier, since the filesystem may prevent it from working correctly (due to case sensitivity or forbidden characters in filenames). -@cite{VHDL} rules forbid you to add units to the @code{std} library. Furthermore, you should not put units in the @code{ieee} library. +@cite{VHDL} rules forbid you from adding units to the @code{std} library. Furthermore, you should not put units in the @code{ieee} library. @end deffn -@geindex ghdl command line option; --workdir<=DIR> -@anchor{using/InvokingGHDL cmdoption-ghdl-workdir}@anchor{4f} -@deffn {Option} @w{-}@w{-}workdir<=DIR> +@geindex ghdl command line option; --workdir=<DIR> +@anchor{using/InvokingGHDL cmdoption-ghdl-workdir}@anchor{52} +@deffn {Option} @w{-}@w{-}workdir=<DIR> -Specify the directory where the @code{WORK} library is located. When this option is not present, the @code{WORK} library is in the current directory. The object files created by the compiler are always placed in the same directory as the @code{WORK} library. +Specify the directory where the @code{WORK} library is located. When this option is not present, the @code{WORK} library is in the current directory. The object files created by the compiler are always placed in the same directory as the @code{WORK} library. Use option @code{-P} to specify where libraries other than @code{WORK} are placed. @end deffn -@geindex ghdl command line option; --std<=STD> -@anchor{using/InvokingGHDL cmdoption-ghdl-std}@anchor{50} -@deffn {Option} @w{-}@w{-}std<=STD> +@geindex ghdl command line option; --std=<STD> +@anchor{using/InvokingGHDL cmdoption-ghdl-std}@anchor{53} +@deffn {Option} @w{-}@w{-}std=<STD> -Specify the standard to use. By default, the standard is @code{93c}, which means VHDL-93 accepting VHDL-87 syntax. For details on @code{STD} values see section ‘@ref{51,,VHDL standards}’. +Specify the standard to use. By default, the standard is @code{93c}, which means VHDL-93 accepting VHDL-87 syntax. For details on @code{STD} values see section @ref{54,,VHDL standards}. @end deffn -@geindex ghdl command line option; --ieee<=VER> -@anchor{using/InvokingGHDL cmdoption-ghdl-ieee}@anchor{52} -@deffn {Option} @w{-}@w{-}ieee<=VER> +@geindex ghdl command line option; --ieee=<VER> +@anchor{using/InvokingGHDL cmdoption-ghdl-ieee}@anchor{55} +@deffn {Option} @w{-}@w{-}ieee=<VER> @geindex ieee library @@ -1643,19 +1652,19 @@ Select the @code{IEEE} library to use. @code{VER} must be one of: @item none -Do not supply an @cite{IEEE} library. Any library clause with the @code{IEEE} -identifier will fail, unless you have created by your own a library with +Do not supply an @cite{IEEE} library. Any library clause with the @code{IEEE} +identifier will fail, unless you have created your own library with the @cite{IEEE} name. @item standard Supply an @cite{IEEE} library containing only packages defined by -@code{ieee} standards. Currently, there are the multivalue logic system -packages @code{std_logic_1164} defined by IEEE 1164, the synthesis -packages , @code{numeric_bit} and @code{numeric_std} defined by IEEE +@code{ieee} standards. Currently, there are the multivalue logic system +package @code{std_logic_1164} defined by IEEE 1164, the synthesis +packages @code{numeric_bit} and @code{numeric_std} defined by IEEE 1076.3, and the @code{vital} packages @code{vital_timing} and -@code{vital_primitives}, defined by IEEE 1076.4. The version of these -packages is defined by the VHDL standard used. See section ‘@ref{53,,VITAL packages}’, +@code{vital_primitives}, defined by IEEE 1076.4. The version of these +packages is defined by the VHDL standard used. See section @ref{56,,VITAL packages}, for more details. @item synopsys @@ -1664,15 +1673,15 @@ Supply the former packages and the following additional packages: @code{std_logic_arith}, @code{std_logic_signed}, @code{std_logic_unsigned}, @code{std_logic_textio}. -These packages were created by some companies, and are popular. However +These packages were created by some companies, and are popular. However they are not standard packages, and have been placed in the @cite{IEEE} library without the permission from the @code{ieee}. @item mentor Supply the standard packages and the following additional package: -@code{std_logic_arith}. The package is a slight variation of a definitely -not standard but widely mis-used package. +@code{std_logic_arith}. This package is a slight variation of a definitely +not standard but widely misused package. @end table To avoid errors, you must use the same @cite{IEEE} library for all units of @@ -1680,97 +1689,97 @@ your design, and during elaboration. @end deffn @geindex ghdl command line option; -P<DIRECTORY> -@anchor{using/InvokingGHDL cmdoption-ghdl-p-directory}@anchor{54} +@anchor{using/InvokingGHDL cmdoption-ghdl-p-directory}@anchor{57} @deffn {Option} @w{-}P<DIRECTORY> Add @cite{DIRECTORY} to the end of the list of directories to be searched for -library files. A library is searched in @cite{DIRECTORY} and also in +library files. A library is searched in @cite{DIRECTORY} and also in @cite{DIRECTORY/LIB/vVV} (where @cite{LIB} is the name of the library and @cite{VV} the vhdl standard). The @cite{WORK} library is always searched in the path specified by the -@code{--workdir} option, or in the current directory if the latter +@ref{52,,--workdir} option, or in the current directory if the latter option is not specified. @end deffn @geindex ghdl command line option; -fexplicit -@anchor{using/InvokingGHDL cmdoption-ghdl-fexplicit}@anchor{55} +@anchor{using/InvokingGHDL cmdoption-ghdl-fexplicit}@anchor{58} @deffn {Option} @w{-}fexplicit When two operators are overloaded, give preference to the explicit declaration. This may be used to avoid the most common pitfall of the @code{std_logic_arith} -package. See section ‘@ref{14,,IEEE library pitfalls}’, for an example. +package. See section @ref{14,,IEEE library pitfalls}, for an example. @end deffn @cartouche @quotation Warning -This option is not set by default. I don’t think this option is a good feature, because it breaks the encapsulation rule. When set, an operator can be silently overridden in another package. You’d better fix your design and use the @code{numeric_std} package. +This option is not set by default. I don’t think this option is a good feature, because it breaks the encapsulation rule. When set, an operator can be silently overridden in another package. You’d do better to fix your design and use the @code{numeric_std} package. @end quotation @end cartouche @geindex ghdl command line option; -frelaxed-rules -@anchor{using/InvokingGHDL cmdoption-ghdl-frelaxed-rules}@anchor{56} +@anchor{using/InvokingGHDL cmdoption-ghdl-frelaxed-rules}@anchor{59} @deffn {Option} @w{-}frelaxed@w{-}rules -Within an object declaration, allow to reference the name (which references the hidden declaration). This ignores the error in the following code: +Within an object declaration, allow references to the name (which references the hidden declaration). This ignores the error in the following code: @example package pkg1 is - type state is (state1, state2, state3); + type state is (state1, state2, state3); end pkg1; use work.pkg1.all; package pkg2 is - constant state1 : state := state1; + constant state1 : state := state1; end pkg2; @end example Some code (such as Xilinx packages) have such constructs, which are valid. -(The scope of the @code{state1} constant start at the @cite{constant} word. Because the constant @code{state1} and the enumeration literal @code{state1} are homograph, the enumeration literal is hidden in the immediate scope of the constant). +(The scope of the @code{state1} constant starts at the @cite{constant} keyword. Because the constant @code{state1} and the enumeration literal @code{state1} are homographs, the enumeration literal is hidden in the immediate scope of the constant). This option also relaxes the rules about pure functions. Violations result in warnings instead of errors. @end deffn @geindex ghdl command line option; -fpsl -@anchor{using/InvokingGHDL cmdoption-ghdl-fpsl}@anchor{57} +@anchor{using/InvokingGHDL cmdoption-ghdl-fpsl}@anchor{5a} @deffn {Option} @w{-}fpsl -Enable parsing of PSL assertions within comments. See section ‘@ref{58,,PSL implementation}’ for more details. +Enable parsing of PSL assertions within comments. See section @ref{5b,,PSL implementation} for more details. @end deffn @geindex ghdl command line option; --no-vital-checks -@anchor{using/InvokingGHDL cmdoption-ghdl-no-vital-checks}@anchor{59} +@anchor{using/InvokingGHDL cmdoption-ghdl-no-vital-checks}@anchor{5c} @deffn {Option} @w{-}@w{-}no@w{-}vital@w{-}checks @end deffn @geindex ghdl command line option; --vital-checks -@anchor{using/InvokingGHDL cmdoption-ghdl-vital-checks}@anchor{5a} +@anchor{using/InvokingGHDL cmdoption-ghdl-vital-checks}@anchor{5d} @deffn {Option} @w{-}@w{-}vital@w{-}checks Disable or enable checks of restriction on VITAL units. Checks are enabled by default. Checks are performed only when a design unit is decorated by a VITAL attribute. The VITAL attributes are @code{VITAL_Level0} and @code{VITAL_Level1}, both declared in the @code{ieee.VITAL_Timing} package. -Currently, VITAL checks are only partially implemented. See section ‘@ref{5b,,VHDL restrictions for VITAL}’ for more details. +Currently, VITAL checks are only partially implemented. See section @ref{5e,,VHDL restrictions for VITAL} for more details. @end deffn @geindex ghdl command line option; --PREFIX<=PATH> -@anchor{using/InvokingGHDL cmdoption-ghdl-prefix}@anchor{5c} +@anchor{using/InvokingGHDL cmdoption-ghdl-prefix}@anchor{5f} @deffn {Option} @w{-}@w{-}PREFIX<=PATH> Use @code{PATH} as the prefix path to find commands and pre-installed (@code{std} and @code{ieee}) libraries. @end deffn @geindex ghdl command line option; -v -@anchor{using/InvokingGHDL cmdoption-ghdl-v}@anchor{5d} +@anchor{using/InvokingGHDL cmdoption-ghdl-v}@anchor{60} @deffn {Option} @w{-}v Be verbose. For example, for analysis, elaboration and make commands, GHDL displays the commands executed. @end deffn @node Warnings,Diagnostics Control,Options,Invoking GHDL -@anchor{using/InvokingGHDL warnings}@anchor{5e} +@anchor{using/InvokingGHDL warnings}@anchor{61} @section Warnings @@ -1778,146 +1787,206 @@ Some constructions are not erroneous but dubious. Warnings are diagnostic messag @cartouche @quotation Hint -You could disable a warning by using the @code{--warn-no-XXX} or @code{-Wno-XX} instead of @code{--warn-XXX} or @code{-WXXX}. +You could disable a warning by using the @code{--warn-no-XXX} or @code{-Wno-XXX} instead of @code{--warn-XXX} or @code{-WXXX}. @end quotation @end cartouche -@geindex ghdl command line option; --warn-reserved -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-reserved}@anchor{5f} -@deffn {Option} @w{-}@w{-}warn@w{-}reserved +@cartouche +@quotation Hint +The warnings @code{-Wbinding}, @code{-Wlibrary}, @code{-Wshared}, +@code{-Wpure}, @code{-Wspecs}, @code{-Whide}, @code{-Wport} are enabled by +default. +@end quotation +@end cartouche -Emit a warning if an identifier is a reserved word in a later VHDL standard. +@geindex ghdl command line option; --warn-library +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-library}@anchor{62} +@deffn {Option} @w{-}@w{-}warn@w{-}library + +Warns if a design unit replaces another design unit with the same name. @end deffn @geindex ghdl command line option; --warn-default-binding -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-default-binding}@anchor{60} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-default-binding}@anchor{63} @deffn {Option} @w{-}@w{-}warn@w{-}default@w{-}binding -During analyze, warns if a component instantiation has neither configuration specification nor default binding. This may be useful if you want to detect during analyze possibly unbound component if you don’t use configuration. See section ‘@ref{51,,VHDL standards}’ for more details about default binding rules. +During analyze, warns if a component instantiation has neither configuration specification nor default binding. This may be useful if you want to detect during analyze possibly unbound components if you don’t use configuration. See section @ref{54,,VHDL standards} for more details about default binding rules. @end deffn @geindex ghdl command line option; --warn-binding -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-binding}@anchor{61} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-binding}@anchor{64} @deffn {Option} @w{-}@w{-}warn@w{-}binding -During elaboration, warns if a component instantiation is not bound (and not explicitly left unbound). Also warns if a port of an entity is not bound in a configuration specification or in a component configuration. This warning is enabled by default, since default binding rules are somewhat complex and an unbound component is most often unexpected. +During elaboration, warns if a component instantiation is not bound (and not explicitly left unbound). Also warns if a port of an entity is not bound in a configuration specification or in a component configuration. This warning is enabled by default, since default binding rules are somewhat complex and an unbound component is most often unexpected. -However, warnings are even emitted if a component instantiation is inside a generate statement. As a consequence, if you use the conditional generate statement to select a component according to the implementation, you will certainly get warnings. +However, warnings are still emitted if a component instantiation is inside a generate statement. As a consequence, if you use the conditional generate statement to select a component according to the implementation, you will certainly get warnings. @end deffn -@geindex ghdl command line option; --warn-library -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-library}@anchor{62} -@deffn {Option} @w{-}@w{-}warn@w{-}library +@geindex ghdl command line option; --warn-reserved +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-reserved}@anchor{65} +@deffn {Option} @w{-}@w{-}warn@w{-}reserved -Warns if a design unit replaces another design unit with the same name. +Emit a warning if an identifier is a reserved word in a later VHDL standard. +@end deffn + +@geindex ghdl command line option; --warn-nested-comment +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-nested-comment}@anchor{66} +@deffn {Option} @w{-}@w{-}warn@w{-}nested@w{-}comment + +Emit a warning if a @code{/*} appears within a block comment (vhdl 2008). +@end deffn + +@geindex ghdl command line option; --warn-parenthesis +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-parenthesis}@anchor{67} +@deffn {Option} @w{-}@w{-}warn@w{-}parenthesis + +Emit a warning in case of weird use of parentheses. @end deffn @geindex ghdl command line option; --warn-vital-generic -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-vital-generic}@anchor{63} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-vital-generic}@anchor{68} @deffn {Option} @w{-}@w{-}warn@w{-}vital@w{-}generic -Warns if a generic name of a vital entity is not a vital generic name. This +Warns if a generic name of a vital entity is not a vital generic name. This is set by default. @end deffn @geindex ghdl command line option; --warn-delayed-checks -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-delayed-checks}@anchor{64} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-delayed-checks}@anchor{69} @deffn {Option} @w{-}@w{-}warn@w{-}delayed@w{-}checks -Warns for checks that cannot be done during analysis time and are postponed to elaboration time. This is because not all procedure bodies are available during analysis (either because a package body has not yet been analysed or because @cite{GHDL} doesn’t read not required package bodies). +Warns for checks that cannot be done during analysis time and are postponed to elaboration time. This is because not all procedure bodies are available during analysis (either because a package body has not yet been analysed or because @cite{GHDL} doesn’t read not required package bodies). -These are checks for no wait statement in a procedure called in a sensitized process and checks for pure rules of a function. +These are checks for no wait statements in a procedure called in a sensitized process and checks for pure rules of a function. @end deffn @geindex ghdl command line option; --warn-body -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-body}@anchor{65} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-body}@anchor{6a} @deffn {Option} @w{-}@w{-}warn@w{-}body -Emit a warning if a package body which is not required is analyzed. If a package does not declare a subprogram or a deferred constant, the package does not require a body. +Emit a warning if a package body which is not required is analyzed. If a package does not declare a subprogram or a deferred constant, the package does not require a body. @end deffn @geindex ghdl command line option; --warn-specs -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-specs}@anchor{66} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-specs}@anchor{6b} @deffn {Option} @w{-}@w{-}warn@w{-}specs Emit a warning if an all or others specification does not apply. @end deffn +@geindex ghdl command line option; --warn-runtime-error +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-runtime-error}@anchor{6c} +@deffn {Option} @w{-}@w{-}warn@w{-}runtime@w{-}error + +Emit a warning in case of runtime error that is detected during +analysis. +@end deffn + +@geindex ghdl command line option; --warn-shared +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-shared}@anchor{6d} +@deffn {Option} @w{-}@w{-}warn@w{-}shared + +Emit a warning when a shared variable is declared and its type it +not a protected type. +@end deffn + +@geindex ghdl command line option; --warn-hide +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-hide}@anchor{6e} +@deffn {Option} @w{-}@w{-}warn@w{-}hide + +Emit a warning when a declaration hides a previous hide. +@end deffn + @geindex ghdl command line option; --warn-unused -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-unused}@anchor{67} +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-unused}@anchor{6f} @deffn {Option} @w{-}@w{-}warn@w{-}unused Emit a warning when a subprogram is never used. @end deffn -@geindex ghdl command line option; --warn-error -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-error}@anchor{68} -@deffn {Option} @w{-}@w{-}warn@w{-}error +@geindex ghdl command line option; --warn-others +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-others}@anchor{70} +@deffn {Option} @w{-}@w{-}warn@w{-}others -When this option is set, warnings are considered as errors. +Emit a warning is an @cite{others} choice is not required because all the +choices have been explicitly covered. @end deffn -@geindex ghdl command line option; --warn-nested-comment -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-nested-comment}@anchor{69} -@deffn {Option} @w{-}@w{-}warn@w{-}nested@w{-}comment +@geindex ghdl command line option; --warn-pure +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-pure}@anchor{71} +@deffn {Option} @w{-}@w{-}warn@w{-}pure -Emit a warning if a @code{/*} appears within a block comment (vhdl 2008). +Emit a warning when a pure rules is violated (like declaring a pure +function with access parameters). @end deffn -@geindex ghdl command line option; --warn-parenthesis -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-parenthesis}@anchor{6a} -@deffn {Option} @w{-}@w{-}warn@w{-}parenthesis +@geindex ghdl command line option; --warn-static +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-static}@anchor{72} +@deffn {Option} @w{-}@w{-}warn@w{-}static -Emit a warning in case of weird use of parenthesis +Emit a warning when a non-static expression is used at a place where +the standard requires a static expression. @end deffn -@geindex ghdl command line option; --warn-runtime-error -@anchor{using/InvokingGHDL cmdoption-ghdl-warn-runtime-error}@anchor{6b} -@deffn {Option} @w{-}@w{-}warn@w{-}runtime@w{-}error +@geindex ghdl command line option; --warn-error +@anchor{using/InvokingGHDL cmdoption-ghdl-warn-error}@anchor{73} +@deffn {Option} @w{-}@w{-}warn@w{-}error -Emit a warning in case of runtime error that is detected during -analysis. +When this option is set, warnings are considered as errors. @end deffn @node Diagnostics Control,Library commands,Warnings,Invoking GHDL -@anchor{using/InvokingGHDL diagnostics-control}@anchor{6c} +@anchor{using/InvokingGHDL diagnostics-control}@anchor{74} @section Diagnostics Control @geindex ghdl command line option; -fcolor-diagnostics -@anchor{using/InvokingGHDL cmdoption-ghdl-fcolor-diagnostics}@anchor{6d} +@anchor{using/InvokingGHDL cmdoption-ghdl-fcolor-diagnostics}@anchor{75} @deffn {Option} @w{-}fcolor@w{-}diagnostics @end deffn @geindex ghdl command line option; -fno-color-diagnostics -@anchor{using/InvokingGHDL cmdoption-ghdl-fno-color-diagnostics}@anchor{6e} +@anchor{using/InvokingGHDL cmdoption-ghdl-fno-color-diagnostics}@anchor{76} @deffn {Option} @w{-}fno@w{-}color@w{-}diagnostics Control whether diagnostic messages are displayed in color. The default is on when the standard output is a terminal. @end deffn @geindex ghdl command line option; -fdiagnostics-show-option -@anchor{using/InvokingGHDL cmdoption-ghdl-fdiagnostics-show-option}@anchor{6f} +@anchor{using/InvokingGHDL cmdoption-ghdl-fdiagnostics-show-option}@anchor{77} @deffn {Option} @w{-}fdiagnostics@w{-}show@w{-}option @end deffn @geindex ghdl command line option; -fno-diagnostics-show-option -@anchor{using/InvokingGHDL cmdoption-ghdl-fno-diagnostics-show-option}@anchor{70} +@anchor{using/InvokingGHDL cmdoption-ghdl-fno-diagnostics-show-option}@anchor{78} @deffn {Option} @w{-}fno@w{-}diagnostics@w{-}show@w{-}option -Control whether the warning option is displayed at the end of warning messages, so that user can easily know how to disable it. +Control whether the warning option is displayed at the end of warning messages, so that the user can easily know how to disable it. +@end deffn + +@geindex ghdl command line option; -fcaret-diagnostics +@anchor{using/InvokingGHDL cmdoption-ghdl-fcaret-diagnostics}@anchor{79} +@deffn {Option} @w{-}fcaret@w{-}diagnostics +@end deffn + +@geindex ghdl command line option; -fno-caret-diagnostics +@anchor{using/InvokingGHDL cmdoption-ghdl-fno-caret-diagnostics}@anchor{7a} +@deffn {Option} @w{-}fno@w{-}caret@w{-}diagnostics + +Control whether the source line of the error is displayed with a +caret indicating the column of the error. @end deffn @node Library commands,VPI build commands,Diagnostics Control,Invoking GHDL -@anchor{using/InvokingGHDL library-commands}@anchor{71} +@anchor{using/InvokingGHDL library-commands}@anchor{7b} @section Library commands -@anchor{using/InvokingGHDL create-a-library}@anchor{72} +@anchor{using/InvokingGHDL create-a-library}@anchor{7c} @geindex create your own library A new library is created implicitly, by compiling entities (packages etc.) into it: @code{ghdl -a --work=my_custom_lib my_file.vhd}. -A library’s source code is usually stored and compiled into its own directory, that you specify with the @code{--workdir} option: @code{ghdl -a --work=my_custom_lib --workdir=my_custom_libdir my_custom_lib_srcdir/my_file.vhd}. See also the @code{-P} command line option. +A library’s source code is usually stored and compiled into its own directory, that you specify with the @ref{52,,--workdir} option: @code{ghdl -a --work=my_custom_lib --workdir=my_custom_libdir my_custom_lib_srcdir/my_file.vhd}. See also the @code{-P} command line option. Furthermore, GHDL provides a few commands which act on a library: @@ -1932,26 +2001,26 @@ Furthermore, GHDL provides a few commands which act on a library: @end menu @node Directory [--dir],Clean [--clean],,Library commands -@anchor{using/InvokingGHDL directory-dir}@anchor{73} +@anchor{using/InvokingGHDL directory-dir}@anchor{7d} @subsection Directory [@code{--dir}] @geindex ghdl command line option; --dir <[options] [libs]> -@anchor{using/InvokingGHDL cmdoption-ghdl-dir}@anchor{74} +@anchor{using/InvokingGHDL cmdoption-ghdl-dir}@anchor{7e} @deffn {Option} @w{-}@w{-}dir <[options] [libs]> @end deffn -Displays the content of the design libraries (by default the @code{work} library). All options are allowed, but only a few are meaningful: @code{--work}, @code{--workdir} and --std@footnote{http://poc-library.readthedocs.io/en/release/References/CmdRefs/PoC.html#cmdoption-poc-py-xsim-std}. +Displays the content of the design libraries (by default the @code{work} library). All options are allowed, but only a few are meaningful: @ref{51,,--work}, @ref{52,,--workdir} and @ref{53,,--std}. @geindex cmd library clean @node Clean [--clean],Remove [--remove],Directory [--dir],Library commands -@anchor{using/InvokingGHDL clean-clean}@anchor{75} +@anchor{using/InvokingGHDL clean-clean}@anchor{7f} @subsection Clean [@code{--clean}] @geindex ghdl command line option; --clean <[options]> -@anchor{using/InvokingGHDL cmdoption-ghdl-clean}@anchor{76} +@anchor{using/InvokingGHDL cmdoption-ghdl-clean}@anchor{80} @deffn {Option} @w{-}@w{-}clean <[options]> @end deffn @@ -1960,31 +2029,31 @@ Try to remove any object, executable or temporary file it could have created. So @geindex cmd library remove @node Remove [--remove],Copy [--copy],Clean [--clean],Library commands -@anchor{using/InvokingGHDL remove-remove}@anchor{77} +@anchor{using/InvokingGHDL remove-remove}@anchor{81} @subsection Remove [@code{--remove}] @geindex ghdl command line option; --remove <[options]> -@anchor{using/InvokingGHDL cmdoption-ghdl-remove}@anchor{78} +@anchor{using/InvokingGHDL cmdoption-ghdl-remove}@anchor{82} @deffn {Option} @w{-}@w{-}remove <[options]> @end deffn -Do like the clean command but remove the library too. Note that after removing a design library, the files are not +Acts like the clean command but removes the library too. Note that after removing a design library, the files are not known anymore by GHDL. @geindex cmd library copy @node Copy [--copy],,Remove [--remove],Library commands -@anchor{using/InvokingGHDL copy-copy}@anchor{79} +@anchor{using/InvokingGHDL copy-copy}@anchor{83} @subsection Copy [@code{--copy}] @geindex ghdl command line option; --copy <--work=name [options]> -@anchor{using/InvokingGHDL cmdoption-ghdl-copy}@anchor{7a} +@anchor{using/InvokingGHDL cmdoption-ghdl-copy}@anchor{84} @deffn {Option} @w{-}@w{-}copy <@w{-}@w{-}work=name [options]> @end deffn -Make a local copy of an existing library. This is very useful if you want to add unit to the @code{ieee} library: +Make a local copy of an existing library. This is very useful if you want to add units to the @code{ieee} library: @example ghdl --copy --work=ieee --ieee=synopsys @@ -1992,11 +2061,11 @@ ghdl -a --work=ieee numeric_unsigned.vhd @end example @node VPI build commands,IEEE library pitfalls,Library commands,Invoking GHDL -@anchor{using/InvokingGHDL vpi-build-commands}@anchor{7b} +@anchor{using/InvokingGHDL vpi-build-commands}@anchor{85} @section VPI build commands -These commands simplify the compile and the link of a user vpi module. They are all wrapper: the arguments are in fact a whole command line that is executed with additional switches. Currently a unix-like compiler (like @cite{cc}, @cite{gcc} or @cite{clang}) is expected: the additional switches use their syntax. The only option is @cite{-v} which displays the +These commands simplify the compile and the link of a user vpi module. They are all wrappers: the arguments are in fact a whole command line that is executed with additional switches. Currently a unix-like compiler (like @cite{cc}, @cite{gcc} or @cite{clang}) is expected: the additional switches use their syntax. The only option is @cite{-v} which displays the command before its execution. @geindex cmd VPI compile @@ -2012,16 +2081,16 @@ command before its execution. @end menu @node compile [--vpi-compile],link [--vpi-link],,VPI build commands -@anchor{using/InvokingGHDL compile-vpi-compile}@anchor{7c} +@anchor{using/InvokingGHDL compile-vpi-compile}@anchor{86} @subsection compile [@code{--vpi-compile}] @geindex ghdl command line option; --vpi-compile <command> -@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-compile}@anchor{7d} +@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-compile}@anchor{87} @deffn {Option} @w{-}@w{-}vpi@w{-}compile <command> @end deffn -Add include path to the command and execute it: +Add an include path to the command and execute it: @example ghdl --vpi-compile command @@ -2044,20 +2113,20 @@ executes: @example gcc -c vpi1.c -fPIC -Ixxx/include @end example -@anchor{using/InvokingGHDL vpi-link-command}@anchor{7e} +@anchor{using/InvokingGHDL vpi-link-command}@anchor{88} @geindex cmd VPI link @node link [--vpi-link],cflags [--vpi-cflags],compile [--vpi-compile],VPI build commands -@anchor{using/InvokingGHDL link-vpi-link}@anchor{7f} +@anchor{using/InvokingGHDL link-vpi-link}@anchor{89} @subsection link [@code{--vpi-link}] @geindex ghdl command line option; --vpi-link <command> -@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-link}@anchor{80} +@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-link}@anchor{8a} @deffn {Option} @w{-}@w{-}vpi@w{-}link <command> @end deffn -Add library path and name to the command and execute it: +Add a library path and name to the command and execute it: @example ghdl --vpi-link command @@ -2080,44 +2149,44 @@ executes: @example gcc -o vpi1.vpi vpi1.o --shared -Lxxx/lib -lghdlvpi @end example -@anchor{using/InvokingGHDL vpi-cflags-command}@anchor{81} +@anchor{using/InvokingGHDL vpi-cflags-command}@anchor{8b} @geindex cmd VPI cflags @node cflags [--vpi-cflags],ldflags [--vpi-ldflags],link [--vpi-link],VPI build commands -@anchor{using/InvokingGHDL cflags-vpi-cflags}@anchor{82} +@anchor{using/InvokingGHDL cflags-vpi-cflags}@anchor{8c} @subsection cflags [@code{--vpi-cflags}] @geindex ghdl command line option; --vpi-cflags -@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-cflags}@anchor{83} +@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-cflags}@anchor{8d} @deffn {Option} @w{-}@w{-}vpi@w{-}cflags @end deffn -Display flags added by @ref{7d,,--vpi-compile}. +Display flags added by @ref{87,,--vpi-compile}. @geindex cmd VPI ldflags @node ldflags [--vpi-ldflags],include dir [--vpi-include-dir],cflags [--vpi-cflags],VPI build commands -@anchor{using/InvokingGHDL ldflags-vpi-ldflags}@anchor{84} +@anchor{using/InvokingGHDL ldflags-vpi-ldflags}@anchor{8e} @subsection ldflags [@code{--vpi-ldflags}] @geindex ghdl command line option; --vpi-ldflags -@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-ldflags}@anchor{85} +@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-ldflags}@anchor{8f} @deffn {Option} @w{-}@w{-}vpi@w{-}ldflags @end deffn -Display flags added by @ref{80,,--vpi-link}. +Display flags added by @ref{8a,,--vpi-link}. @geindex cmd VPI include dir @node include dir [--vpi-include-dir],library dir [--vpi-library-dir],ldflags [--vpi-ldflags],VPI build commands -@anchor{using/InvokingGHDL include-dir-vpi-include-dir}@anchor{86} +@anchor{using/InvokingGHDL include-dir-vpi-include-dir}@anchor{90} @subsection include dir [@code{--vpi-include-dir}] @geindex ghdl command line option; --vpi-include-dir -@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-include-dir}@anchor{87} +@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-include-dir}@anchor{91} @deffn {Option} @w{-}@w{-}vpi@w{-}include@w{-}dir @end deffn @@ -2126,23 +2195,23 @@ Display the include directory added by the compile flags. @geindex cmd VPI library dir @node library dir [--vpi-library-dir],,include dir [--vpi-include-dir],VPI build commands -@anchor{using/InvokingGHDL library-dir-vpi-library-dir}@anchor{88} +@anchor{using/InvokingGHDL library-dir-vpi-library-dir}@anchor{92} @subsection library dir [@code{--vpi-library-dir}] @geindex ghdl command line option; --vpi-library-dir -@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-library-dir}@anchor{89} +@anchor{using/InvokingGHDL cmdoption-ghdl-vpi-library-dir}@anchor{93} @deffn {Option} @w{-}@w{-}vpi@w{-}library@w{-}dir @end deffn Display the library directory added by the link flags. @node IEEE library pitfalls,,VPI build commands,Invoking GHDL -@anchor{using/InvokingGHDL ieee-library-pitfalls}@anchor{14}@anchor{using/InvokingGHDL id1}@anchor{8a} +@anchor{using/InvokingGHDL ieee-library-pitfalls}@anchor{14}@anchor{using/InvokingGHDL id1}@anchor{94} @section IEEE library pitfalls -When you use options @code{--ieee=synopsys} or @code{--ieee=mentor}, the @code{ieee} library contains non standard packages such as @code{std_logic_arith}. These packages are not standard because there are not described by an IEEE standard, even if they have been put in the @cite{IEEE} library. Furthermore, they are not really de-facto standard, because there are slight differences between the packages of Mentor and those of Synopsys. Furthermore, since they are not well-thought, their use has pitfalls. For example, this description has error during compilation: +When you use options @code{--ieee=synopsys} or @code{--ieee=mentor}, the @code{ieee} library contains non standard packages such as @code{std_logic_arith}. These packages are not standard because there are not described by an IEEE standard, even if they have been put in the @cite{IEEE} library. Furthermore, they are not really de-facto standard, because there are slight differences between the packages of Mentor and those of Synopsys. Furthermore, since they are not well thought out, their use has pitfalls. For example, this description has an error during compilation: @example library ieee; @@ -2150,9 +2219,9 @@ use ieee.std_logic_1164.all; -- A counter from 0 to 10. entity counter is - port (val : out std_logic_vector (3 downto 0); - ck : std_logic; - rst : std_logic); + port (val : out std_logic_vector (3 downto 0); + ck : std_logic; + rst : std_logic); end counter; library ieee; @@ -2160,27 +2229,26 @@ use ieee.std_logic_unsigned.all; architecture bad of counter is - signal v : std_logic_vector (3 downto 0); + signal v : std_logic_vector (3 downto 0); begin - process (ck, rst) - begin - if rst = '1' then + process (ck, rst) + begin + if rst = '1' then + v <= x"0"; + elsif rising_edge (ck) then + if v = "1010" then -- Error v <= x"0"; - elsif rising_edge (ck) then - if v = "1010" then -- Error - v <= x"0"; - else - v <= v + 1; - end if; - end if; - end process; - - val <= v; + else + v <= v + 1; + end if; + end if; + end process; + + val <= v; end bad; @end example -When you analyze this design, GHDL does not accept it (too long lines -have been split for readability): +When you analyze this design, GHDL does not accept it (two long lines have been split for readability): @example ghdl -a --ieee=synopsys bad_counter.vhdl @@ -2193,12 +2261,12 @@ bad_counter.vhdl:13:14: possible interpretations are: ../translate/ghdldrv/ghdl: compilation error @end example -Indeed, the @cite{“=”} operator is defined in both packages, and both are visible at the place it is used. The first declaration is an implicit one, which occurs when the @cite{std_logic_vector} type is declared and is an element to element comparison, the second one is an explicit declared function, with the semantic of an unsigned comparison. +Indeed, the @cite{“=”} operator is defined in both packages, and both are visible at the place it is used. The first declaration is an implicit one, which occurs when the @cite{std_logic_vector} type is declared and is an element to element comparison. The second one is an explicit declared function, with the semantics of an unsigned comparison. -With some analyser, the explicit declaration has priority over the implicit declaration, and this design can be analyzed without error. However, this is not the rule given by the VHDL LRM, and since GHDL follows these rules, +With some analysers, the explicit declaration has priority over the implicit declaration, and this design can be analyzed without error. However, this is not the rule given by the VHDL LRM, and since GHDL follows these rules, it emits an error. -You can force GHDL to use this rule with the @emph{-fexplicit} option (see GHDL_options for further details). However it is easy to fix this error, by using a selected name: +You can force GHDL to use this rule with the @emph{-fexplicit} option (see @ref{39,,Options} for further details). However it is easy to fix this error, by using a selected name: @example library ieee; @@ -2206,26 +2274,26 @@ use ieee.std_logic_unsigned.all; architecture fixed_bad of counter is - signal v : std_logic_vector (3 downto 0); + signal v : std_logic_vector (3 downto 0); begin - process (ck, rst) - begin - if rst = '1' then + process (ck, rst) + begin + if rst = '1' then + v <= x"0"; + elsif rising_edge (ck) then + if ieee.std_logic_unsigned."=" (v, "1010") then v <= x"0"; - elsif rising_edge (ck) then - if ieee.std_logic_unsigned."=" (v, "1010") then - v <= x"0"; - else - v <= v + 1; - end if; - end if; - end process; - - val <= v; + else + v <= v + 1; + end if; + end if; + end process; + + val <= v; end fixed_bad; @end example -It is better to only use the standard packages defined by IEEE, which provides the same functionalities: +It is better to only use the standard packages defined by IEEE, which provide the same functionalities: @example library ieee; @@ -2233,22 +2301,22 @@ use ieee.numeric_std.all; architecture good of counter is - signal v : unsigned (3 downto 0); + signal v : unsigned (3 downto 0); begin - process (ck, rst) - begin - if rst = '1' then + process (ck, rst) + begin + if rst = '1' then + v <= x"0"; + elsif rising_edge (ck) then + if v = "1010" then v <= x"0"; - elsif rising_edge (ck) then - if v = "1010" then - v <= x"0"; - else - v <= v + 1; - end if; - end if; - end process; - - val <= std_logic_vector (v); + else + v <= v + 1; + end if; + end if; + end process; + + val <= std_logic_vector (v); end good; @end example @@ -2274,7 +2342,7 @@ The @code{ieee} math packages (@code{math_real} and @code{math_complex}) provide @c # define a hard kine break for HTML @node Simulation and runtime,Releases and sources,Invoking GHDL,Top -@anchor{using/Simulation using-simulation}@anchor{3b}@anchor{using/Simulation simulation-and-runtime}@anchor{8b}@anchor{using/Simulation doc}@anchor{8c} +@anchor{using/Simulation using-simulation}@anchor{3e}@anchor{using/Simulation simulation-and-runtime}@anchor{95}@anchor{using/Simulation doc}@anchor{96} @chapter Simulation and runtime @@ -2287,17 +2355,17 @@ The @code{ieee} math packages (@code{math_real} and @code{math_complex}) provide @end menu @node Simulation options,Export waveforms,,Simulation and runtime -@anchor{using/Simulation simulation-options}@anchor{2f}@anchor{using/Simulation id1}@anchor{8d} +@anchor{using/Simulation simulation-options}@anchor{2f}@anchor{using/Simulation id1}@anchor{97} @section Simulation options In most system environments, it is possible to pass options while -invoking a program. Contrary to most programming languages, there is no +invoking a program. Contrary to most programming languages, there is no standard method in VHDL to obtain the arguments or to set the exit status. -In GHDL, it is impossible to pass parameters to your design. A later version -could do it through the generics interfaces of the top entity. +In GHDL, it is impossible to pass parameters to your design. A later version +could do it through the generic interfaces of the top entity. However, the GHDL runtime behaviour can be modified with some options; for example, it is possible to stop simulation after a certain time. @@ -2306,16 +2374,16 @@ The exit status of the simulation is @code{EXIT_SUCCESS} (0) if the simulation completes, or @code{EXIT_FAILURE} (1) in case of error (assertion failure, overflow or any constraint error). -Here is the list of the most useful options. Some debugging options are -also available, but not described here. The @ref{8e,,--help} options lists +Here is the list of the most useful options. Some debugging options are +also available, but not described here. The @ref{98,,--help} option lists all options available, including the debugging one. @geindex ghdl command line option; --assert-level<=LEVEL> -@anchor{using/Simulation cmdoption-ghdl-assert-level}@anchor{8f} +@anchor{using/Simulation cmdoption-ghdl-assert-level}@anchor{99} @deffn {Option} @w{-}@w{-}assert@w{-}level<=LEVEL> Select the assertion level at which an assertion violation stops the -simulation. @cite{LEVEL} is the name from the @cite{severity_level} +simulation. @cite{LEVEL} is the name from the @cite{severity_level} enumerated type defined in the @cite{standard} package or the @code{none} name. @@ -2327,29 +2395,29 @@ with severity level @code{warning}, @code{error} or @code{failure} would stop simulation, but the assertion violation at the @code{note} severity level would only display a message. -Option @code{--assert-level=none} prevents any assertion violation to stop +Option @code{--assert-level=none} prevents any assertion violation from stopping simulation. @end deffn @geindex ghdl command line option; --ieee-asserts<=POLICY> -@anchor{using/Simulation cmdoption-ghdl-ieee-asserts}@anchor{90} +@anchor{using/Simulation cmdoption-ghdl-ieee-asserts}@anchor{9a} @deffn {Option} @w{-}@w{-}ieee@w{-}asserts<=POLICY> Select how the assertions from @code{ieee} units are handled. @cite{POLICY} can be @code{enable} (the default), -@code{disable} which disables all assertion from @code{ieee} packages -and @code{disable-at-0} which disables only at start of simulation. +@code{disable} which disables all assertions from @code{ieee} packages +and @code{disable-at-0} which disables only at the start of simulation. -This option can be useful to avoid assertion message from +This option can be useful to avoid assertion messages from @code{ieee.numeric_std} (and other @code{ieee} packages). @end deffn @geindex ghdl command line option; --stop-time<=TIME> -@anchor{using/Simulation cmdoption-ghdl-stop-time}@anchor{91} +@anchor{using/Simulation cmdoption-ghdl-stop-time}@anchor{9b} @deffn {Option} @w{-}@w{-}stop@w{-}time<=TIME> -Stop the simulation after @code{TIME}. @code{TIME} is expressed as a time -value, @emph{without} any space. The time is the simulation time, not +Stop the simulation after @code{TIME}. @code{TIME} is expressed as a time +value, @emph{without} any space. The time is the simulation time, not the real clock time. For example: @@ -2361,37 +2429,46 @@ $ ./my_design --stop-time=ps @end deffn @geindex ghdl command line option; --stop-delta<=N> -@anchor{using/Simulation cmdoption-ghdl-stop-delta}@anchor{92} +@anchor{using/Simulation cmdoption-ghdl-stop-delta}@anchor{9c} @deffn {Option} @w{-}@w{-}stop@w{-}delta<=N> -Stop the simulation after @cite{N} delta cycles in the same current time. +Stop the simulation after @cite{N} delta cycles in the same current +time. The default is 5000. @geindex display time @end deffn @geindex ghdl command line option; --disp-time -@anchor{using/Simulation cmdoption-ghdl-disp-time}@anchor{93} +@anchor{using/Simulation cmdoption-ghdl-disp-time}@anchor{9d} @deffn {Option} @w{-}@w{-}disp@w{-}time Display the time and delta cycle number as simulation advances. @end deffn @geindex ghdl command line option; --unbuffered -@anchor{using/Simulation cmdoption-ghdl-unbuffered}@anchor{94} +@anchor{using/Simulation cmdoption-ghdl-unbuffered}@anchor{9e} @deffn {Option} @w{-}@w{-}unbuffered Disable buffering on stdout, stderr and files opened in write or append mode (TEXTIO). @end deffn +@geindex ghdl command line option; --max-stack-alloc<=N> +@anchor{using/Simulation cmdoption-ghdl-max-stack-alloc}@anchor{9f} +@deffn {Option} @w{-}@w{-}max@w{-}stack@w{-}alloc<=N> + +Emit an error message in case of allocation on the stack of an +object larger than @cite{N} KB. Use 0 to disable these checks. +@end deffn + @geindex ghdl command line option; --sdf<=PATH=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-sdf}@anchor{95} +@anchor{using/Simulation cmdoption-ghdl-sdf}@anchor{a0} @deffn {Option} @w{-}@w{-}sdf<=PATH=FILENAME> Do VITAL annotation on @cite{PATH} with SDF file @code{FILENAME}. @cite{PATH} is a path of instances, separated with @code{.} or @code{/}. -Any separator can be used. Instances are component instantiation labels, -generate labels or block labels. Currently, you cannot use an indexed name. +Any separator can be used. Instances are component instantiation labels, +generate labels or block labels. Currently, you cannot use an indexed name. Specifying a delay: @@ -2403,40 +2480,40 @@ Specifying a delay: If the option contains a type of delay, that is @code{min=}, @code{typ=} or @code{max=}, the annotator use respectively minimum, -typical or maximum values. If the option does not contain a type of delay, -the annotator use the typical delay. +typical or maximum values. If the option does not contain a type of delay, +the annotator uses the typical delay. -See section ‘@ref{96,,Backannotation}’, for more details. +See section @ref{a1,,Backannotation}, for more details. @end deffn @geindex ghdl command line option; --vpi<=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-vpi}@anchor{97} +@anchor{using/Simulation cmdoption-ghdl-vpi}@anchor{a2} @deffn {Option} @w{-}@w{-}vpi<=FILENAME> -@end deffn Load VPI module. +@end deffn @geindex ghdl command line option; --vpi-trace<=FILE> -@anchor{using/Simulation cmdoption-ghdl-vpi-trace}@anchor{98} +@anchor{using/Simulation cmdoption-ghdl-vpi-trace}@anchor{a3} @deffn {Option} @w{-}@w{-}vpi@w{-}trace<=FILE> -@end deffn Trace vpi calls to FILE. +@end deffn @geindex ghdl command line option; --help -@anchor{using/Simulation cmdoption-ghdl-help}@anchor{8e} +@anchor{using/Simulation cmdoption-ghdl-help}@anchor{98} @deffn {Option} @w{-}@w{-}help Display a short description of the options accepted by the runtime library. @end deffn @node Export waveforms,Export hierarchy and references,Simulation options,Simulation and runtime -@anchor{using/Simulation export-waveforms}@anchor{99}@anchor{using/Simulation export-waves}@anchor{2e} +@anchor{using/Simulation export-waveforms}@anchor{a4}@anchor{using/Simulation export-waves}@anchor{2e} @section Export waveforms @geindex ghdl command line option; --read-wave-opt=<FILENAME> -@anchor{using/Simulation cmdoption-ghdl-read-wave-opt}@anchor{9a} +@anchor{using/Simulation cmdoption-ghdl-read-wave-opt}@anchor{a5} @deffn {Option} @w{-}@w{-}read@w{-}wave@w{-}opt=<FILENAME> Filter signals to be dumped to the wave file according to the wave option @@ -2453,28 +2530,28 @@ my_pkg.global_signal_a # Path format for signals in entities : /top/sub/clk -# Dumps every signals named reset in first level sub entities of top +# Dump every signal named reset in first level sub entities of top /top/*/reset -# Dumps every signals named reset in recursive sub entities of top +# Dump every signal named reset in recursive sub entities of top /top/**/reset -# Dump every signals of sub2 which could be anywhere in design except on -# top level +# Dump every signal of sub2 which could be anywhere in the design except +# on the top level /**/sub2/* -# Dump every signals of sub3 which must be a first level sub entity of the +# Dump every signal of sub3 which must be a first level sub entity of the # top level /*/sub3/* -# Dump every signals of the first level sub entities of sub3 (but not +# Dump every signal of the first level sub entities of sub3 (but not # those of sub3) /**/sub3/*/* @end example @end deffn @geindex ghdl command line option; --write-wave-opt=<FILENAME> -@anchor{using/Simulation cmdoption-ghdl-write-wave-opt}@anchor{9b} +@anchor{using/Simulation cmdoption-ghdl-write-wave-opt}@anchor{a6} @deffn {Option} @w{-}@w{-}write@w{-}wave@w{-}opt=<FILENAME> If the wave option file doesn’t exist, creates it with all the signals of @@ -2483,12 +2560,12 @@ file. @end deffn @geindex ghdl command line option; --vcd<=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-vcd}@anchor{9c} +@anchor{using/Simulation cmdoption-ghdl-vcd}@anchor{a7} @deffn {Option} @w{-}@w{-}vcd<=FILENAME> @end deffn @geindex ghdl command line option; --vcdgz<=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-vcdgz}@anchor{9d} +@anchor{using/Simulation cmdoption-ghdl-vcdgz}@anchor{a8} @deffn {Option} @w{-}@w{-}vcdgz<=FILENAME> @geindex vcd @@ -2498,19 +2575,19 @@ file. @geindex dump of signals Option @code{--vcd} dumps into the VCD file @cite{FILENAME} the signal -values before each non-delta cycle. If @cite{FILENAME} is @code{-}, +values before each non-delta cycle. If @cite{FILENAME} is @code{-}, then the standard output is used, otherwise a file is created or overwritten. The @code{--vcdgz} option is the same as the @emph{–vcd} option, but the output is compressed using the @cite{zlib} (@cite{gzip} -compression). However, you can’t use the @code{-} filename. +compression). However, you can’t use the @code{-} filename. Furthermore, only one VCD file can be written. @emph{VCD} (value change dump) is a file format defined by the @cite{verilog} standard and used by virtually any wave viewer. -Since it comes from @cite{verilog}, only a few VHDL types can be dumped. GHDL +Since it comes from @cite{verilog}, only a few VHDL types can be dumped. GHDL dumps only signals whose base type is of the following: @@ -2519,15 +2596,22 @@ dumps only signals whose base type is of the following: @item types defined in the @code{std.standard} package: + +@itemize * + @item @code{bit} @item @code{bit_vector} +@end itemize @item types defined in the @code{ieee.std_logic_1164} package: + +@itemize * + @item @code{std_ulogic} @@ -2539,6 +2623,7 @@ types defined in the @code{ieee.std_logic_1164} package: @item @code{std_logic_vector} +@end itemize @item any integer type @@ -2550,47 +2635,47 @@ Currently, there is no way to select signals to be dumped: all signals are dumped, which can generate big files. It is very unfortunate there is no standard or well-known wave file -format supporting VHDL types. If you are aware of such a free format, +format supporting VHDL types. If you are aware of such a free format, please mail me (@ref{12,,Reporting bugs}). @end deffn @geindex ghdl command line option; --vcd-nodate -@anchor{using/Simulation cmdoption-ghdl-vcd-nodate}@anchor{9e} +@anchor{using/Simulation cmdoption-ghdl-vcd-nodate}@anchor{a9} @deffn {Option} @w{-}@w{-}vcd@w{-}nodate -Do not write date in VCD file +Do not write date in the VCD file. @end deffn @geindex ghdl command line option; --fst<=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-fst}@anchor{9f} +@anchor{using/Simulation cmdoption-ghdl-fst}@anchor{aa} @deffn {Option} @w{-}@w{-}fst<=FILENAME> -Write the waveforms into a @cite{fst}, that can be displayed by +Write the waveforms into an @cite{fst} file that can be displayed by @cite{gtkwave}. The @cite{fst} files are much smaller than VCD or @cite{GHW} files, but it handles only the same signals as the VCD format. @end deffn @geindex ghdl command line option; --wave<=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-wave}@anchor{a0} +@anchor{using/Simulation cmdoption-ghdl-wave}@anchor{ab} @deffn {Option} @w{-}@w{-}wave<=FILENAME> -Write the waveforms into a @cite{ghw} (GHdl Waveform) file. Currently, all +Write the waveforms into a @cite{ghw} (GHdl Waveform) file. Currently, all the signals are dumped into the waveform file, you cannot select a hierarchy of signals to be dumped. The format of this file was defined by myself and is not yet completely fixed. -It may change slightly. The @code{gtkwave} tool can read the GHW files. +It may change slightly. The @code{gtkwave} tool can read the GHW files. Contrary to VCD files, any VHDL type can be dumped into a GHW file. @end deffn @node Export hierarchy and references,Debugging,Export waveforms,Simulation and runtime -@anchor{using/Simulation export-hierarchy-and-references}@anchor{a1} +@anchor{using/Simulation export-hierarchy-and-references}@anchor{ac} @section Export hierarchy and references @geindex ghdl command line option; --disp-tree<[=KIND]> -@anchor{using/Simulation cmdoption-ghdl-disp-tree}@anchor{a2} +@anchor{using/Simulation cmdoption-ghdl-disp-tree}@anchor{ad} @deffn {Option} @w{-}@w{-}disp@w{-}tree<[=KIND]> @geindex display design hierarchy @@ -2603,38 +2688,33 @@ design. @cite{KIND} is optional, but if set must be one of: @itemize * @item -none -Do not display hierarchy. Same as if the option was not present. +@code{none} Do not display hierarchy. Same as if the option was not present. @item -inst -Display entities, architectures, instances, blocks and generates statements. +@code{inst} Display entities, architectures, instances, blocks and generates statements. @item -proc -Like @code{inst} but also display processes. +@code{proc} Like @code{inst} but also display processes. @item -port -Like @code{proc} but display ports and signals too. +@code{port} Like @code{proc} but display ports and signals too. If @cite{KIND} is not specified, the hierarchy is displayed with the @code{port} mode. @end itemize @end deffn @geindex ghdl command line option; --no-run -@anchor{using/Simulation cmdoption-ghdl-no-run}@anchor{a3} +@anchor{using/Simulation cmdoption-ghdl-no-run}@anchor{ae} @deffn {Option} @w{-}@w{-}no@w{-}run Stop the simulation before the first cycle. This may be used with @code{--disp-tree} to display the tree without simulating the whole design. This option actually elaborates the design, so it will catch any bound error in port maps. @end deffn @geindex ghdl command line option; --xref-html <[options] file...> -@anchor{using/Simulation cmdoption-ghdl-xref-html}@anchor{a4} +@anchor{using/Simulation cmdoption-ghdl-xref-html}@anchor{af} @deffn {Option} @w{-}@w{-}xref@w{-}html <[options] file...> -@end deffn -To easily navigate through your sources, you may generate cross-references. This command generates an html file for each @code{file} given in the command line, with syntax highlighting and full cross-reference: every identifier is a link to its declaration. Besides, an index of the files is created too. +To easily navigate through your sources, you may generate cross-references. This command generates an html file for each @code{file} given in the command line, with syntax highlighting and full cross-reference: every identifier is a link to its declaration. An index of the files is created too. The set of @code{file} are analyzed, and then, if the analysis is successful, html files are generated in the directory specified by the @code{-o} option, or @code{html/} directory by default. @@ -2647,20 +2727,21 @@ If the option @code{--format=html2} is specified, then the generated html files @item If the option @code{--format=css} is specified, then the generated html files follow the HTML 4.0 standard, and use the CSS-1 file @code{ghdl.css} to specify colours. This file is generated only if it does not already exist (it is never overwritten) and can be customized by the user to change colours or appearance. Refer to a generated file and its comments for more information. @end itemize +@end deffn @geindex ghdl command line option; --psl-report<=FILENAME> -@anchor{using/Simulation cmdoption-ghdl-psl-report}@anchor{a5} +@anchor{using/Simulation cmdoption-ghdl-psl-report}@anchor{b0} @deffn {Option} @w{-}@w{-}psl@w{-}report<=FILENAME> -@end deffn -Write a report for PSL at the end of simulation. For each PSL cover and assert statements, the name, source location and whether it passed or failed is reported. The file is written using the JSON format, but still being human readable. +Write a report for PSL at the end of simulation. For each PSL cover and assert statements, the name, source location and whether it passed or failed is reported. The file is written using the JSON format, but is still human readable. +@end deffn @geindex ghdl command line option; --file-to-xml -@anchor{using/Simulation cmdoption-ghdl-file-to-xml}@anchor{a6} +@anchor{using/Simulation cmdoption-ghdl-file-to-xml}@anchor{b1} @deffn {Option} @w{-}@w{-}file@w{-}to@w{-}xml -@end deffn -Outputs an XML representation of the decorated syntax tree for the input file and its dependencies. It can be used for VHDL tooling using semantic information, like style checkers, documentation extraction, complexity estimation… +Outputs an XML representation of the decorated syntax tree for the input file and its dependencies. It can be used for VHDL tooling using semantic information, like style checkers, documentation extraction, complexity estimation, etc. +@end deffn @cartouche @quotation Warning @@ -2679,93 +2760,93 @@ Note that at this time there is no XML dump of the elaborated design. @geindex debugging @node Debugging,,Export hierarchy and references,Simulation and runtime -@anchor{using/Simulation debugging}@anchor{a7} +@anchor{using/Simulation debugging}@anchor{b2} @section Debugging @geindex ghdl command line option; --trace-signals -@anchor{using/Simulation cmdoption-ghdl-trace-signals}@anchor{a8} +@anchor{using/Simulation cmdoption-ghdl-trace-signals}@anchor{b3} @deffn {Option} @w{-}@w{-}trace@w{-}signals -@end deffn Display signals after each cycle. +@end deffn @geindex ghdl command line option; --trace-processes -@anchor{using/Simulation cmdoption-ghdl-trace-processes}@anchor{a9} +@anchor{using/Simulation cmdoption-ghdl-trace-processes}@anchor{b4} @deffn {Option} @w{-}@w{-}trace@w{-}processes -@end deffn Display process name before each cycle. +@end deffn @geindex ghdl command line option; --stats -@anchor{using/Simulation cmdoption-ghdl-stats}@anchor{aa} +@anchor{using/Simulation cmdoption-ghdl-stats}@anchor{b5} @deffn {Option} @w{-}@w{-}stats -@end deffn Display run-time statistics. +@end deffn @geindex ghdl command line option; --disp-order -@anchor{using/Simulation cmdoption-ghdl-disp-order}@anchor{ab} +@anchor{using/Simulation cmdoption-ghdl-disp-order}@anchor{b6} @deffn {Option} @w{-}@w{-}disp@w{-}order -@end deffn Display signals order. +@end deffn @geindex ghdl command line option; --disp-sources -@anchor{using/Simulation cmdoption-ghdl-disp-sources}@anchor{ac} +@anchor{using/Simulation cmdoption-ghdl-disp-sources}@anchor{b7} @deffn {Option} @w{-}@w{-}disp@w{-}sources -@end deffn Display sources while displaying signals. +@end deffn @geindex ghdl command line option; --disp-sig-types -@anchor{using/Simulation cmdoption-ghdl-disp-sig-types}@anchor{ad} +@anchor{using/Simulation cmdoption-ghdl-disp-sig-types}@anchor{b8} @deffn {Option} @w{-}@w{-}disp@w{-}sig@w{-}types -@end deffn Display signal types. +@end deffn @geindex ghdl command line option; --disp-signals-map -@anchor{using/Simulation cmdoption-ghdl-disp-signals-map}@anchor{ae} +@anchor{using/Simulation cmdoption-ghdl-disp-signals-map}@anchor{b9} @deffn {Option} @w{-}@w{-}disp@w{-}signals@w{-}map -@end deffn Display map bw declared signals and internal signals. +@end deffn @geindex ghdl command line option; --disp-signals-table -@anchor{using/Simulation cmdoption-ghdl-disp-signals-table}@anchor{af} +@anchor{using/Simulation cmdoption-ghdl-disp-signals-table}@anchor{ba} @deffn {Option} @w{-}@w{-}disp@w{-}signals@w{-}table -@end deffn Display internal signals. +@end deffn @geindex ghdl command line option; --checks -@anchor{using/Simulation cmdoption-ghdl-checks}@anchor{b0} +@anchor{using/Simulation cmdoption-ghdl-checks}@anchor{bb} @deffn {Option} @w{-}@w{-}checks -@end deffn Do internal checks after each process run. +@end deffn @geindex ghdl command line option; --activity<=LEVEL> -@anchor{using/Simulation cmdoption-ghdl-activity}@anchor{b1} +@anchor{using/Simulation cmdoption-ghdl-activity}@anchor{bc} @deffn {Option} @w{-}@w{-}activity<=LEVEL> -@end deffn -Watch activity of LEVEL signals: LEVEL is all, min (default) or none (unsafe). +Watch activity of LEVEL signals: LEVEL is @code{all}, @code{min} (default) or @code{none} (unsafe). +@end deffn @geindex ghdl command line option; --dump-rti -@anchor{using/Simulation cmdoption-ghdl-dump-rti}@anchor{b2} +@anchor{using/Simulation cmdoption-ghdl-dump-rti}@anchor{bd} @deffn {Option} @w{-}@w{-}dump@w{-}rti -@end deffn Dump Run Time Information (RTI). +@end deffn @geindex ghdl command line option; --bootstrap -@anchor{using/Simulation cmdoption-ghdl-bootstrap}@anchor{b3} +@anchor{using/Simulation cmdoption-ghdl-bootstrap}@anchor{be} @deffn {Option} @w{-}@w{-}bootstrap -@end deffn Allow @code{--work=std} +@end deffn @menu * GNU Debugger (GDB): GNU Debugger GDB. @@ -2773,7 +2854,7 @@ Allow @code{--work=std} @end menu @node GNU Debugger GDB,,,Debugging -@anchor{using/Simulation gnu-debugger-gdb}@anchor{b4} +@anchor{using/Simulation gnu-debugger-gdb}@anchor{bf} @subsection GNU Debugger (GDB) @@ -2787,7 +2868,7 @@ Debugging VHDL programs using @cite{GDB} is possible only with GCC/LLVM. GDB is a general purpose debugger for programs compiled by GCC. Currently, there is no VHDL support for GDB. It may be difficult to inspect variables or signals in GDB. However, it is still able to display the stack frame in case of error or to set a breakpoint at a specified line. -GDB can be useful to precisely catch a runtime error, such as indexing an array beyond its bounds. All error check subprograms call the @code{__ghdl_fatal} procedure. Therefore, to catch runtime error, set a breakpoint like this: +GDB can be useful to catch a runtime error, such as indexing an array beyond its bounds. All error check subprograms call the @code{__ghdl_fatal} procedure. Therefore, to a catch runtime error, set a breakpoint like this: @example (gdb) break __ghdl_fatal @@ -2807,7 +2888,7 @@ When the breakpoint is hit, use the @code{where} or @code{bt} command to display @c # define a hard kine break for HTML @node Releases and sources,Building GHDL from Sources,Simulation and runtime,Top -@anchor{getting/Releases release}@anchor{b5}@anchor{getting/Releases releases-and-sources}@anchor{b6}@anchor{getting/Releases doc}@anchor{b7} +@anchor{getting/Releases release}@anchor{c0}@anchor{getting/Releases releases-and-sources}@anchor{c1}@anchor{getting/Releases doc}@anchor{c2} @chapter Releases and sources @@ -2818,12 +2899,12 @@ When the breakpoint is hit, use the @code{where} or @code{bt} command to display @end menu @node Downloading pre-built packages,Downloading Source Files,,Releases and sources -@anchor{getting/Releases release-packages}@anchor{b8}@anchor{getting/Releases downloading-pre-built-packages}@anchor{b9} +@anchor{getting/Releases release-packages}@anchor{c3}@anchor{getting/Releases downloading-pre-built-packages}@anchor{c4} @section Downloading pre-built packages -@multitable {xxxxxxxxxxxxxxxx} {xxxxxxxxxxxx} {xxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxx} +@multitable {xxxxxxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxx} {xxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxx} @headitem OS @@ -2842,15 +2923,15 @@ Downloads @item -Ubuntu 12.04 +Debian 9 (Stretch) GPL @tab -LLVM 3.8 +mcode @tab -13.8 MiB +2.61 MB @tab @@ -2858,15 +2939,15 @@ LLVM 3.8 @item -Ubuntu 14.04 +Debian 9 (Stretch) @tab -LLVM 3.5 +mcode @tab -11.9 MiB +2.93 MB @tab @@ -2874,15 +2955,15 @@ LLVM 3.5 @item -Fedora +Ubuntu 14 (Trusty) @tab -LLVM +mcode @tab -6.58 MiB +3.15 MB @tab @@ -2890,15 +2971,15 @@ LLVM @item -Fedora +Ubuntu 14 (Trusty) @tab -mcode +LLVM @tab -2.75 MiB +14.11MB @tab @@ -2906,7 +2987,7 @@ mcode @item -Windows x86 +Fedora 26 @tab @@ -2914,69 +2995,97 @@ mcode @tab -5.25 MiB +2.83 MB @tab -@end multitable +@item +Windows x86 (MinGW32) -@node Downloading Source Files,,Downloading pre-built packages,Releases and sources -@anchor{getting/Releases downloading-source-files}@anchor{ba}@anchor{getting/Releases release-sources}@anchor{bb} -@section Downloading Source Files +@tab +mcode -@menu -* Downloading from GitHub:: -* Downloading via git clone:: +@tab -@end menu +3.05 MB -@node Downloading from GitHub,Downloading via git clone,,Downloading Source Files -@anchor{getting/Releases downloading-from-github}@anchor{bc}@anchor{getting/Releases release-sources-zip}@anchor{bd} -@subsection Downloading from GitHub +@tab -GHDL can be downloaded as a zip-file from GitHub. See the following table, to -choose your desired git branch. +@item -@multitable {xxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxx} -@headitem +Windows x86 (MinGW64) -Branch +@tab + +LLVM @tab -Download Link +12.7 MB + +@tab + + @item -master +Mac OS X + +@tab + +mcode + +@tab + +2.26 MB @tab -zip-file -@image{_static/icons/ZIP,,,Source Code from GitHub - 'master' branch.,png} @item -release +Sum: + +@tab + +@tab @tab -zip-file -@image{_static/icons/ZIP,,,Source Code from GitHub - 'release' branch.,png} @end multitable +@node Downloading Source Files,,Downloading pre-built packages,Releases and sources +@anchor{getting/Releases downloading-source-files}@anchor{c5}@anchor{getting/Releases release-sources}@anchor{c6} +@section Downloading Source Files + + +@menu +* Downloading from GitHub:: +* Downloading via git clone:: + +@end menu + +@node Downloading from GitHub,Downloading via git clone,,Downloading Source Files +@anchor{getting/Releases downloading-from-github}@anchor{c7}@anchor{getting/Releases release-sources-zip}@anchor{c8} +@subsection Downloading from GitHub + + +GHDL can be downloaded as a zip-file from GitHub. See the following table, to +choose your desired format/version: + + @node Downloading via git clone,,Downloading from GitHub,Downloading Source Files -@anchor{getting/Releases release-sources-gitclone}@anchor{be}@anchor{getting/Releases downloading-via-git-clone}@anchor{bf} +@anchor{getting/Releases release-sources-gitclone}@anchor{c9}@anchor{getting/Releases downloading-via-git-clone}@anchor{ca} @subsection Downloading via @code{git clone} @@ -3025,7 +3134,7 @@ SSH @end menu @node On Linux,On OS X,,Downloading via git clone -@anchor{getting/Releases on-linux}@anchor{c0} +@anchor{getting/Releases on-linux}@anchor{cb} @subsubsection On Linux @@ -3050,14 +3159,14 @@ git remote rename origin github @end example @node On OS X,On Windows,On Linux,Downloading via git clone -@anchor{getting/Releases on-os-x}@anchor{c1} +@anchor{getting/Releases on-os-x}@anchor{cc} @subsubsection On OS X Please see the Linux instructions. @node On Windows,,On OS X,Downloading via git clone -@anchor{getting/Releases on-windows}@anchor{c2} +@anchor{getting/Releases on-windows}@anchor{cd} @subsubsection On Windows @@ -3065,9 +3174,9 @@ Please see the Linux instructions. @quotation Note All Windows command line instructions are intended for @code{Windows PowerShell}, if not marked otherwise. So executing the following instructions in Windows -Command Prompt (@code{cmd.exe}) won’t function or result in errors! See -the Requirements section on where to -download or update PowerShell. +Command Prompt (@code{cmd.exe}) won’t function or will result in errors! +@code{Windows PowerShell} can be installed or upgraded to v5.1 by installing the +Windows Management Framework@footnote{https://docs.microsoft.com/en-us/powershell/wmf/5.1/install-configure}. @end quotation @end cartouche @@ -3103,16 +3212,16 @@ git remote rename origin github @c # define a hard kine break for HTML @node Building GHDL from Sources,Precompile Vendor Primitives,Releases and sources,Top -@anchor{building/Building doc}@anchor{c3}@anchor{building/Building build}@anchor{c4}@anchor{building/Building building-ghdl-from-sources}@anchor{c5} +@anchor{building/Building doc}@anchor{ce}@anchor{building/Building build}@anchor{cf}@anchor{building/Building building-ghdl-from-sources}@anchor{d0} @chapter Building GHDL from Sources @subheading Download -GHDL can be downloaded as a zip-file@footnote{https://github.com/ghdl/ghdl/archive/master.zip} +GHDL can be downloaded as a zip-file@footnote{https://github.com/ghdl/ghdl/archive/master.zip}/tar-file@footnote{https://github.com/ghdl/ghdl/archive/master.tar.gz} (latest ‘master’ branch) or cloned with @code{git clone} from GitHub. GitHub -offers HTTPS and SSH as transfer protocols. See the @ref{bb,,Downloading Source Files} +offers HTTPS and SSH as transfer protocols. See the @ref{c6,,Downloading Source Files} page for further details. The installation directory is referred to as @code{GHDLRoot}. @subheading Available back-ends @@ -3151,7 +3260,7 @@ Cons @item -@ref{c6,,mcode} +@ref{d1,,mcode} @tab @@ -3182,7 +3291,7 @@ x86_64/i386 only @item -@ref{c7,,LLVM} +@ref{d2,,LLVM} @tab @@ -3210,7 +3319,7 @@ Build is more complex @item -@ref{c8,,GCC} +@ref{d3,,GCC} @tab @@ -3265,7 +3374,7 @@ Code coverage collection (@code{gcov}) is unique to GCC @end menu @node Directory Structure,mcode Backend,,Building GHDL from Sources -@anchor{building/Directories directory-structure}@anchor{c9}@anchor{building/Directories doc}@anchor{ca}@anchor{building/Directories build-dir-structure}@anchor{1a} +@anchor{building/Directories directory-structure}@anchor{d4}@anchor{building/Directories doc}@anchor{d5}@anchor{building/Directories build-dir-structure}@anchor{1a} @section Directory Structure @@ -3277,7 +3386,7 @@ Code coverage collection (@code{gcov}) is unique to GCC @item @code{libraries}: mostly third party libraries such as, @cite{ieee}, @cite{mentor}, -@cite{std}, @cite{synopsys} and @cite{vital}. Except a few shell and @cite{Python} scripts, all +@cite{std}, @cite{synopsys} and @cite{vital}. Except for a few shell and @cite{Python} scripts, all the content is written in VHDL. @@ -3285,23 +3394,23 @@ the content is written in VHDL. @item Vendors like Altera, Lattice and Xilinx have their own simulation libraries, -especially for FPGA primitives, soft and hard macros. These libraries can -not be shipped with GHDL, but we offer prepared compile scripts to +especially for FPGA primitives, soft and hard macros. These libraries cannot +be shipped with GHDL, but we offer prepared compile scripts to pre-compile the vendor libraries, if the vendor tool is present on the computer. These are located in @code{libraries/vendor}. -See @ref{cb,,Precompile Vendor Primitives} for information on how to +See @ref{d6,,Precompile Vendor Primitives} for information on how to use them. @end itemize @item -@code{dist}: scripts and auxiliar files to build GHDL in different +@code{dist}: scripts and auxiliary files to build GHDL in different environments: @itemize * @item -@code{gcc}: header and configuration files to build GHDL with GCC (all the +@code{gcc}: header and configuration files to build GHDL with GCC (all platforms). @item @@ -3325,27 +3434,27 @@ in Travis CI@footnote{https://travis-ci.org/}. @item @code{doc}: @cite{Markdown} and @cite{reStructuredText} sources and auxiliary files to -build the documentation with Sphinx@footnote{http://www.sphinx-doc.org}. Indeed, -Read the docs@footnote{http://readthedocs.org} (RTD) is used to automatically build +build the documentation with Sphinx@footnote{http://www.sphinx-doc.org}. In fact, +Read the Docs@footnote{http://readthedocs.org} (RTD) is used to automatically build and deploy this site and/or PDF you are reading. @item -@code{testsuite}: see section test_suites. +@code{testsuite}: files used for testing. @item @cite{.yml} configuration files for CI environments (@code{readthedocs}, -@code{travis} and @code{appveyor}) and @cite{ignore} files for source control +@code{travis}, and @code{appveyor}) and @cite{ignore} files for source control management tools (@code{git} and @code{.hg}). @item Files for building GHDL: @code{configure} and @code{Makefile.in}. @item -Auxiliar files for development: @code{.gdbinit} and @code{ghdl.gpr.in} +Auxiliary files for development: @code{.gdbinit} and @code{ghdl.gpr.in} (GNAT project file). @item -Text files: @code{COPYING.md}, @code{NEWS.md} and @code{README.md}. +Text files: @code{COPYING.md}, @code{NEWS.md}, and @code{README.md}. @end itemize @c # preload commonly known graphical characters like (c) @@ -3360,12 +3469,12 @@ Text files: @code{COPYING.md}, @code{NEWS.md} and @code{README.md}. @c # define a hard kine break for HTML @node mcode Backend,LLVM Backend,Directory Structure,Building GHDL from Sources -@anchor{building/mcode/index mcode-backend}@anchor{cc}@anchor{building/mcode/index build-mcode}@anchor{c6}@anchor{building/mcode/index doc}@anchor{cd} +@anchor{building/mcode/index mcode-backend}@anchor{d7}@anchor{building/mcode/index build-mcode}@anchor{d1}@anchor{building/mcode/index doc}@anchor{d8} @section mcode Backend -The mcode backend is available for all supported platforms and is also the most -simplest procedure, because it requires the least dependencies and configuration +The mcode backend is available for all supported platforms and is also the +simplest procedure, because it requires the fewest dependencies and configuration options. @subsubheading Requirements @@ -3388,13 +3497,13 @@ GNAT (Ada compiler for GCC) @itemize * @item -@ref{ce,,mcode Backend on GNU/Linux with GCC/GNAT} +@ref{d9,,mcode Backend on GNU/Linux with GCC/GNAT} @item -@ref{cf,,mcode Backend on Windows with GNAT GPL} +@ref{da,,mcode Backend on Windows with GNAT GPL} @item -@ref{d0,,mcode Backend on Windows with GCC/GNAT (MinGW)} +@ref{db,,mcode Backend on Windows with GCC/GNAT (MinGW)} @end itemize @c # preload commonly known graphical characters like (c) @@ -3416,11 +3525,11 @@ GNAT (Ada compiler for GCC) @end menu @node mcode Backend on GNU/Linux with GCC/GNAT,mcode Backend on Windows with GNAT GPL,,mcode Backend -@anchor{building/mcode/GNULinux-GNAT build-mcode-gnulinux-gnat}@anchor{d1}@anchor{building/mcode/GNULinux-GNAT mcode-backend-on-gnu-linux-with-gcc-gnat}@anchor{d2}@anchor{building/mcode/GNULinux-GNAT doc}@anchor{ce} +@anchor{building/mcode/GNULinux-GNAT build-mcode-gnulinux-gnat}@anchor{dc}@anchor{building/mcode/GNULinux-GNAT mcode-backend-on-gnu-linux-with-gcc-gnat}@anchor{dd}@anchor{building/mcode/GNULinux-GNAT doc}@anchor{d9} @subsection mcode Backend on GNU/Linux with GCC/GNAT -On Linux, GHDL is configured by @code{configure} and build by @code{make}. +On Linux, GHDL is configured by @code{configure} and built by @code{make}. @itemize * @@ -3428,7 +3537,7 @@ On Linux, GHDL is configured by @code{configure} and build by @code{make}. @item First, GHDL needs to be configured. It is common to specify a @code{PREFIX} (installation directory like @code{/usr/local} or @code{/opt/ghdl}). Without any -other option, @code{configure} select @cite{mcode} as backend. +other option, @code{configure} selects @cite{mcode} as the backend. @item Next, @code{make} starts the compilation process. @@ -3462,7 +3571,7 @@ $ make install @c # define a hard kine break for HTML @node mcode Backend on Windows with GNAT GPL,mcode Backend on Windows with GCC/GNAT MinGW,mcode Backend on GNU/Linux with GCC/GNAT,mcode Backend -@anchor{building/mcode/Windows-GNATGPL build-mcode-windows-gnatgpl}@anchor{d3}@anchor{building/mcode/Windows-GNATGPL doc}@anchor{cf}@anchor{building/mcode/Windows-GNATGPL mcode-backend-on-windows-with-gnat-gpl}@anchor{d4} +@anchor{building/mcode/Windows-GNATGPL build-mcode-windows-gnatgpl}@anchor{de}@anchor{building/mcode/Windows-GNATGPL doc}@anchor{da}@anchor{building/mcode/Windows-GNATGPL mcode-backend-on-windows-with-gnat-gpl}@anchor{df} @subsection mcode Backend on Windows with GNAT GPL @@ -3473,7 +3582,7 @@ $ make install @end menu @node Requirements,Scripts and Parameters,,mcode Backend on Windows with GNAT GPL -@anchor{building/mcode/Windows-GNATGPL requirements}@anchor{d5} +@anchor{building/mcode/Windows-GNATGPL requirements}@anchor{e0} @subsubsection Requirements @@ -3491,7 +3600,7 @@ PowerShell Community Extensions (PSCX) @end itemize @node Scripts and Parameters,,Requirements,mcode Backend on Windows with GNAT GPL -@anchor{building/mcode/Windows-GNATGPL scripts-and-parameters}@anchor{d6} +@anchor{building/mcode/Windows-GNATGPL scripts-and-parameters}@anchor{e1} @subsubsection Scripts and Parameters @@ -3501,7 +3610,7 @@ PowerShell Community Extensions (PSCX) @end menu @node compile ps1,,,Scripts and Parameters -@anchor{building/mcode/Windows-GNATGPL compile-ps1}@anchor{d7} +@anchor{building/mcode/Windows-GNATGPL compile-ps1}@anchor{e2} @subsubsection @cite{compile.ps1} @@ -3535,11 +3644,11 @@ CreatePackage options: @c # define a hard kine break for HTML @node mcode Backend on Windows with GCC/GNAT MinGW,,mcode Backend on Windows with GNAT GPL,mcode Backend -@anchor{building/mcode/Windows-MinGW-GNAT mcode-backend-on-windows-with-gcc-gnat-mingw}@anchor{d8}@anchor{building/mcode/Windows-MinGW-GNAT build-mcode-windows-mingw-gnat}@anchor{d9}@anchor{building/mcode/Windows-MinGW-GNAT doc}@anchor{d0} +@anchor{building/mcode/Windows-MinGW-GNAT mcode-backend-on-windows-with-gcc-gnat-mingw}@anchor{e3}@anchor{building/mcode/Windows-MinGW-GNAT build-mcode-windows-mingw-gnat}@anchor{e4}@anchor{building/mcode/Windows-MinGW-GNAT doc}@anchor{db} @subsection mcode Backend on Windows with GCC/GNAT (MinGW) -On Windows with MinGW, GHDL is configured by @code{configure} and build by @code{make}. +On Windows with MinGW, GHDL is configured by @code{configure} and built by @code{make}. @itemize * @@ -3547,7 +3656,7 @@ On Windows with MinGW, GHDL is configured by @code{configure} and build by @code @item First, GHDL needs to be configured. It is common to specify a @code{PREFIX} (installation directory like @code{/usr/local} or @code{/opt/ghdl}). Without any -other option, @code{configure} select @cite{mcode} as backend. +other option, @code{configure} selects @cite{mcode} as the backend. @item Next, @code{make} starts the compilation process. @@ -3581,7 +3690,7 @@ $ make install @c # define a hard kine break for HTML @node LLVM Backend,GCC Backend,mcode Backend,Building GHDL from Sources -@anchor{building/llvm/index build-llvm}@anchor{c7}@anchor{building/llvm/index doc}@anchor{da}@anchor{building/llvm/index llvm-backend}@anchor{db} +@anchor{building/llvm/index build-llvm}@anchor{d2}@anchor{building/llvm/index doc}@anchor{e5}@anchor{building/llvm/index llvm-backend}@anchor{e6} @section LLVM Backend @@ -3627,10 +3736,10 @@ LLVM (Low-Level-Virtual Machine) and CLANG (Compiler front-end for LLVM) @itemize * @item -@ref{dc,,LLVM Backend on GNU/Linux with GCC/GNAT} +@ref{e7,,LLVM Backend on GNU/Linux with GCC/GNAT} @item -@ref{dd,,LLVM Backend on Windows with GCC/GNAT (MinGW)} +@ref{e8,,LLVM Backend on Windows with GCC/GNAT (MinGW)} @item Mac OS @@ -3654,13 +3763,13 @@ Mac OS @end menu @node LLVM Backend on GNU/Linux with GCC/GNAT,LLVM Backend on Windows with GCC/GNAT MinGW,,LLVM Backend -@anchor{building/llvm/GNULinux-GNAT llvm-backend-on-gnu-linux-with-gcc-gnat}@anchor{de}@anchor{building/llvm/GNULinux-GNAT doc}@anchor{dc}@anchor{building/llvm/GNULinux-GNAT build-llvm-gnulinux-gnat}@anchor{df} +@anchor{building/llvm/GNULinux-GNAT llvm-backend-on-gnu-linux-with-gcc-gnat}@anchor{e9}@anchor{building/llvm/GNULinux-GNAT doc}@anchor{e7}@anchor{building/llvm/GNULinux-GNAT build-llvm-gnulinux-gnat}@anchor{ea} @subsection LLVM Backend on GNU/Linux with GCC/GNAT @cartouche @quotation Hint -You need to install LLVM (usually depends on @code{libedit}, see #29@footnote{https://github.com/ghdl/ghdl/issues/29}). The supported versions are 3.5 till 5.0, but debugging is only supported with LLVM 3.5. +You need to install LLVM (usually depends on @code{libedit}, see #29@footnote{https://github.com/ghdl/ghdl/issues/29}). The supported versions are 3.5 til 5.0, but debugging is only supported with LLVM 3.5. @end quotation @end cartouche @@ -3704,11 +3813,11 @@ If you want to have stack backtraces on errors (like assert failure or index of @c # define a hard kine break for HTML @node LLVM Backend on Windows with GCC/GNAT MinGW,,LLVM Backend on GNU/Linux with GCC/GNAT,LLVM Backend -@anchor{building/llvm/Windows-MinGW-GNAT build-llvm-windows-mingw-gnat}@anchor{e0}@anchor{building/llvm/Windows-MinGW-GNAT doc}@anchor{dd}@anchor{building/llvm/Windows-MinGW-GNAT llvm-backend-on-windows-with-gcc-gnat-mingw}@anchor{e1} +@anchor{building/llvm/Windows-MinGW-GNAT build-llvm-windows-mingw-gnat}@anchor{eb}@anchor{building/llvm/Windows-MinGW-GNAT doc}@anchor{e8}@anchor{building/llvm/Windows-MinGW-GNAT llvm-backend-on-windows-with-gcc-gnat-mingw}@anchor{ec} @subsection LLVM Backend on Windows with GCC/GNAT (MinGW) -On Windows with MinGW, GHDL is configured by @code{configure} and build by @code{make}. +On Windows with MinGW, GHDL is configured by @code{configure} and built by @code{make}. @itemize * @@ -3716,7 +3825,7 @@ On Windows with MinGW, GHDL is configured by @code{configure} and build by @code @item First, GHDL needs to be configured. It is common to specify a @code{PREFIX} (installation directory like @code{/usr/local} or @code{/opt/ghdl}). Without any -other option, @code{configure} select @cite{mcode} as backend. +other option, @code{configure} selects @cite{mcode} as the backend. @item Next, @code{make} starts the compilation process. @@ -3750,7 +3859,7 @@ $ make install @c # define a hard kine break for HTML @node GCC Backend,,LLVM Backend,Building GHDL from Sources -@anchor{building/gcc/index gcc-backend}@anchor{e2}@anchor{building/gcc/index build-gcc}@anchor{c8}@anchor{building/gcc/index doc}@anchor{e3} +@anchor{building/gcc/index gcc-backend}@anchor{ed}@anchor{building/gcc/index build-gcc}@anchor{d3}@anchor{building/gcc/index doc}@anchor{ee} @section GCC Backend @@ -3777,10 +3886,10 @@ GCC source files. Download and untar the sources of version 4.9.x, 5.x, 6.x or 7 @itemize * @item -@ref{e4,,GCC Backend on GNU/Linux with GCC/GNAT} +@ref{ef,,GCC Backend on GNU/Linux with GCC/GNAT} @item -@ref{e5,,GCC Backend on Windows with GCC/GNAT (MinGW)} +@ref{f0,,GCC Backend on Windows with GCC/GNAT (MinGW)} @end itemize @cartouche @@ -3792,7 +3901,7 @@ $ make ghdl1-gcc # Build the compiler $ make ghdl_gcc # Build the driver $ make libs.vhdl.local_gcc # Compile the vhdl libraries $ make grt-all # Build the GHDL runtime -$ make grt.links # Locally install the GHDL runtime +$ make install.vpi.local # Locally install vpi files @end example In @code{src/ortho/gcc}, create a @code{Makefile.conf} file that sets the following @@ -3802,12 +3911,15 @@ variables: AGCC_GCCSRC_DIR=/path/to/gcc/sources AGCC_GCCOBJ_DIR=/path/to/gcc/build @end example + +If your system gcc was built with @code{--enable-default-pie}, add +@code{-no-pie} option for linking. @end quotation @end cartouche @cartouche @quotation Hint -For ppc64 (and AIX ?) platform, the object file format contains an identifier for the source language. Because gcc doesn’t know about the VHDL, gcc crashes very early. This could be fixed with a very simple change in @code{gcc/config/rs6000/rs6000.c}, @code{function rs6000_output_function_epilogue} (as of gcc 4.8): +For ppc64 (and AIX ?) platform, the object file format contains an identifier for the source language. Because gcc doesn’t know about VHDL, gcc crashes very early. This could be fixed with a very simple change in @code{gcc/config/rs6000/rs6000.c}, @code{function rs6000_output_function_epilogue} (as of gcc 4.8): @example else if (! strcmp (language_string, "GNU Objective-C")) @@ -3840,13 +3952,13 @@ fprintf (file, "%d,", i); @end menu @node GCC Backend on GNU/Linux with GCC/GNAT,GCC Backend on Windows with GCC/GNAT MinGW,,GCC Backend -@anchor{building/gcc/GNULinux-GNAT gcc-backend-on-gnu-linux-with-gcc-gnat}@anchor{e6}@anchor{building/gcc/GNULinux-GNAT doc}@anchor{e4}@anchor{building/gcc/GNULinux-GNAT build-gcc-gnulinux-gnat}@anchor{e7} +@anchor{building/gcc/GNULinux-GNAT gcc-backend-on-gnu-linux-with-gcc-gnat}@anchor{f1}@anchor{building/gcc/GNULinux-GNAT doc}@anchor{ef}@anchor{building/gcc/GNULinux-GNAT build-gcc-gnulinux-gnat}@anchor{f2} @subsection GCC Backend on GNU/Linux with GCC/GNAT @cartouche @quotation Hint -There are some dependencies for building GCC (@code{gmp}, @code{mpfr} and @code{mpc}). If you have not them installed on your system, you can either build them manually or use the @code{download_prerequisites} script provided in the GCC source tree (recommended): @code{cd /path/to/gcc/source/dir && ./contrib/download_prerequisites}. +There are some dependencies for building GCC (@code{gmp}, @code{mpfr} and @code{mpc}). If you have not installed them on your system, you can either build them manually or use the @code{download_prerequisites} script provided in the GCC source tree (recommended): @code{cd /path/to/gcc/source/dir && ./contrib/download_prerequisites}. @end quotation @end cartouche @@ -3854,13 +3966,13 @@ There are some dependencies for building GCC (@code{gmp}, @code{mpfr} and @code{ @itemize * @item -First configure GHDL, specify GCC source directory and @code{PREFIX} (installation directory like @code{/usr/local} or @code{/opt/ghdl}). +First configure GHDL, specify GCC source directory and installation prefix (like @code{/usr/local} or @code{/opt/ghdl}). @item -Next, invoke @code{make} to copy GHDL sources in the source directory. +Next, invoke @code{make copy-sources} to copy GHDL sources in the source directory. @item -Then, configure GCC. The list of @code{--disable} configure options can be adjusted to your needs. GHDL does not require all these optional libraries and disabling them will speed-up the build. +Then, configure GCC. The list of @code{--disable} configure options can be adjusted to your needs. GHDL does not require all these optional libraries and disabling them will speed up the build. @item Now, build and install GCC with @code{make}. @@ -3876,7 +3988,7 @@ Last, build and install GHDL libraries. $ cd <ghdl> $ mkdir build $ cd build -$ ../configure --with-gcc=/path/to/gcc/source/dir --prefix=PREFIX +$ ../configure --with-gcc=/path/to/gcc/source/dir --prefix=/usr/local $ make copy-sources $ mkdir gcc-objs; cd gcc-objs $ /path/to/gcc/source/dir/configure --prefix=/usr/local --enable-languages=c,vhdl \ @@ -3890,7 +4002,7 @@ $ make install @cartouche @quotation Hint -Note that the prefix directory must be the same as the one used to configure GHDL. If you have manually built @code{gmp}/@code{mpfr}/@code{mpc} (without using the script in @code{contrib}) and if you have installed them in a non-standard directory, you may need to add @code{--with-gmp=GMP_INSTALL_DIR}. +Note that the prefix directory to configure @code{gcc} must be the same as the one used to configure GHDL. If you have manually built @code{gmp}/@code{mpfr}/@code{mpc} (without using the script in @code{contrib}), and, if you have installed them in a non-standard directory, you may need to add @code{--with-gmp=GMP_INSTALL_DIR}. @end quotation @end cartouche @@ -3902,7 +4014,7 @@ If your system gcc was configured with @code{--enable-default-pie} (check if tha @cartouche @quotation Hint -If you don’t want to install @code{makeinfo}, do @code{make install MAKEINFO=false} instead. +If you don’t want to install @code{makeinfo}, do @code{make install MAKEINFO=true} instead. @end quotation @end cartouche @@ -3918,7 +4030,7 @@ If you don’t want to install @code{makeinfo}, do @code{make install MAKEINFO=f @c # define a hard kine break for HTML @node GCC Backend on Windows with GCC/GNAT MinGW,,GCC Backend on GNU/Linux with GCC/GNAT,GCC Backend -@anchor{building/gcc/Windows-MinGW-GNAT build-gcc-windows-mingw-gnat}@anchor{e8}@anchor{building/gcc/Windows-MinGW-GNAT doc}@anchor{e5}@anchor{building/gcc/Windows-MinGW-GNAT gcc-backend-on-windows-with-gcc-gnat-mingw}@anchor{e9} +@anchor{building/gcc/Windows-MinGW-GNAT build-gcc-windows-mingw-gnat}@anchor{f3}@anchor{building/gcc/Windows-MinGW-GNAT doc}@anchor{f0}@anchor{building/gcc/Windows-MinGW-GNAT gcc-backend-on-windows-with-gcc-gnat-mingw}@anchor{f4} @subsection GCC Backend on Windows with GCC/GNAT (MinGW) @@ -3960,15 +4072,15 @@ be replaced with direct execution of the binary. See section @ref{d,,Quick Start @end cartouche After making your choice, you can jump to the corresponding section. -However, we suggest you to read @ref{1a,,Directory Structure} before, so that you -know where the content is placed and which temporal files are expected to be +However, we suggest you to read @ref{1a,,Directory Structure} first, so that you +know where the content will be placed and which files are expected to be created. @cartouche @quotation Hint Since GHDL is written in @cite{Ada}, independently of the code generator you use, the @cite{GNU Ada compiler}, @cite{GNAT GPL}, is required, 2014 (or later) for @code{x86} -(32 or 64 bits). @cite{GNAT GPL} can be downloaded anonymously from libre.adacore.com@footnote{http://libre.adacore.com/tools/gnat-gpl-edition/}. +(32 or 64 bit). @cite{GNAT GPL} can be downloaded anonymously from libre.adacore.com@footnote{http://libre.adacore.com/tools/gnat-gpl-edition/}. Then, untar and run the doinstall script. Alternatively, most GNU/Linux provide a package named @code{gcc-ada} or @code{gcc-gnat}. @end quotation @@ -4002,20 +4114,18 @@ $ ../path/to/ghdl/configure ... @c # define a hard kine break for HTML @node Precompile Vendor Primitives,Command Reference,Building GHDL from Sources,Top -@anchor{building/PrecompileVendorPrimitives precompile-vendor-primitives}@anchor{ea}@anchor{building/PrecompileVendorPrimitives getting-precompvendor}@anchor{cb}@anchor{building/PrecompileVendorPrimitives doc}@anchor{eb} +@anchor{building/PrecompileVendorPrimitives precompile-vendor-primitives}@anchor{f5}@anchor{building/PrecompileVendorPrimitives getting-precompvendor}@anchor{d6}@anchor{building/PrecompileVendorPrimitives doc}@anchor{f6} @chapter Precompile Vendor Primitives Vendors like Altera, Lattice and Xilinx have their own simulation libraries, -especially for FPGA primitives, soft and hard macros. These libraries can not +especially for FPGA primitives, soft and hard macros. These libraries cannot be shipped with @emph{GHDL}, but we offer prepared compile scripts to pre-compile the vendor libraries, if the vendor tool is present on the computer. There are also popular simulation and verification libraries like OSVVM @footnote{ OSVVM @indicateurl{http://github.com/OSVVM/OSVVM} -}, VUnit -@footnote{ -VUnit @indicateurl{https://github.com/VUnit/vunit} -} or UVVM @footnote{ +} or +UVVM @footnote{ UVVM @indicateurl{https://github.com/UVVM/UVVM_All} }, which can be pre-compiled, too. @@ -4036,7 +4146,7 @@ Generic Colourizer @indicateurl{http://kassiopeia.juls.savba.sk/~garabik/softwar @end menu @node Supported Vendors Libraries,Supported Simulation and Verification Libraries,,Precompile Vendor Primitives -@anchor{building/PrecompileVendorPrimitives supported-vendors-libraries}@anchor{ec} +@anchor{building/PrecompileVendorPrimitives supported-vendors-libraries}@anchor{f7} @section Supported Vendors Libraries @@ -4139,7 +4249,7 @@ Xilinx Vivado (2014.1 or later): @end itemize @node Supported Simulation and Verification Libraries,Script Configuration,Supported Vendors Libraries,Precompile Vendor Primitives -@anchor{building/PrecompileVendorPrimitives supported-simulation-and-verification-libraries}@anchor{ed} +@anchor{building/PrecompileVendorPrimitives supported-simulation-and-verification-libraries}@anchor{f8} @section Supported Simulation and Verification Libraries @@ -4149,36 +4259,48 @@ Xilinx Vivado (2014.1 or later): @item OSVVM (for VHDL-2008) -@quotation - @itemize * @item osvvm @end itemize -@end quotation @item -VUnit (for VHDL-2008) - -@quotation +UVVM (for VHDL-2008) @itemize * @item -vunit_lib -@end itemize -@end quotation +uvvm-utilities @item -UVVM (for VHDL-2008) +uvvm-vvc-framework +@item +uvvm-vip-avalon_mm -@itemize * +@item +uvvm-vip-axi_lite + +@item +uvvm-vip-axi_stream + +@item +uvvm-vip-gpio + +@item +uvvm-vip-i2c + +@item +uvvm-vip-sbi @item +uvvm-vip-spi + +@item +uvvm-vip-uart @end itemize @end itemize @@ -4187,14 +4309,14 @@ __________________________________________________________________ @node Script Configuration,Compiling on Linux,Supported Simulation and Verification Libraries,Precompile Vendor Primitives -@anchor{building/PrecompileVendorPrimitives script-configuration}@anchor{ee} +@anchor{building/PrecompileVendorPrimitives script-configuration}@anchor{f9} @section Script Configuration The vendor library compile scripts need to know where the used / latest vendor -tool chain is installed. Therefore, the script implement a default installation -directory search as well as environment variable checks. If a vendor tool could -not be detected or the script choses the wrong vendor library source directory, +tool chain is installed. Therefore, the scripts implement a default installation +directory search as well as environment variable checks. If a vendor tool cannot +be detected or the script chooses the wrong vendor library source directory, then it’s possible to provide the path via @cite{–source} or @cite{-Source}. The generated output is stored relative to the current working directory. The @@ -4206,7 +4328,7 @@ To compile all source files with GHDL, the simulator executable is searched in environment variable @cite{GHDL} or by passing the parameter @cite{–ghdl} or @cite{-GHDL} to the scripts. -If the vendor library compilation is used very often, we recommend to configure +If the vendor library compilation is used very often, we recommend configuring these parameters in @cite{config.sh} or @cite{config.psm1}, so the command line can be shortened to the essential parts. @@ -4215,7 +4337,7 @@ __________________________________________________________________ @node Compiling on Linux,Compiling on Windows,Script Configuration,Precompile Vendor Primitives -@anchor{building/PrecompileVendorPrimitives compiling-on-linux}@anchor{ef} +@anchor{building/PrecompileVendorPrimitives compiling-on-linux}@anchor{fa} @section Compiling on Linux @@ -4228,7 +4350,7 @@ __________________________________________________________________ @item @strong{Step 0 - Configure the scripts (optional)} -See next section for how to configure @cite{config.sh}. +See the next section for how to configure @cite{config.sh}. @end table @item @@ -4248,7 +4370,7 @@ $ /usr/local/lib/ghdl/vendors/compile-lattice.sh --all $ /usr/local/lib/ghdl/vendors/compile-xilinx-ise.sh --all $ /usr/local/lib/ghdl/vendors/compile-xilinx-vivado.sh --all $ /usr/local/lib/ghdl/vendors/compile-osvvm.sh --all -$ /usr/local/lib/ghdl/vendors/compile-vunit.sh --all +$ /usr/local/lib/ghdl/vendors/compile-uvvm.sh --all `@w{`}` In most cases GHDL is installed into `/usr/local/`. The scripts are @@ -4268,12 +4390,12 @@ compiles the vendor files into them. @example $ ls -ahl ... -drwxr-xr-x 2 <user> <group> 56K Nov 30 17:41 altera -drwxr-xr-x 2 <user> <group> 56K Nov 30 17:42 lattice -drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 osvvm -drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 vunit -drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 xilinx-ise -drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 xilinx-vivado +drwxr-xr-x 2 <user> <group> 56K Mar 09 17:41 altera +drwxr-xr-x 2 <user> <group> 56K Mar 09 17:42 lattice +drwxr-xr-x 2 <user> <group> 56K Mar 09 17:48 osvvm +drwxr-xr-x 2 <user> <group> 56K Mar 09 17:58 uvvm +drwxr-xr-x 2 <user> <group> 56K Mar 09 17:58 xilinx-ise +drwxr-xr-x 2 <user> <group> 56K Mar 09 17:48 xilinx-vivado `@w{`}` @end example @end itemize @@ -4283,7 +4405,7 @@ __________________________________________________________________ @node Compiling on Windows,Configuration Files,Compiling on Linux,Precompile Vendor Primitives -@anchor{building/PrecompileVendorPrimitives compiling-on-windows}@anchor{f0} +@anchor{building/PrecompileVendorPrimitives compiling-on-windows}@anchor{fb} @section Compiling on Windows @@ -4291,9 +4413,13 @@ __________________________________________________________________ @itemize * @item -@strong{Step 0 - Configure the scripts (optional)} -See next section for how to configure @cite{config.psm1}. +@table @asis + +@item @strong{Step 0 - Configure the scripts (optional)} + +See the next section for how to configure @cite{config.psm1}. +@end table @item @strong{Step 1 - Browse to your simulation working directory} @@ -4311,13 +4437,18 @@ PS> <GHDL>\libraries\vendors\compile-lattice.ps1 -All PS> <GHDL>\libraries\vendors\compile-xilinx-ise.ps1 -All PS> <GHDL>\libraries\vendors\compile-xilinx-vivado.ps1 -All PS> <GHDL>\libraries\vendors\compile-osvvm.ps1 -All -PS> <GHDL>\libraries\vendors\compile-vunit.ps1 -All +PS> <GHDL>\libraries\vendors\compile-uvvm.ps1 -All @end example @item -@strong{Step 3 - Viewing the result} + +@table @asis + +@item @strong{Step 3 - Viewing the result} + This creates vendor directories in your current working directory and compiles the vendor files into them. +@end table @example PS> dir @@ -4325,12 +4456,12 @@ PS> dir Mode LastWriteTime Length Name ---- ------------- ------ ---- -d---- 20.11.2015 19:33 <DIR> altera -d---- 20.11.2015 19:38 <DIR> lattice -d---- 20.11.2015 19:38 <DIR> osvvm -d---- 20.11.2015 19:45 <DIR> vunit_lib -d---- 20.11.2015 19:06 <DIR> xilinx-ise -d---- 20.11.2015 19:40 <DIR> xilinx-vivado +d---- 09.03.2018 19:33 <DIR> altera +d---- 09.03.2018 19:38 <DIR> lattice +d---- 09.03.2018 19:38 <DIR> osvvm +d---- 09.03.2018 19:45 <DIR> uvvm +d---- 09.03.2018 19:06 <DIR> xilinx-ise +d---- 09.03.2018 19:40 <DIR> xilinx-vivado @end example @end itemize @@ -4339,7 +4470,7 @@ __________________________________________________________________ @node Configuration Files,,Compiling on Windows,Precompile Vendor Primitives -@anchor{building/PrecompileVendorPrimitives configuration-files}@anchor{f1} +@anchor{building/PrecompileVendorPrimitives configuration-files}@anchor{fc} @section Configuration Files @@ -4352,55 +4483,53 @@ __________________________________________________________________ @end menu @node For Linux config sh,For Windows config psm1,,Configuration Files -@anchor{building/PrecompileVendorPrimitives for-linux-config-sh}@anchor{f2} +@anchor{building/PrecompileVendorPrimitives for-linux-config-sh}@anchor{fd} @subsection For Linux: @cite{config.sh} Please open the @cite{config.sh} file and set the dictionary entries for the -installed vendor tools to the appropriate directory to your tool’s installation +installed vendor tools to your tool’s installation directories. Use an empty string @cite{“”} for not installed tools. @cite{config.sh}: @example declare -A InstallationDirectory -InstallationDirectory[AlteraQuartus]="/opt/Altera/16.0" -InstallationDirectory[LatticeDiamond]="/opt/Diamond/3.8_x64" +InstallationDirectory[AlteraQuartus]="/opt/Altera/17.1" +InstallationDirectory[LatticeDiamond]="/opt/Diamond/3.9_x64" InstallationDirectory[OSVVM]="/home/<user>/git/GitHub/osvvm" -InstallationDirectory[VUnit]="/home/<user>/git/GitHub/vunit" +InstallationDirectory[UVVM]="/home/<user>/git/GitHub/uvvm_all" InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7" -InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2016.3" +InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2017.4" @end example @node For Windows config psm1,Selectable Options for the Bash Scripts,For Linux config sh,Configuration Files -@anchor{building/PrecompileVendorPrimitives for-windows-config-psm1}@anchor{f3} +@anchor{building/PrecompileVendorPrimitives for-windows-config-psm1}@anchor{fe} @subsection For Windows: @cite{config.psm1} Please open the @cite{config.psm1} file and set the dictionary entries for the -installed vendor tools to the appropriate directory to your tool’s installation +installed vendor tools to your tool’s installation folder. Use an empty string @cite{“”} for not installed tools. @cite{config.psm1}: @example $InstallationDirectory = @@@{ - "AlteraQuartus" = "C:\Altera\16.0"; - "LatticeDiamond" = "C:\Lattice\Diamond\3.8_x64"; + "AlteraQuartus" = "C:\Altera\17.1"; + "LatticeDiamond" = "C:\Lattice\Diamond\3.9_x64"; "XilinxISE" = "C:\Xilinx\14.7\ISE_DS"; - "XilinxVivado" = "C:\Xilinx\Vivado\2016.3"; + "XilinxVivado" = "C:\Xilinx\Vivado\2017.4"; "OSVVM" = "D:\git\GitHub\osvvm"; - "VUnit" = "D:\git\GitHub\vunit" + "UVVM" = "D:\git\GitHub\uvvm_all" @} @end example @node Selectable Options for the Bash Scripts,Selectable Options for the PowerShell Scripts,For Windows config psm1,Configuration Files -@anchor{building/PrecompileVendorPrimitives selectable-options-for-the-bash-scripts}@anchor{f4} +@anchor{building/PrecompileVendorPrimitives selectable-options-for-the-bash-scripts}@anchor{ff} @subsection Selectable Options for the Bash Scripts: -@emph{First I should translate the scripts before writing the docu…} - @itemize * @@ -4408,12 +4537,12 @@ $InstallationDirectory = @@@{ Common parameters to most scripts: @example --h --help Print the embedded help page(s). --c --clean Cleanup directory before analyzing. --n --no-warnings Don't show warnings. Report errors only. --s --skip-existing Skip already compiled files (an *.o file exists). --S --skip-largefiles Don't compile large entities like DSP and PCIe primitives. --H --halt-on-error Stop compiling if an error occurred. +--help, -h Print the embedded help page(s). +--clean, -c Cleanup directory before analyzing. +--no-warnings, -n Don't show warnings. Report errors only. +--skip-existing, -s Skip already compiled files (an *.o file exists). +--skip-largefiles, -S Don't compile large entities like DSP and PCIe primitives. +--halt-on-error, -H Stop compiling if an error occurred. @end example @item @@ -4422,20 +4551,19 @@ Common parameters to most scripts: Selectable libraries: @example - -a --all Compile all libraries, including common libraries, packages and device libraries. - --altera Compile base libraries like 'altera' and 'altera_mf' - --max Compile device libraries for Max CPLDs - --arria Compile device libraries for Arria FPGAs - --cyclone Compile device libraries for Cyclone FPGAs - --stratix Compile device libraries for Stratix FPGAs +--all, -a Compile all libraries, including common libraries, packages and device libraries. +--altera Compile base libraries like 'altera' and 'altera_mf' +--max Compile device libraries for Max CPLDs +--arria Compile device libraries for Arria FPGAs +--cyclone Compile device libraries for Cyclone FPGAs +--stratix Compile device libraries for Stratix FPGAs +@end example Compile options: -.. code-block:: raw - - - --vhdl93 Compile selected libraries with VHDL-93 (default). - --vhdl2008 Compile selected libraries with VHDL-2008. +@example +--vhdl93 Compile selected libraries with VHDL-93 (default). +--vhdl2008 Compile selected libraries with VHDL-2008. @end example @item @@ -4444,19 +4572,19 @@ Compile options: Selectable libraries: @example --a --all Compile all libraries, including common libraries, packages and device libraries. - --unisim Compile the unisim primitives - --unimacro Compile the unimacro macros - --simprim Compile the simprim primitives - --corelib Compile the xilinxcorelib macros - --secureip Compile the secureip primitives +--all, -a Compile all libraries, including common libraries, packages and device libraries. +--unisim Compile the unisim primitives +--unimacro Compile the unimacro macros +--simprim Compile the simprim primitives +--corelib Compile the xilinxcorelib macros +--secureip Compile the secureip primitives @end example Compile options: @example ---vhdl93 Compile selected libraries with VHDL-93 (default). ---vhdl2008 Compile selected libraries with VHDL-2008. +--vhdl93 Compile selected libraries with VHDL-93 (default). +--vhdl2008 Compile selected libraries with VHDL-2008. @end example @item @@ -4465,17 +4593,17 @@ Compile options: Selectable libraries: @example --a --all Compile all libraries, including common libraries, packages and device libraries. - --unisim Compile the unisim primitives - --unimacro Compile the unimacro macros - --secureip Compile the secureip primitives +--all, -a Compile all libraries, including common libraries, packages and device libraries. +--unisim Compile the unisim primitives +--unimacro Compile the unimacro macros +--secureip Compile the secureip primitives @end example Compile options: @example ---vhdl93 Compile selected libraries with VHDL-93 (default). ---vhdl2008 Compile selected libraries with VHDL-2008. +--vhdl93 Compile selected libraries with VHDL-93 (default). +--vhdl2008 Compile selected libraries with VHDL-2008. @end example @item @@ -4484,18 +4612,8 @@ Compile options: Selectable libraries: @example --a --all Compile all. - --osvvm Compile the OSVVM library. -@end example - -@item -@cite{compile-vunit.sh} - -Selectable libraries: - -@example --a --all Compile all. - --osvvm Compile the VUnit library. +--all, -a Compile all. +--osvvm Compile the OSVVM library. @end example @item @@ -4504,13 +4622,13 @@ Selectable libraries: Selectable libraries: @example --a --all Compile all. - --uvvm Compile the VUnit library. +--all, -a Compile all. +--uvvm Compile the UVVM libraries. @end example @end itemize @node Selectable Options for the PowerShell Scripts,,Selectable Options for the Bash Scripts,Configuration Files -@anchor{building/PrecompileVendorPrimitives selectable-options-for-the-powershell-scripts}@anchor{f5} +@anchor{building/PrecompileVendorPrimitives selectable-options-for-the-powershell-scripts}@anchor{100} @subsection Selectable Options for the PowerShell Scripts: @@ -4594,17 +4712,7 @@ Selectable libraries: @example -All Compile all. --OSVVM Compile the OSVVM library. -@end example - -@item -@cite{compile-vunit.ps1} - -Selectable libraries: - -@example --All Compile all. --VUnit Compile the VUnit library. +-OSVVM Compile the OSVVM library. @end example @item @@ -4614,7 +4722,7 @@ Selectable libraries: @example -All Compile all. --UVVM Compile the UVVM libraries. +-UVVM Compile the UVVM libraries. @end example @end itemize @@ -4637,7 +4745,7 @@ __________________________________________________________________ @c # define a hard kine break for HTML @node Command Reference,Coding Style,Precompile Vendor Primitives,Top -@anchor{references/CommandReference ref-command}@anchor{f}@anchor{references/CommandReference command-reference}@anchor{f6}@anchor{references/CommandReference doc}@anchor{f7} +@anchor{references/CommandReference ref-command}@anchor{f}@anchor{references/CommandReference command-reference}@anchor{101}@anchor{references/CommandReference doc}@anchor{102} @chapter Command Reference @@ -4658,17 +4766,17 @@ The most common commands and options are shown in section @ref{e,,Invoking GHDL} @end menu @node Environment variables,Misc commands,,Command Reference -@anchor{references/CommandReference environment-variables}@anchor{f8} +@anchor{references/CommandReference environment-variables}@anchor{103} @section Environment variables @geindex environment variable; GHDL_PREFIX -@anchor{references/CommandReference envvar-GHDL_PREFIX}@anchor{33} +@anchor{references/CommandReference envvar-GHDL_PREFIX}@anchor{34} @deffn {Environment Variable} GHDL_PREFIX @end deffn @node Misc commands,File commands,Environment variables,Command Reference -@anchor{references/CommandReference misc-commands}@anchor{f9} +@anchor{references/CommandReference misc-commands}@anchor{104} @section Misc commands @@ -4685,18 +4793,18 @@ There are a few GHDL commands which are seldom useful. @end menu @node Help [-h],Display config [--disp-config],,Misc commands -@anchor{references/CommandReference help-h}@anchor{fa} +@anchor{references/CommandReference help-h}@anchor{105} @subsection Help [@code{-h}] @geindex ghdl command line option; --help@comma{} -h -@anchor{references/CommandReference cmdoption-ghdl-help}@anchor{fb} +@anchor{references/CommandReference cmdoption-ghdl-help}@anchor{106} @deffn {Option} @w{-}@w{-}help, @w{-}h @end deffn Display (on the standard output) a short description of the all the commands -available. If the help switch is followed by a command switch, then options -for this later command are displayed: +available. If the help switch is followed by a command switch, then options +for that second command are displayed: @example ghdl --help @@ -4707,12 +4815,12 @@ ghdl -h command @geindex cmd display configuration @node Display config [--disp-config],Display standard [--disp-standard],Help [-h],Misc commands -@anchor{references/CommandReference display-config-disp-config}@anchor{fc} +@anchor{references/CommandReference display-config-disp-config}@anchor{107} @subsection Display config [@code{--disp-config}] @geindex ghdl command line option; --disp-config <[options]> -@anchor{references/CommandReference cmdoption-ghdl-disp-config}@anchor{34} +@anchor{references/CommandReference cmdoption-ghdl-disp-config}@anchor{35} @deffn {Option} @w{-}@w{-}disp@w{-}config <[options]> @end deffn @@ -4723,12 +4831,12 @@ Display the program paths and options used by GHDL. This may be useful to track @geindex display `@w{`}std.standard`@w{`} @node Display standard [--disp-standard],Version [--version],Display config [--disp-config],Misc commands -@anchor{references/CommandReference display-standard-disp-standard}@anchor{fd} +@anchor{references/CommandReference display-standard-disp-standard}@anchor{108} @subsection Display standard [@code{--disp-standard}] @geindex ghdl command line option; --disp-standard <[options]> -@anchor{references/CommandReference cmdoption-ghdl-disp-standard}@anchor{fe} +@anchor{references/CommandReference cmdoption-ghdl-disp-standard}@anchor{109} @deffn {Option} @w{-}@w{-}disp@w{-}standard <[options]> @end deffn @@ -4737,19 +4845,19 @@ Display the @code{std.standard} package. @geindex cmd version @node Version [--version],,Display standard [--disp-standard],Misc commands -@anchor{references/CommandReference version-version}@anchor{ff} +@anchor{references/CommandReference version-version}@anchor{10a} @subsection Version [@code{--version}] @geindex ghdl command line option; --version@comma{} -v -@anchor{references/CommandReference cmdoption-ghdl-version}@anchor{100} +@anchor{references/CommandReference cmdoption-ghdl-version}@anchor{10b} @deffn {Option} @w{-}@w{-}version, @w{-}v @end deffn -Display the GHDL version and exit. +Display the GHDL version. @node File commands,GCC/LLVM only commands,Misc commands,Command Reference -@anchor{references/CommandReference file-commands}@anchor{101} +@anchor{references/CommandReference file-commands}@anchor{10c} @section File commands @@ -4768,16 +4876,16 @@ The following commands act on one or several files. These are not analyzed, ther @end menu @node Pretty print [--pp-html],Find [-f],,File commands -@anchor{references/CommandReference pretty-print-pp-html}@anchor{102} +@anchor{references/CommandReference pretty-print-pp-html}@anchor{10d} @subsection Pretty print [@code{--pp-html}] @geindex ghdl command line option; --pp-html <[options] file...> -@anchor{references/CommandReference cmdoption-ghdl-pp-html}@anchor{103} +@anchor{references/CommandReference cmdoption-ghdl-pp-html}@anchor{10e} @deffn {Option} @w{-}@w{-}pp@w{-}html <[options] file...> @end deffn -The files are just scanned and an html file, with syntax highlighting is generated on standard output. Since the files are not even parsed, erroneous files or incomplete designs can be pretty printed. +The files are just scanned and an html file with syntax highlighting is generated on standard output. Since the files are not even parsed, erroneous files or incomplete designs can be pretty printed. The style of the html file can be modified with the @code{--format=} option: @@ -4794,36 +4902,36 @@ When the @code{--format=css} option is specified, the output is an HTML 4.0 file @geindex cmd file find @node Find [-f],Chop [--chop],Pretty print [--pp-html],File commands -@anchor{references/CommandReference find-f}@anchor{104} +@anchor{references/CommandReference find-f}@anchor{10f} @subsection Find [@code{-f}] @geindex ghdl command line option; -f <file...> -@anchor{references/CommandReference cmdoption-ghdl-f}@anchor{48} +@anchor{references/CommandReference cmdoption-ghdl-f}@anchor{4b} @deffn {Option} @w{-}f <file...> @end deffn -The files are scanned, parsed and the names of design units are displayed. Design units marked with two stars are candidate to be at the apex of a design hierarchy. +The files are scanned, parsed and the names of design units are displayed. Design units marked with two stars are candidates to be at the apex of a design hierarchy. @geindex cmd file chop @node Chop [--chop],Lines [--lines],Find [-f],File commands -@anchor{references/CommandReference chop-chop}@anchor{105} +@anchor{references/CommandReference chop-chop}@anchor{110} @subsection Chop [@code{--chop}] @geindex ghdl command line option; --chop <files...> -@anchor{references/CommandReference cmdoption-ghdl-chop}@anchor{106} +@anchor{references/CommandReference cmdoption-ghdl-chop}@anchor{111} @deffn {Option} @w{-}@w{-}chop <files...> @end deffn -The provided files are read, and a file is written in the current directory for every design unit. Each filename is build according to the type: +The provided files are read, and a file is written in the current directory for every design unit. Each filename is built according to the type: @itemize * @item -For an entity declaration, a package declaration or a configuration the file name is @code{NAME.vhdl}, where @cite{NAME} is the name of the design unit. +For an entity declaration, a package declaration, or a configuration the file name is @code{NAME.vhdl}, where @cite{NAME} is the name of the design unit. @item For a package body, the filename is @code{NAME-body.vhdl}. @@ -4836,24 +4944,24 @@ Since the input files are parsed, this command aborts in case of syntax error. T Comments between design units are stored into the most adequate files. -This command may be useful to split big files, if your computer has not enough memory to compile such files. The size of the executable is reduced too. +This command may be useful to split big files, if your computer doesn’t have enough memory to compile such files. The size of the executable is reduced too. @geindex cmd file lines @node Lines [--lines],,Chop [--chop],File commands -@anchor{references/CommandReference lines-lines}@anchor{107} +@anchor{references/CommandReference lines-lines}@anchor{112} @subsection Lines [@code{--lines}] @geindex ghdl command line option; --lines <files...> -@anchor{references/CommandReference cmdoption-ghdl-lines}@anchor{108} +@anchor{references/CommandReference cmdoption-ghdl-lines}@anchor{113} @deffn {Option} @w{-}@w{-}lines <files...> @end deffn Display on the standard output lines of files preceded by line number. @node GCC/LLVM only commands,Options<2>,File commands,Command Reference -@anchor{references/CommandReference gcc-llvm-only-commands}@anchor{109} +@anchor{references/CommandReference gcc-llvm-only-commands}@anchor{114} @section GCC/LLVM only commands @@ -4867,26 +4975,26 @@ Display on the standard output lines of files preceded by line number. @end menu @node Bind [--bind],Link [--link],,GCC/LLVM only commands -@anchor{references/CommandReference bind-bind}@anchor{10a} +@anchor{references/CommandReference bind-bind}@anchor{115} @subsection Bind [@code{--bind}] @geindex ghdl command line option; --bind <[options] primary_unit [secondary_unit]> -@anchor{references/CommandReference cmdoption-ghdl-bind}@anchor{47} +@anchor{references/CommandReference cmdoption-ghdl-bind}@anchor{4a} @deffn {Option} @w{-}@w{-}bind <[options] primary_unit [secondary_unit]> @end deffn -Performs only the first stage of the elaboration command; the list of objects files is created but the executable is not built. This command should be used only when the main entry point is not GHDL. +Performs only the first stage of the elaboration command; the list of object files is created but the executable is not built. This command should be used only when the main entry point is not GHDL. @geindex cmd GCC/LLVM linking @node Link [--link],List link [--list-link],Bind [--bind],GCC/LLVM only commands -@anchor{references/CommandReference link-link}@anchor{10b} +@anchor{references/CommandReference link-link}@anchor{116} @subsection Link [@code{--link}] @geindex ghdl command line option; --link <[options] primary_unit [secondary_unit]> -@anchor{references/CommandReference cmdoption-ghdl-link}@anchor{10c} +@anchor{references/CommandReference cmdoption-ghdl-link}@anchor{117} @deffn {Option} @w{-}@w{-}link <[options] primary_unit [secondary_unit]> @end deffn @@ -4895,19 +5003,19 @@ Performs only the second stage of the elaboration command: the executable is cre @geindex cmd GCC/LLVM list link @node List link [--list-link],,Link [--link],GCC/LLVM only commands -@anchor{references/CommandReference list-link-list-link}@anchor{10d} +@anchor{references/CommandReference list-link-list-link}@anchor{118} @subsection List link [@code{--list-link}] @geindex ghdl command line option; --list-link <primary_unit [secondary_unit]> -@anchor{references/CommandReference cmdoption-ghdl-list-link}@anchor{10e} +@anchor{references/CommandReference cmdoption-ghdl-list-link}@anchor{119} @deffn {Option} @w{-}@w{-}list@w{-}link <primary_unit [secondary_unit]> @end deffn This command may be used only after a bind command. GHDL displays all the files which will be linked to create an executable. This command is intended to add object files in a link of a foreign program. @node Options<2>,Passing options to other programs,GCC/LLVM only commands,Command Reference -@anchor{references/CommandReference options}@anchor{10f} +@anchor{references/CommandReference options}@anchor{11a} @section Options @@ -4916,44 +5024,44 @@ This command may be used only after a bind command. GHDL displays all the files @deffn {Option} @w{-}@w{-}mb@w{-}comments, @w{-}C @end deffn -Allow multi-bytes chars in a comment +Allow multi-bytes chars in a comment. @geindex ghdl command line option; --syn-binding -@anchor{references/CommandReference cmdoption-ghdl-syn-binding}@anchor{110} +@anchor{references/CommandReference cmdoption-ghdl-syn-binding}@anchor{11b} @deffn {Option} @w{-}@w{-}syn@w{-}binding @end deffn -Use synthesizer rules for component binding. During elaboration, if a component is not bound to an entity using VHDL LRM rules, try to find in any known library an entity whose name is the same as the component name. +Use synthesizer rules for component binding. During elaboration, if a component is not bound to an entity using VHDL LRM rules, try to find in any known library an entity whose name is the same as the component name. -This rule is known as synthesizer rule. +This rule is known as the synthesizer rule. -There are two key points: normal VHDL LRM rules are tried first and entities are searched only in known library. A known library is a library which has been named in your design. +There are two key points: normal VHDL LRM rules are tried first and entities are searched only in known libraries. A known library is a library which has been named in your design. This option is only useful during elaboration. @geindex ghdl command line option; --GHDL1<=COMMAND> -@anchor{references/CommandReference cmdoption-ghdl-ghdl1}@anchor{111} +@anchor{references/CommandReference cmdoption-ghdl-ghdl1}@anchor{11c} @deffn {Option} @w{-}@w{-}GHDL1<=COMMAND> @end deffn -Use @code{COMMAND} as the command name for the compiler. If @code{COMMAND} is not a path, then it is searched in the path. +Use @code{COMMAND} as the command name for the compiler. If @code{COMMAND} is not a path, then it is searched in the path. @geindex ghdl command line option; --AS<=COMMAND> -@anchor{references/CommandReference cmdoption-ghdl-as}@anchor{112} +@anchor{references/CommandReference cmdoption-ghdl-as}@anchor{11d} @deffn {Option} @w{-}@w{-}AS<=COMMAND> @end deffn -Use @code{COMMAND} as the command name for the assembler. If @code{COMMAND} is not a path, then it is searched in the path. The default is @code{as}. +Use @code{COMMAND} as the command name for the assembler. If @code{COMMAND} is not a path, then it is searched in the path. The default is @code{as}. @geindex ghdl command line option; --LINK<=COMMAND> -@anchor{references/CommandReference id1}@anchor{113} +@anchor{references/CommandReference id1}@anchor{11e} @deffn {Option} @w{-}@w{-}LINK<=COMMAND> @end deffn -Use @code{COMMAND} as the linker driver. If @code{COMMAND} is not a path, then it is searched in the path. The default is @code{gcc}. +Use @code{COMMAND} as the linker driver. If @code{COMMAND} is not a path, then it is searched in the path. The default is @code{gcc}. @node Passing options to other programs,,Options<2>,Command Reference -@anchor{references/CommandReference passing-options-to-other-programs}@anchor{114} +@anchor{references/CommandReference passing-options-to-other-programs}@anchor{11f} @section Passing options to other programs @@ -4968,21 +5076,21 @@ For many commands, GHDL acts as a driver: it invokes programs to perform the com Both the compiler and the linker are in fact GCC programs. See the GCC manual for details on GCC options. @geindex ghdl command line option; -Wc@comma{}<OPTION> -@anchor{references/CommandReference cmdoption-ghdl-wc-option}@anchor{115} +@anchor{references/CommandReference cmdoption-ghdl-wc-option}@anchor{120} @deffn {Option} @w{-}Wc,<OPTION> @end deffn Pass @cite{OPTION} as an option to the compiler. @geindex ghdl command line option; -Wa@comma{}<OPTION> -@anchor{references/CommandReference cmdoption-ghdl-wa-option}@anchor{116} +@anchor{references/CommandReference cmdoption-ghdl-wa-option}@anchor{121} @deffn {Option} @w{-}Wa,<OPTION> @end deffn Pass @cite{OPTION} as an option to the assembler. @geindex ghdl command line option; -Wl@comma{}<OPTION> -@anchor{references/CommandReference cmdoption-ghdl-wl-option}@anchor{117} +@anchor{references/CommandReference cmdoption-ghdl-wl-option}@anchor{122} @deffn {Option} @w{-}Wl,<OPTION> @end deffn @@ -5000,22 +5108,22 @@ Pass @cite{OPTION} as an option to the linker. @c # define a hard kine break for HTML @node Coding Style,Implementation of VHDL,Command Reference,Top -@anchor{references/CodingStyle coding-style}@anchor{118}@anchor{references/CodingStyle doc}@anchor{119}@anchor{references/CodingStyle ref-style}@anchor{1b} +@anchor{references/CodingStyle coding-style}@anchor{123}@anchor{references/CodingStyle doc}@anchor{124}@anchor{references/CodingStyle ref-style}@anchor{1b} @chapter Coding Style Ada subset: use only a simple (VHDL like) subset of Ada: no tasking, no -controlled types… VHDL users should easily understand that subset. +controlled types… VHDL users should easily understand that subset. Allowed Ada95 features: the standard library, child packages. Use assertions. We try to follow the ‘GNU Coding Standards’ when possible: comments before -declarations, two spaces at end of sentences, finish sentences with a dot. -But: 3 spaces for indentation. +declarations, one space at the end of sentences, finish sentences with a dot. +But: 2 spaces for indentation in code blocks. -No trailing spaces, not TAB (HT). +No trailing spaces, no TAB (HT). -Subprograms must have a comment before to describe it, like: +Subprograms must have a comment before to describe them, like: @example -- Analyze the concurrent statements of PARENT. @@ -5023,7 +5131,7 @@ procedure Sem_Concurrent_Statement_Chain (Parent : Iir); @end example The line before the comment must be a blank line (unless this is the first -declaration). Don’t repeat the comment before the subprogram body. +declaration). Don’t repeat the comment before the subprogram body. @itemize * @@ -5087,24 +5195,20 @@ function Translate_Predefined_TF_Array_Element Loc : Iir) return O_Enode @end example -@end enumerate - - -@enumerate 7 @item If not possible, ask yourself what is wrong! Shorten a name. @end enumerate @item -Rule for the ‘is’: one a new line only if the declarative part is not empty: +Rule for the ‘is’: on a new line only if the declarative part is not empty: @quotation @example procedure Translate_Assign (Target : Mnode; Expr : Iir; Target_Type : Iir) is - Val : O_Enode; + Val : O_Enode; begin @end example @end quotation @@ -5119,7 +5223,7 @@ begin @end example @end quotation -If the parametere line is too long with the ‘is’, put in on a separate line: +If the parameter line is too long with the ‘is’, put in on a separate line: @quotation @@ -5174,9 +5278,9 @@ Do not initialize variables, constants must be declared before variables: @example is - N_Info : constant Iir := Get_Sub_Aggregate_Info (Info); - Assoc : Iir; - Sub : Iir; + N_Info : constant Iir := Get_Sub_Aggregate_Info (Info); + Assoc : Iir; + Sub : Iir; begin @end example @end quotation @@ -5197,11 +5301,11 @@ not use a constant. @c # define a hard kine break for HTML @node Implementation of VHDL,Implementation of VITAL,Coding Style,Top -@anchor{references/ImplementationOfVHDL ref-implvhdl}@anchor{10}@anchor{references/ImplementationOfVHDL doc}@anchor{11a}@anchor{references/ImplementationOfVHDL implementation-of-vhdl}@anchor{11b} +@anchor{references/ImplementationOfVHDL ref-implvhdl}@anchor{10}@anchor{references/ImplementationOfVHDL doc}@anchor{125}@anchor{references/ImplementationOfVHDL implementation-of-vhdl}@anchor{126} @chapter Implementation of VHDL -This chapter describes several implementation defined aspect of VHDL in GHDL. +This chapter describes several implementation defined aspects of VHDL in GHDL. @menu * VHDL standards:: @@ -5215,7 +5319,7 @@ This chapter describes several implementation defined aspect of VHDL in GHDL. @end menu @node VHDL standards,PSL implementation,,Implementation of VHDL -@anchor{references/ImplementationOfVHDL vhdl-standards}@anchor{51}@anchor{references/ImplementationOfVHDL id1}@anchor{11c} +@anchor{references/ImplementationOfVHDL vhdl-standards}@anchor{54}@anchor{references/ImplementationOfVHDL id1}@anchor{127} @section VHDL standards @@ -5241,7 +5345,7 @@ This chapter describes several implementation defined aspect of VHDL in GHDL. @geindex v08 -This is very unfortunate, but there are many versions of the VHDL +Unfortunately, there are many versions of the VHDL language, and they aren’t backward compatible. The VHDL language was first standardized in 1987 by IEEE as IEEE 1076-1987, and @@ -5251,11 +5355,11 @@ since most of the VHDL tools are still based on this standard. Various problems of this first standard have been analyzed by experts groups to give reasonable ways of interpreting the unclear portions of the standard. -VHDL was revised in 1993 by IEEE as IEEE 1076-1993. This revision is still +VHDL was revised in 1993 by IEEE as IEEE 1076-1993. This revision is still well-known. Unfortunately, VHDL-93 is not fully compatible with VHDL-87, i.e. some perfectly -valid VHDL-87 programs are invalid VHDL-93 programs. Here are some of the +valid VHDL-87 programs are invalid VHDL-93 programs. Here are some of the reasons: @@ -5278,16 +5382,16 @@ rules have been added. @end itemize Shared variables were replaced by protected types in the 2000 revision of -the VHDL standard. This modification is also known as 1076a. Note that this +the VHDL standard. This modification is also known as 1076a. Note that this standard is not fully backward compatible with VHDL-93, since the type of a shared variable must now be a protected type (there was no such restriction before). -Minors corrections were added by the 2002 revision of the VHDL standard. This +Minor corrections were added by the 2002 revision of the VHDL standard. This revision is not fully backward compatible with VHDL-00 since, for example, the value of the @cite{‘instance_name} attribute has slightly changed. -The latest version is 2008. Many features have been added, and GHDL +The latest version is 2008. Many features have been added, and GHDL doesn’t implement all of them. You can select the VHDL standard expected by GHDL with the @@ -5299,7 +5403,7 @@ table below: @item 87 -Select VHDL-87 standard as defined by IEEE 1076-1987. LRM bugs corrected by +Select VHDL-87 standard as defined by IEEE 1076-1987. LRM bugs corrected by later revisions are taken into account. @item 93 @@ -5317,7 +5421,7 @@ Select VHDL-93 standard with relaxed rules: VHDL-87 file declarations are accepted; @item -default binding indication rules of VHDL-02 are used. Default binding rules +default binding indication rules of VHDL-02 are used. Default binding rules are often used, but they are particularly obscure before VHDL-02. @end itemize @@ -5327,19 +5431,19 @@ Select VHDL-2000 standard, which adds protected types. @item 02 -Select VHDL-2002 standard +Select VHDL-2002 standard. @item 08 Select VHDL-2008 standard (partially implemented). @end table -The 93, 93c, 00 and 02 standards are considered as compatible: you can -elaborate a design mixing these standards. However, 87, 93 and 08 are +The 93, 93c, 00 and 02 standards are considered compatible: you can +elaborate a design mixing these standards. However, 87, 93 and 08 are not compatible. @node PSL implementation,Source representation,VHDL standards,Implementation of VHDL -@anchor{references/ImplementationOfVHDL id2}@anchor{11d}@anchor{references/ImplementationOfVHDL psl-implementation}@anchor{58} +@anchor{references/ImplementationOfVHDL id2}@anchor{128}@anchor{references/ImplementationOfVHDL psl-implementation}@anchor{5b} @section PSL implementation @@ -5350,11 +5454,11 @@ As PSL annotations are embedded within comments, you must analyze and elaborate your design with option @emph{-fpsl} to enable PSL annotations. A PSL assertion statement must appear within a comment that starts -with the @cite{psl} keyword. The keyword must be followed (on the +with the @cite{psl} keyword. The keyword must be followed (on the same line) by a PSL keyword such as @cite{assert} or @cite{default}. To continue a PSL statement on the next line, just start a new comment. -A PSL statement is considered as a process. So it is not allowed within +A PSL statement is considered a process, so it’s not allowed within a process. All PSL assertions must be clocked (GHDL doesn’t support unclocked assertion). @@ -5368,7 +5472,7 @@ You can either use a default clock like this: -- a -> eventually! b; @end example -or use a clocked expression (note the use of parenthesis): +or use a clocked expression (note the use of parentheses): @example -- psl assert (always a -> next[3](b)) @@rising_edge (clk); @@ -5379,17 +5483,17 @@ Of course only the simple subset of PSL is allowed. Currently the built-in functions are not implemented. @node Source representation,Library database,PSL implementation,Implementation of VHDL -@anchor{references/ImplementationOfVHDL source-representation}@anchor{11e} +@anchor{references/ImplementationOfVHDL source-representation}@anchor{129} @section Source representation According to the VHDL standard, design units (i.e. entities, -architectures, packages, package bodies and configurations) may be +architectures, packages, package bodies, and configurations) may be independently analyzed. Several design units may be grouped into a design file. -In GHDL, a system file represents a design file. That is, a file compiled by +In GHDL, a system file represents a design file. That is, a file compiled by GHDL may contain one or more design units. It is common to have several design units in a design file. @@ -5398,34 +5502,34 @@ GHDL does not impose any restriction on the name of a design file (except that the filename may not contain any control character or spaces). -GHDL do not keep a binary representation of the design units analyzed like -other VHDL analyzers. The sources of the design units are re-read when -needed (for example, an entity is re-read when one of its architecture is -analyzed). Therefore, if you delete or modify a source file of a unit +GHDL does not keep a binary representation of the design units analyzed like +other VHDL analyzers. The sources of the design units are re-read when +needed (for example, an entity is re-read when one of its architectures is +analyzed). Therefore, if you delete or modify a source file of a unit analyzed, GHDL will refuse to use it. @node Library database,Top entity,Source representation,Implementation of VHDL -@anchor{references/ImplementationOfVHDL library-database}@anchor{11f}@anchor{references/ImplementationOfVHDL id3}@anchor{120} +@anchor{references/ImplementationOfVHDL library-database}@anchor{12a}@anchor{references/ImplementationOfVHDL id3}@anchor{12b} @section Library database -Each design unit analyzed is placed into a design library. By default, +Each design unit analyzed is placed into a design library. By default, the name of this design library is @code{work}; however, this can be changed with the @code{--work=NAME} option of GHDL. To keep the list of design units in a design library, GHDL creates -library files. The name of these files is @code{NAME-objVER.cf}, where +library files. The name of these files is @code{NAME-objVER.cf}, where @cite{NAME} is the name of the library, and @cite{VER} the VHDL version (87, 93 or 08) used to analyze the design units. -You don’t have to know how to read a library file. You can display it -using the @emph{-d} of @cite{ghdl}. The file contains the name of the +You don’t have to know how to read a library file. You can display it +using the @emph{-d} of @cite{ghdl}. The file contains the name of the design units, as well as the location and the dependencies. The format may change with the next version of GHDL. @node Top entity,Using vendor libraries,Library database,Implementation of VHDL -@anchor{references/ImplementationOfVHDL top-entity}@anchor{39}@anchor{references/ImplementationOfVHDL id4}@anchor{121} +@anchor{references/ImplementationOfVHDL top-entity}@anchor{3c}@anchor{references/ImplementationOfVHDL id4}@anchor{12c} @section Top entity @@ -5437,28 +5541,28 @@ hierarchy: @item The generic must have a default value, and the value of a generic is its -default value; +default value. @item The ports type must be constrained. @end itemize @node Using vendor libraries,Interfacing to other languages,Top entity,Implementation of VHDL -@anchor{references/ImplementationOfVHDL using-vendor-libraries}@anchor{122} +@anchor{references/ImplementationOfVHDL using-vendor-libraries}@anchor{12d} @section Using vendor libraries -Many vendors libraries have been analyzed with GHDL. There are -usually no problems. Be sure to use the @code{--work=} option. +Many vendors libraries have been analyzed with GHDL. There are +usually no problems. Be sure to use the @code{--work=} option. However, some problems have been encountered. GHDL follows the VHDL LRM (the manual which defines VHDL) more -strictly than other VHDL tools. You could try to relax the +strictly than other VHDL tools. You could try to relax the restrictions by using the @code{--std=93c}, @code{-fexplicit}, @code{-frelaxed-rules} and @code{--warn-no-vital-generic}. @node Interfacing to other languages,,Using vendor libraries,Implementation of VHDL -@anchor{references/ImplementationOfVHDL interfacing-to-other-languages}@anchor{123} +@anchor{references/ImplementationOfVHDL interfacing-to-other-languages}@anchor{12e} @section Interfacing to other languages @@ -5475,7 +5579,7 @@ restrictions by using the @code{--std=93c}, @code{-fexplicit}, Interfacing with foreign languages is possible only on GNU/Linux systems. You can define a subprogram in a foreign language (such as @cite{C} or -@cite{Ada}) and import it in a VHDL design. +@cite{Ada}) and import it into a VHDL design. @menu * Foreign declarations:: @@ -5488,12 +5592,12 @@ You can define a subprogram in a foreign language (such as @cite{C} or @end menu @node Foreign declarations,Restrictions on foreign declarations,,Interfacing to other languages -@anchor{references/ImplementationOfVHDL foreign-declarations}@anchor{124} +@anchor{references/ImplementationOfVHDL foreign-declarations}@anchor{12f} @subsection Foreign declarations Only subprograms (functions or procedures) can be imported, using the foreign -attribute. In this example, the @cite{sin} function is imported: +attribute. In this example, the @cite{sin} function is imported: @example package math is @@ -5510,61 +5614,61 @@ end math; @end example A subprogram is made foreign if the @cite{foreign} attribute decorates -it. This attribute is declared in the 1993 revision of the -@code{std.standard} package. Therefore, you cannot use this feature in +it. This attribute is declared in the 1993 revision of the +@code{std.standard} package. Therefore, you cannot use this feature in VHDL 1987. -The decoration is achieved through an attribute specification. The +The decoration is achieved through an attribute specification. The attribute specification must be in the same declarative part as the -subprogram and must be after it. This is a general rule for specifications. +subprogram and must be after it. This is a general rule for specifications. The value of the specification must be a locally static string. -Even when a subprogram is foreign, its body must be present. However, since -it won’t be called, you can made it empty or simply but an assertion. +Even when a subprogram is foreign, its body must be present. However, since +it won’t be called, you can make it empty or simply put an assertion. The value of the attribute must start with @code{VHPIDIRECT} (an -upper-case keyword followed by one or more blanks). The linkage name of the +upper-case keyword followed by one or more blanks). The linkage name of the subprogram follows. @node Restrictions on foreign declarations,Linking with foreign object files,Foreign declarations,Interfacing to other languages -@anchor{references/ImplementationOfVHDL restrictions-on-foreign-declarations}@anchor{125}@anchor{references/ImplementationOfVHDL id5}@anchor{126} +@anchor{references/ImplementationOfVHDL restrictions-on-foreign-declarations}@anchor{130}@anchor{references/ImplementationOfVHDL id5}@anchor{131} @subsection Restrictions on foreign declarations -Any subprogram can be imported. GHDL puts no restrictions on foreign -subprograms. However, the representation of a type or of an interface in a -foreign language may be obscure. Most of non-composite types are easily imported: +Any subprogram can be imported. GHDL puts no restrictions on foreign +subprograms. However, the representation of a type or of an interface in a +foreign language may be obscure. Most non-composite types are easily imported: @table @asis @item @emph{integer types} -They are represented on a 32 bits word. This generally corresponds to +They are represented by a 32 bit word. This generally corresponds to @cite{int} for @cite{C} or @cite{Integer} for @cite{Ada}. @item @emph{physical types} -They are represented on a 64 bits word. This generally corresponds to the +They are represented by a 64 bit word. This generally corresponds to the @cite{long long} for @cite{C} or @cite{Long_Long_Integer} for @cite{Ada}. @item @emph{floating point types} -They are represented on a 64 bits floating point word. This generally +They are represented by a 64 bit floating point word. This generally corresponds to @cite{double} for @cite{C} or @cite{Long_Float} for @cite{Ada}. @item @emph{enumeration types} -They are represented on 8 bits or 32 bits word, if the number of literals is -greater than 256. There is no corresponding C types, since arguments are +They are represented by an 8 bit word, or, if the number of literals is +greater than 256, by a 32 bit word. There is no corresponding C type, since arguments are not promoted. @end table -Non-composite types are passed by value. For the @cite{in} mode, this -corresponds to the @cite{C} or @cite{Ada} mechanism. The @cite{out} and +Non-composite types are passed by value. For the @cite{in} mode, this +corresponds to the @cite{C} or @cite{Ada} mechanism. The @cite{out} and @cite{inout} interfaces of non-composite types are gathered in a record and this record is passed by reference as the first argument to the -subprogram. As a consequence, you shouldn’t use @cite{in} and +subprogram. As a consequence, you shouldn’t use @cite{in} and @cite{inout} modes in foreign subprograms, since they are not portable. Records are represented like a @cite{C} structure and are passed by reference @@ -5573,21 +5677,21 @@ to subprograms. Arrays with static bounds are represented like a @cite{C} array, whose length is the number of elements, and are passed by reference to subprograms. -Unconstrained array are represented by a fat pointer. Do not use unconstrained +Unconstrained arrays are represented by a fat pointer. Do not use unconstrained arrays in foreign subprograms. -Accesses to an unconstrained array is a fat pointer. Other accesses correspond to an address and are passed to a subprogram like other non-composite types. +Accesses to an unconstrained array are fat pointers. Other accesses correspond to an address and are passed to a subprogram like other non-composite types. -Files are represented by a 32 bits word, which corresponds to an index +Files are represented by a 32 bit word, which corresponds to an index in a table. @node Linking with foreign object files,Starting a simulation from a foreign program,Restrictions on foreign declarations,Interfacing to other languages -@anchor{references/ImplementationOfVHDL id6}@anchor{127}@anchor{references/ImplementationOfVHDL linking-with-foreign-object-files}@anchor{128} +@anchor{references/ImplementationOfVHDL id6}@anchor{132}@anchor{references/ImplementationOfVHDL linking-with-foreign-object-files}@anchor{133} @subsection Linking with foreign object files You may add additional files or options during the link using the -@emph{-Wl,} of @cite{GHDL}, as described in Elaboration_command. +@emph{-Wl,} of @cite{GHDL}, as described in @ref{3b,,Elaboration [-e]}. For example: @example @@ -5600,11 +5704,11 @@ library. Note the @code{c} library is always linked with an executable. @node Starting a simulation from a foreign program,Linking with Ada,Linking with foreign object files,Interfacing to other languages -@anchor{references/ImplementationOfVHDL id7}@anchor{129}@anchor{references/ImplementationOfVHDL starting-a-simulation-from-a-foreign-program}@anchor{12a} +@anchor{references/ImplementationOfVHDL id7}@anchor{134}@anchor{references/ImplementationOfVHDL starting-a-simulation-from-a-foreign-program}@anchor{135} @subsection Starting a simulation from a foreign program -You may run your design from an external program. You just have to call +You may run your design from an external program. You just have to call the @code{ghdl_main} function which can be defined: in C: @@ -5619,38 +5723,38 @@ in Ada: with System; ... function Ghdl_Main (Argc : Integer; Argv : System.Address) - return Integer; + return Integer; pragma import (C, Ghdl_Main, "ghdl_main"); @end example This function must be called once, and returns 0 at the end of the simulation. -In case of failure, this function does not return. This has to be fixed. +In case of failure, this function does not return. This has to be fixed. @node Linking with Ada,Using GRT from Ada,Starting a simulation from a foreign program,Interfacing to other languages -@anchor{references/ImplementationOfVHDL linking-with-ada}@anchor{12b}@anchor{references/ImplementationOfVHDL id8}@anchor{12c} +@anchor{references/ImplementationOfVHDL linking-with-ada}@anchor{136}@anchor{references/ImplementationOfVHDL id8}@anchor{137} @subsection Linking with Ada -As explained previously in @ref{12a,,Starting a simulation from a foreign program}, -you can start a simulation from an @cite{Ada} program. However the build +As explained previously in @ref{135,,Starting a simulation from a foreign program}, +you can start a simulation from an @cite{Ada} program. However the build process is not trivial: you have to elaborate your @cite{Ada} program and your @cite{VHDL} design. -First, you have to analyze all your design files. In this example, we +First, you have to analyze all your design files. In this example, we suppose there is only one design file, @code{design.vhdl}. @example $ ghdl -a design.vhdl @end example -Then, bind your design. In this example, we suppose the entity at the +Then, bind your design. In this example, we suppose the entity at the design apex is @code{design}. @example $ ghdl --bind design @end example -Finally, compile, bind your @cite{Ada} program at link it with your @cite{VHDL} +Finally, compile, bind your @cite{Ada} program and link it with your @cite{VHDL} design: @example @@ -5658,29 +5762,29 @@ $ gnatmake my_prog -largs `ghdl --list-link design` @end example @node Using GRT from Ada,,Linking with Ada,Interfacing to other languages -@anchor{references/ImplementationOfVHDL using-grt-from-ada}@anchor{12d} +@anchor{references/ImplementationOfVHDL using-grt-from-ada}@anchor{138} @subsection Using GRT from Ada @cartouche @quotation Warning -This topic is only for advanced users knowing how to use @cite{Ada} -and @cite{GNAT}. This is provided only for reference, I have tested -this once before releasing @cite{GHDL} 0.19 but this is not checked at +This topic is only for advanced users who know how to use @cite{Ada} +and @cite{GNAT}. This is provided only for reference; we have tested +this once before releasing @cite{GHDL} 0.19, but this is not checked at each release. @end quotation @end cartouche The simulator kernel of @cite{GHDL} named @emph{GRT} is written in @cite{Ada95} and contains a very light and slightly adapted version -of @cite{VHPI}. Since it is an @cite{Ada} implementation it is +of @cite{VHPI}. Since it is an @cite{Ada} implementation it is called @emph{AVHPI}. Although being tough, you may interface to @cite{AVHPI}. For using @cite{AVHPI}, you need the sources of @cite{GHDL} and to recompile -them (at least the @cite{GRT} library). This library is usually compiled with +them (at least the @cite{GRT} library). This library is usually compiled with a @cite{No_Run_Time} pragma, so that the user does not need to install the -@cite{GNAT} runtime library. However, you certainly want to use the usual -runtime library and want to avoid this pragma. For this, reset the +@cite{GNAT} runtime library. However, you certainly want to use the usual +runtime library and want to avoid this pragma. For this, reset the @cite{GRT_PRAGMA_FLAG} variable. @example @@ -5689,7 +5793,7 @@ $ make GRT_PRAGMA_FLAG= grt-all Since @cite{GRT} is a self-contained library, you don’t want @cite{gnatlink} to fetch individual object files (furthermore this -doesn’t always work due to tricks used in @cite{GRT}). For this, +doesn’t always work due to tricks used in @cite{GRT}). For this, remove all the object files and make the @code{.ali} files read-only. @example @@ -5697,12 +5801,12 @@ $ rm *.o $ chmod -w *.ali @end example -You may then install the sources files and the @code{.ali} files. I have never +You may then install the sources files and the @code{.ali} files. I have never tested this step. You are now ready to use it. -For example, here is an example, @code{test_grt.adb} which displays the top +Here is an example, @code{test_grt.adb} which displays the top level design name. @example @@ -5712,26 +5816,26 @@ with Ada.Text_IO; use Ada.Text_IO; with Ghdl_Main; procedure Test_Grt is - -- VHPI handle. - H : VhpiHandleT; - Status : Integer; + -- VHPI handle. + H : VhpiHandleT; + Status : Integer; - -- Name. - Name : String (1 .. 64); - Name_Len : Integer; + -- Name. + Name : String (1 .. 64); + Name_Len : Integer; begin - -- Elaborate and run the design. - Status := Ghdl_Main (0, Null_Address); + -- Elaborate and run the design. + Status := Ghdl_Main (0, Null_Address); - -- Display the status of the simulation. - Put_Line ("Status is " & Integer'Image (Status)); + -- Display the status of the simulation. + Put_Line ("Status is " & Integer'Image (Status)); - -- Get the root instance. - Get_Root_Inst(H); + -- Get the root instance. + Get_Root_Inst(H); - -- Disp its name using vhpi API. - Vhpi_Get_Str (VhpiNameP, H, Name, Name_Len); - Put_Line ("Root instance name: " & Name (1 .. Name_Len)); + -- Disp its name using vhpi API. + Vhpi_Get_Str (VhpiNameP, H, Name, Name_Len); + Put_Line ("Root instance name: " & Name (1 .. Name_Len)); end Test_Grt; @end example @@ -5769,7 +5873,7 @@ Root instance name: counter @c # define a hard kine break for HTML @node Implementation of VITAL,Roadmap | Future Improvements,Implementation of VHDL,Top -@anchor{references/ImplementationOfVITAL doc}@anchor{12e}@anchor{references/ImplementationOfVITAL ref-implvital}@anchor{11}@anchor{references/ImplementationOfVITAL implementation-of-vital}@anchor{12f} +@anchor{references/ImplementationOfVITAL doc}@anchor{139}@anchor{references/ImplementationOfVITAL ref-implvital}@anchor{11}@anchor{references/ImplementationOfVITAL implementation-of-vital}@anchor{13a} @chapter Implementation of VITAL @@ -5779,8 +5883,8 @@ Root instance name: counter @geindex 1076.4 -This chapter describes how VITAL is implemented in GHDL. Support of VITAL is -really in a preliminary stage. Do not expect too much of it as now. +This chapter describes how VITAL is implemented in GHDL. Support of VITAL is +really in a preliminary stage. Do not expect too much of it as of right now. @menu * VITAL packages:: @@ -5791,25 +5895,25 @@ really in a preliminary stage. Do not expect too much of it as now. @end menu @node VITAL packages,VHDL restrictions for VITAL,,Implementation of VITAL -@anchor{references/ImplementationOfVITAL vital-packages}@anchor{53}@anchor{references/ImplementationOfVITAL id1}@anchor{130} +@anchor{references/ImplementationOfVITAL vital-packages}@anchor{56}@anchor{references/ImplementationOfVITAL id1}@anchor{13b} @section VITAL packages The VITAL standard or IEEE 1076.4 was first published in 1995, and revised in 2000. -The version of the VITAL packages depends on the VHDL standard. VITAL +The version of the VITAL packages depends on the VHDL standard. VITAL 1995 packages are used with the VHDL 1987 standard, while VITAL 2000 -packages are used with other standards. This choice is based on the +packages are used with other standards. This choice is based on the requirements of VITAL: VITAL 1995 requires the models follow the VHDL 1987 standard, while VITAL 2000 requires the models follow VHDL 1993. The VITAL 2000 packages were slightly modified so that they conform to -the VHDL 1993 standard (a few functions are made pure and a few one +the VHDL 1993 standard (a few functions are made pure and a few impure). @node VHDL restrictions for VITAL,Backannotation,VITAL packages,Implementation of VITAL -@anchor{references/ImplementationOfVITAL id2}@anchor{131}@anchor{references/ImplementationOfVITAL vhdl-restrictions-for-vital}@anchor{5b} +@anchor{references/ImplementationOfVITAL id2}@anchor{13c}@anchor{references/ImplementationOfVITAL vhdl-restrictions-for-vital}@anchor{5e} @section VHDL restrictions for VITAL @@ -5817,22 +5921,22 @@ The VITAL standard (partially) implemented is the IEEE 1076.4 standard published in 1995. This standard defines restriction of the VHDL language usage on VITAL -model. A @emph{VITAL model} is a design unit (entity or architecture) +model. A @emph{VITAL model} is a design unit (entity or architecture) decorated by the @cite{VITAL_Level0} or @cite{VITAL_Level1} attribute. These attributes are defined in the @cite{ieee.VITAL_Timing} package. -Currently, only VITAL level 0 checks are implemented. VITAL level 1 models +Currently, only VITAL level 0 checks are implemented. VITAL level 1 models can be analyzed, but GHDL doesn’t check they comply with the VITAL standard. Moreover, GHDL doesn’t check (yet) that timing generics are not read inside a VITAL level 0 model prior the VITAL annotation. -The analysis of a non-conformant VITAL model fails. You can disable the -checks of VITAL restrictions with the @emph{–no-vital-checks}. Even when +The analysis of a non-conformant VITAL model fails. You can disable the +checks of VITAL restrictions with the @emph{–no-vital-checks}. Even when restrictions are not checked, SDF annotation can be performed. @node Backannotation,Negative constraint calculation,VHDL restrictions for VITAL,Implementation of VITAL -@anchor{references/ImplementationOfVITAL backannotation}@anchor{96}@anchor{references/ImplementationOfVITAL id3}@anchor{132} +@anchor{references/ImplementationOfVITAL backannotation}@anchor{a1}@anchor{references/ImplementationOfVITAL id3}@anchor{13d} @section Backannotation @@ -5841,36 +5945,36 @@ restrictions are not checked, SDF annotation can be performed. @emph{Backannotation} is the process of setting VITAL generics with timing information provided by an external files. -The external files must be SDF (Standard Delay Format) files. GHDL -supports a tiny subset of SDF version 2.1, other version number can be -used, provided no features added by the next version are used. +The external files must be SDF (Standard Delay Format) files. GHDL +supports a tiny subset of SDF version 2.1. Other version numbers can be +used, provided no features added by later versions are used. Hierarchical instance names are not supported. However you can use a list of -instances. If there is no instance, the top entity will be annotated and -the celltype must be the name of the top entity. If there is at least one +instances. If there is no instance, the top entity will be annotated and +the celltype must be the name of the top entity. If there is at least one instance, the last instance name must be a component instantiation label, and the celltype must be the name of the component declaration instantiated. -Instances being annotated are not required to be VITAL compliant. However +Instances being annotated are not required to be VITAL compliant. However generics being annotated must follow rules of VITAL (e.g., type must be a suitable vital delay type). Currently, only timing constraints applying on a timing generic of type -@cite{VitalDelayType01} has been implemented. This SDF annotator is -just a proof of concept. Features will be added with the following GHDL +@cite{VitalDelayType01} has been implemented. This SDF annotator is +just a proof of concept. Features will be added with the following GHDL release. @node Negative constraint calculation,,Backannotation,Implementation of VITAL -@anchor{references/ImplementationOfVITAL negative-constraint-calculation}@anchor{133} +@anchor{references/ImplementationOfVITAL negative-constraint-calculation}@anchor{13e} @section Negative constraint calculation -Negative constraint delay adjustment are necessary to handle negative -constraint such as a negative setup time. This step is defined in the VITAL +Negative constraint delay adjustments are necessary to handle negative +constraints such as a negative setup time. This step is defined in the VITAL standard and should occur after backannotation. -GHDL does not do negative constraint calculation. It fails to handle models -with negative constraint. I hope to be able to add this phase soon. +GHDL does not do negative constraint calculation. It fails to handle models +with negative constraint. I hope to be able to add this phase soon. @c # preload commonly known graphical characters like (c) @@ -5884,26 +5988,26 @@ with negative constraint. I hope to be able to add this phase soon. @c # define a hard kine break for HTML @node Roadmap | Future Improvements,Meta,Implementation of VITAL,Top -@anchor{appendix/Roadmap doc}@anchor{134}@anchor{appendix/Roadmap change-roadmap}@anchor{135}@anchor{appendix/Roadmap roadmap-future-improvements}@anchor{136} +@anchor{appendix/Roadmap doc}@anchor{13f}@anchor{appendix/Roadmap change-roadmap}@anchor{140}@anchor{appendix/Roadmap roadmap-future-improvements}@anchor{141} @chapter Roadmap | Future Improvements -I have several axes for @cite{GHDL} improvements: +We have several axes for @cite{GHDL} improvements: @itemize * @item -Documentation. +Documentation @item -Better diagnostics messages (warning and error). +Better diagnostics messages (warning and error) @item -Full support of VHDL-2008. +Full support of VHDL-2008 @item -Optimization (simulation speed). +Optimization (simulation speed) @item Graphical tools (to see waves and to debug) @@ -5915,14 +6019,6 @@ Style checks VITAL acceleration @end itemize -@cartouche -@quotation Todo -Under investigation on how to build that beast. -@end quotation -@end cartouche - -@ref{137,,original entry} - @c # preload commonly known graphical characters like (c) @c This data file has been placed in the public domain. @@ -5935,7 +6031,7 @@ Under investigation on how to build that beast. @c # define a hard kine break for HTML @node Meta,Index<2>,Roadmap | Future Improvements,Top -@anchor{appendix/Meta meta}@anchor{138}@anchor{appendix/Meta doc}@anchor{139}@anchor{appendix/Meta change-roadmap}@anchor{13a} +@anchor{appendix/Meta meta}@anchor{142}@anchor{appendix/Meta doc}@anchor{143} @chapter Meta @@ -5949,7 +6045,7 @@ Under investigation on how to build that beast. @end menu @node General guidelines to edit the documentation,Guidelines to edit section ‘Building’,,Meta -@anchor{appendix/Meta general-guidelines-to-edit-the-documentation}@anchor{13b} +@anchor{appendix/Meta general-guidelines-to-edit-the-documentation}@anchor{144} @section General guidelines to edit the documentation @@ -5959,16 +6055,16 @@ Under investigation on how to build that beast. @enumerate @item -It’s better for version control systems and diff tools to break lines at a sensible number of characters. Long lines appear as one diff. Also merging is more complex because merges are line based. Long unbreakable items may be longer (links, refs, …). We chose to use 160 chars. +It’s better for version control systems and diff tools to break lines at a sensible number of characters. Long lines appear as one diff. Also merging is more complex because merges are line based. Long unbreakable items may be longer (links, refs, etc.). We chose to use 160 chars. @item Please indent all directive content by 3 spaces (not 2, and no tabs). @item -Please use @code{*} as an itemize character, since @code{-} and @code{+} are supported by docutils, but not officially supported by Sphinx`. +Please use @code{*} as an itemize character, since @code{-} and @code{+} are supported by docutils, but not officially supported by Sphinx. @item -Please underline all headlines with at least as many characters as the headline is long. Following the Python pattern for headline the levels are: +Please underline all headlines with at least as many characters as the headline is long. Following the Python pattern for headlines the levels are: @example ############ @@ -5990,7 +6086,7 @@ The default role for @quotation @example -`@w{`}…`@w{`} +`@w{`}code`@w{`} @end example @end quotation @@ -5998,15 +6094,14 @@ is samp. @code{:samp:} is only required when you want to write italic text in co @quotation -@quotation -@end quotation - -@code{print 1+@emph{variable}} +@example +:samp:`print 1+@{variable@}` +@end example @end quotation Now, variable becomes italic. -Please simplify all usages of @code{…`to `}…`@w{`} for readability. Here are the regular expressions for an editor like Notepad++: +Please simplify all usages of @code{:samp:`code`} to @code{`@w{`}code`@w{`}} for readability. Here are the regular expressions for an editor like Notepad++: @itemize - @@ -6030,21 +6125,21 @@ Each backend has one folder and each platform/compiler has one file. Please note @end example @item -A documentation should not use “you”, “we”, …, because it’s not an interactive conversation or informal letter. It’s like a thesis, everything is structured and formal. However, to make it more friendly to newcomers, we agree to allow informal language in section ‘@ref{d,,Quick Start Guide}’. +Documentation should not use “you”, “we”, …, because it’s not an interactive conversation or informal letter. It’s like a thesis, everything is structured and formal. However, to make it more friendly to newcomers, we agree to allow informal language in the section @ref{d,,Quick Start Guide}. @item -Please keep errors low. +Please keep errors to a minimum. @end enumerate @end quotation @node Guidelines to edit section ‘Building’,Documentation configuration,General guidelines to edit the documentation,Meta -@anchor{appendix/Meta guidelines-to-edit-section-building}@anchor{13c} +@anchor{appendix/Meta guidelines-to-edit-section-building}@anchor{145} @section Guidelines to edit section ‘Building’ -I prefer a text block, which explains how a compilation works, what I can configure for that backend, etc. After that, I prefer a code block with e.g. bash instructions on how to compile a backend. A list of instructions with embedded bash lines is not helpful. An experienced, as well as novice user, would like to copy a set of instructions into the shell. But it should be stated what these instructions will do. Complex flows like for GCC, can be split into multiple shell code blocks. Moreover, I find it essential, to demonstrate when and where to change directories. +We prefer a text block, which explains how a compilation works, what we can configure for that backend, etc. After that, we prefer a code block with e.g. bash instructions on how to compile a backend. A list of instructions with embedded bash lines is not helpful. An experienced, as well as novice user, would like to copy a set of instructions into the shell. But it should be stated what these instructions will do. Complex flows like for GCC, can be split into multiple shell code blocks. Moreover, we find it essential to demonstrate when and where to change directories. -We would like to see a list like +We would like to see a list like: @itemize * @@ -6062,10 +6157,10 @@ llvm-del (LLVM development package) … @end itemize -The goal is to also explain what a user is installing and what the few lines in the build description do. Now they know the name, can search for similar names if the have another package manager or distro or can ask Google/Wikipedia. We often find many build receipts with cryptic shell code and to execute this unknown stuff with sudo is not comfortable. We would like to know what it does before hiting enter. +The goal is also to explain what a user is installing and what the few lines in the build description do. Now they know the name, can search for similar names if they have another package manager or distro or can ask Google/Wikipedia. We often find many build receipts with cryptic shell code and to execute this unknown stuff with sudo is not comfortable. We would like to know what it does before hitting enter. @node Documentation configuration,CSS,Guidelines to edit section ‘Building’,Meta -@anchor{appendix/Meta documentation-configuration}@anchor{13d} +@anchor{appendix/Meta documentation-configuration}@anchor{146} @section Documentation configuration @@ -6112,7 +6207,7 @@ External ref to option (no link): @end itemize @node CSS,Dist,Documentation configuration,Meta -@anchor{appendix/Meta css}@anchor{13e} +@anchor{appendix/Meta css}@anchor{147} @section CSS @@ -6120,7 +6215,7 @@ External ref to option (no link): @itemize * @item -The indentation of the elements in the side menu have been modified. They are fixed por levels 1, 2 and 3 (#294@footnote{https://github.com/ghdl/ghdl/pull/294#issuecomment-281555760}) and 4 (later). +The indentation of the elements in the side menu have been modified. They are fixed for levels 1, 2 and 3 (#294@footnote{https://github.com/ghdl/ghdl/pull/294#issuecomment-281555760}) and 4 (later). @item The RTD menu (bottom-left) has been modified (#294@footnote{https://github.com/ghdl/ghdl/pull/294#issuecomment-281513494}): @@ -6140,7 +6235,7 @@ The Search box is removed. @end itemize @node Dist,,CSS,Meta -@anchor{appendix/Meta dist}@anchor{13f} +@anchor{appendix/Meta dist}@anchor{148} @section Dist @@ -6148,7 +6243,7 @@ The Search box is removed. @itemize * @item -Ubuntu uses @cite{dash} instead of @cite{bash} when a shell script is run. As a result, some functionalities, such as arrays like @code{array[1]}, are not supported. Therefore, build scripts in @cite{dist/linux} should not use those functionalities unless they are sourced in a @cite{bash} shell. That is, @code{tavis-ci.sh} uses arrays, since it is sourced in the Travis CI machine. But @code{docker-buildtest.sh} and @code{buildtest.sh} do not use any. The same applies to the scripts in @cite{testsuite}. +Ubuntu uses @cite{dash} instead of @cite{bash} when a shell script is run. As a result, some functionalities, such as arrays like @code{array[1]}, are not supported. Therefore, build scripts in @cite{dist/linux} should not use those functionalities unless they are sourced in a @cite{bash} shell. That is, @code{travis-ci.sh} uses arrays, since it is sourced in the Travis CI machine. But @code{docker-buildtest.sh} and @code{buildtest.sh} do not use any. The same applies to the scripts in @cite{testsuite}. @end itemize @c # preload commonly known graphical characters like (c) @@ -6165,7 +6260,7 @@ Ubuntu uses @cite{dash} instead of @cite{bash} when a shell script is run. As a @c # This file is a placeholder and will be replaced @node Index<2>,Index,Meta,Top -@anchor{genindex index}@anchor{140}@anchor{genindex doc}@anchor{141} +@anchor{genindex index}@anchor{149}@anchor{genindex doc}@anchor{14a} @chapter Index @@ -6175,8 +6270,6 @@ Ubuntu uses @cite{dash} instead of @cite{bash} when a shell script is run. As a @printindex ge -@anchor{137}@w{ } -@anchor{building/gcc/Windows-MinGW-GNAT index-0}@w{ } @c %**end of body @bye |