neulab/tldr huggingface dataset:
EiB     exbibyte: 2^60 = 1,152,921,504,606,846,976.
ZB      zettabyte: 10^21 = 1,000,000,000,000,000,000,000
ZiB     2^70 = 1,180,591,620,717,411,303,424. ( Zi is a GNU extension to IEC 60027-2.)
YB      yottabyte: 10^24 = 1,000,000,000,000,000,000,000,000.
YiB     2^80 = 1,208,925,819,614,629,174,706,176. ( Yi is a GNU extension to IEC 60027-2.)
Invoking diff The format for running the diff command is:
diff options... files...
In the simplest case, two file names from-file and to-file are given, and diff compares the contents of from-file and to-file.  A file name of - stands for text read from the standard input. As a special case, diff - - compares a copy of standard input to itself.
If one file is a directory and the other is not, diff compares the file in the directory whose name is that of the non-directory.  The non-directory file must not be -.
If two file names are given and both are directories, diff compares corresponding files in both directories, in alphabetical order; this comparison is not recursive unless the [-r] or [--recursive] option is given.  diff never compares the actual contents of a directory as if it were a file. The file that is fully specified may not be standard input, because standard input is nameless and the notion of “file with the same name” does not apply.
If the [--from-file= file] option is given, the number of file names is arbitrary, and file is compared to each named file. Similarly, if the [--to-file= file] option is given, each named file is compared to file.
diff options begin with -, so normally file names may not begin with -. However, [--] as an argument by itself treats the remaining arguments as file names even if they begin with -.
An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble. Normally, differing binary files count as trouble, but this can be altered by using the [-a] or [--text] option, or the [-q] or [--brief] option.
Options to diff Below is a summary of all of the options that GNU diff accepts. Most options have two equivalent names, one of which is a single letter preceded by -, and the other of which is a long name preceded by --.  Multiple single letter options (unless they take an argument) can be combined into a single command line word: [-ac] is equivalent to [-a -c].  Long named options can be abbreviated to any unique prefix of their name.  Brackets ([ and ]) indicate that an option takes an optional argument.
--text  Treat all files as text and compare them line-by-line, even if they do not seem to be text.See Section “Binary”.
--ignore-space-change Ignore changes in amount of white space.See Section “White Space”.
--ignore-blank-lines Ignore changes that just insert or delete blank lines.See Section “Blank Lines”.
--binary Read and write data in binary mode.See Section “Binary”.
-c      Use the context output format, showing three lines of context.See Section “Context Format”.
-C lines
--context[= lines] Use the context output format, showing lines (an integer) lines of context, or three if lines is not given.See Section “Context Format”.  For proper operation, patch typically needs at least two lines of context.
On older systems, diff supports an obsolete option [- lines] that has effect when combined with [-c] or [-p].  POSIX 1003.1-2001 (see Section “Standards conformance”) does not allow this; use [-C lines] instead.
--changed-group-format= format Use format to output a line group containing differing lines from both files in if-then-else format.See Section “Line Group Formats”.
--minimal Change the algorithm perhaps find a smaller set of changes. This makes diff slower (sometimes much slower).See Section “diff Performance”.
-D name
--ifdef= name Make merged #ifdef format output, conditional on the preprocessor macro name.  See Section.Dq If-then-else .
--ed    Make output that is a valid ed script.See Section “ed Scripts”.
--ignore-tab-expansion Ignore changes due to tab expansion.See Section “White Space”.
--forward-ed Make output that looks vaguely like an ed script but has changes in the order they appear in the file.See Section “Forward ed”.
-F regexp
--show-function-line= regexp In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.  See Section.Dq Specified Headings .
--from-file= file Compare file to each operand; file may be a directory.
--horizon-lines= lines Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix.See Section “diff Performance”.
--ignore-case Ignore changes in case; consider upper- and lower-case letters equivalent.See Section “Case Folding”.
-I regexp
--ignore-matching-lines= regexp Ignore changes that just insert or delete lines that match regexp. See Section.Dq Specified Lines .
--ignore-file-name-case Ignore case when comparing file names during recursive comparison.See Section “Comparing Directories”.
--paginate Pass the output through pr to paginate it.See Section “Pagination”.
--label= label Use label instead of the file name in the context format (see Section “Context Format”) and unified format (see Section “Unified Format”) headers.See Section “RCS”.
--left-column Print only the left column of two common lines in side by side format.See Section “Side by Side Format”.
--line-format= format Use format to output all input lines in if-then-else format.See Section “Line Formats”.
--rcs   Output RCS-format diffs; like [-f] except that each command specifies the number of lines affected.See Section “RCS”.
--new-file In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.See Section “Comparing Directories”.
--new-group-format= format Use format to output a group of lines taken from just the second file in if-then-else format.See Section “Line Group Formats”.
--new-line-format= format Use format to output a line taken from just the second file in if- then-else format.See Section “Line Formats”.
--old-group-format= format Use format to output a group of lines taken from just the first file in if-then-else format.See Section “Line Group Formats”.
--old-line-format= format Use format to output a line taken from just the first file in if- then-else format.See Section “Line Formats”.
--show-c-function Show which C function each change is in.See Section “C Function Headings”.
--brief Report only whether the files differ, not the details of the differences.See Section “Brief”.
--recursive When comparing directories, recursively compare any subdirectories found.See Section “Comparing Directories”.
--report-identical-files Report when two files are the same.See Section “Comparing Directories”.
-S file
--starting-file= file When comparing directories, start with the file file.  This is used for resuming an aborted comparison.See Section “Comparing Directories”.
--speed-large-files Use heuristics to speed handling of large files that have numerous scattered small changes.See Section “diff Performance”.
--strip-trailing-cr Strip any trailing carriage return at the end of an input line.See Section “Binary”.
--suppress-common-lines Do not print common lines in side by side format.See Section “Side by Side Format”.
--expand-tabs Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.See Section “Tabs”.
--initial-tab Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.See Section “Tabs”.
--tabsize= columns Assume that tab stops are set every columns (default 8) print columns.See Section “Tabs”.
--to-file= file Compare each operand to file ; file may be a directory.
-u      Use the unified output format, showing three lines of context.See Section “Unified Format”.
--unchanged-group-format= format Use format to output a group of common lines taken from both files in if-then-else format.See Section “Line Group Formats”.
--unchanged-line-format= format Use format to output a line common to both files in if-then-else format.See Section “Line Formats”.
--unidirectional-new-file When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other.See Section “Comparing Directories”.
-U lines
--unified[= lines] Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given.See Section “Unified Format”.  For proper operation, patch typically needs at least two lines of context.
On older systems, diff supports an obsolete option [- lines] that has effect when combined with [-u].  POSIX 1003.1-2001 (see Section “Standards conformance”) does not allow this; use [-U lines] instead.
--ignore-all-space Ignore white space when comparing lines.See Section “White Space”.
-W columns
--width= columns Output at most columns (default 130) print columns per line in side by side format.See Section “Side by Side Format”.
-x pattern
--exclude= pattern When comparing directories, ignore files and subdirectories whose basenames match pattern.  See Section.Dq Comparing Directories .
-X file
--exclude-from= file When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in file.  See Section.Dq Comparing Directories .
--side-by-side Use the side by side output format.See Section “Side by Side Format”.
Invoking diff3 The diff3 command compares three files and outputs descriptions of their differences.  Its arguments are as follows:
diff3 options... mine older yours
The files to compare are mine, older, and yours.  At most one of these three file names may be -, which tells diff3 to read the standard input for that file.
An exit status of 0 means diff3 was successful, 1 means some conflicts were found, and 2 means trouble.
Options to diff3 Below is a summary of all of the options that GNU diff3 accepts. Multiple single letter options (unless they take an argument) can be combined into a single command line argument.
--text  Treat all files as text and compare them line-by-line, even if they do not appear to be text.See Section “Binary”.
--show-all Incorporate all unmerged changes from older to yours into mine, surrounding conflicts with bracket lines.See Section “Marking Conflicts”.
--diff-program= program Use the compatible comparison program program to compare files instead of diff.
--ed    Generate an ed script that incorporates all the changes from older to yours into mine.  See Section.Dq Which Changes .
--show-overlap Like [-e], except bracket lines from overlapping changes' first and third files.See Section “Marking Conflicts”.  With [-E], an overlapping change looks like this:
<<<<<<< mine lines from mine ======= lines from yours >>>>>>> yours
-i      Generate w and q commands at the end of the ed script for System V compatibility. This option must be combined with one of the [-AeExX3] options, and may not be combined with [-m].  See Section.Dq Saving the Changed File .
--label= label Use the label label for the brackets output by the [-A], [-E] and [-X] options. This option may be given up to three times, one for each input file.  The default labels are the names of the input files. Thus diff3 --label X --label Y --label Z -m A B C acts like diff3 -m A B C, except that the output looks like it came from files named X, Y and Z rather than from files named A, B and C. See Section.Dq Marking Conflicts .
--merge Apply the edit script to the first file and send the result to standard output.  Unlike piping the output from diff3 to ed, this works even for binary files and incomplete lines.  [-A] is assumed if no edit script option is specified.See Section “Bypassing ed”.
--initial-tab Output a tab rather than two spaces before the text of a line in normal format.  This causes the alignment of tabs in the line to look normal.See Section “Tabs”.
--overlap-only Like [-e], except output only the overlapping changes.See Section “Which Changes”.
-X      Like [-E], except output only the overlapping changes. In other words, like [-x], except bracket changes as in [-E].  See Section.Dq Marking Conflicts .
--easy-only Like [-e], except output only the nonoverlapping changes.See Section “Which Changes”.
Invoking patch Normally patch is invoked like this:
patch <patchfile
The full format for invoking patch is:
patch options... [origfile [patchfile]]
You can also specify where to read the patch from with the [-i patchfile] or [--input= patchfile] option. If you do not specify patchfile, or if patchfile is -, patch reads the patch (that is, the diff output) from the standard input.
If you do not specify an input file on the command line, patch tries to intuit from the leading text (any text in the patch that comes before the diff output) which file to edit.See Section “Multiple Patches”.
By default, patch replaces the original input file with the patched version, possibly after renaming the original file into a backup file (see Section “Backup Names”, for a description of how patch names backup files). You can also specify where to put the output with the [-o file] or [--output= file] option; however, do not use this option if file is one of the input files.
Options to patch Here is a summary of all of the options that GNU patch accepts.See Section “patch and Tradition”, for which of these options are safe to use in older versions of patch.
Multiple single-letter options that do not take an argument can be combined into a single command line argument with only one dash.
--backup Back up the original contents of each file, even if backups would normally not be made.See Section “Backups”.
-B prefix
--prefix= prefix Prepend prefix to backup file names.See Section “Backup Names”.
--backup-if-mismatch Back up the original contents of each file if the patch does not exactly match the file. This is the default behavior when not conforming to POSIX.See Section “Backups”.
--binary Read and write all files in binary mode, except for standard output and /dev/tty.  This option has no effect on POSIX-conforming systems like GNU/Linux. On systems where this option makes a difference, the patch should be generated by diff -a --binary.  See Section.Dq Binary .
--context Interpret the patch file as a context diff.See Section “patch Input”.
-d directory
--directory= directory Make directory directory the current directory for interpreting both file names in the patch file, and file names given as arguments to other options.See Section “patch Directories”.
--ifdef= name Make merged if-then-else output using name.  See Section.Dq If- then-else .
--dry-run Print the results of applying the patches without actually changing any files.See Section “Dry Runs”.
--ed    Interpret the patch file as an ed script.See Section “patch Input”.
--remove-empty-files Remove output files that are empty after the patches have been applied.See Section “Creating and Removing”.
--force Assume that the user knows exactly what he or she is doing, and do not ask any questions.See Section “patch Messages”.
-F lines
--fuzz= lines Set the maximum fuzz factor to lines.  See Section.Dq Inexact .
-g num
--get= num If num is positive, get input files from a revision control system as necessary; if zero, do not get the files; if negative, ask the user whether to get the files.See Section “Revision Control”.
-i patchfile
--input= patchfile Read the patch from patchfile rather than from standard input.See Section “patch Options”.
--ignore-white-space Let any sequence of blanks (spaces or tabs) in the patch file match any sequence of blanks in the input file.See Section “Changed White Space”.
--normal Interpret the patch file as a normal diff.See Section “patch Input”.
--forward Ignore patches that patch thinks are reversed or already applied. See also [-R].  See Section.Dq Reversed Patches .
--no-backup-if-mismatch Do not back up the original contents of files. This is the default behavior when conforming to POSIX.See Section “Backups”.
-o file
--output= file Use file as the output file name.See Section “patch Options”.
-p number
--strip= number Set the file name strip count to number.  See Section.Dq patch Directories .
--posix Conform to POSIX, as if the POSIXLY_CORRECT environment variable had been set.See Section “patch and POSIX”.
--quoting-style= word Use style word to quote names in diagnostics, as if the QUOTING_STYLE environment variable had been set to word.  See Section.Dq patch Quoting Style .
-r reject-file
--reject-file= reject-file Use reject-file as the reject file name.See Section “Reject Names”.
--reverse Assume that this patch was created with the old and new files swapped.See Section “Reversed Patches”.
--silent Work silently unless an error occurs.See Section “patch Messages”.
--batch Do not ask any questions.See Section “patch Messages”.
--set-time Set the modification and access times of patched files from time stamps given in context diff headers, assuming that the context diff headers use local time.See Section “Patching Time Stamps”.
--unified Interpret the patch file as a unified diff.See Section “patch Input”.
-V backup-style
--version=control= backup-style Select the naming convention for backup file names.See Section “Backup Names”.
--verbose Print more diagnostics than usual.See Section “patch Messages”.
-x number
--debug= number Set internal debugging flags. Of interest only to patch patchers.
-Y prefix
--basename-prefix= prefix Prepend prefix to base names of backup files.See Section “Backup Names”.
-z suffix
--suffix= suffix Use suffix as the backup extension instead of .orig or ~.  See Section.Dq Backup Names .
--set-utc Set the modification and access times of patched files from time stamps given in context diff headers, assuming that the context diff headers use UTC.See Section “Patching Time Stamps”.
Invoking sdiff The sdiff command merges two files and interactively outputs the results. Its arguments are as follows:
sdiff -o outfile options... from-file to-file
This merges from-file with to-file, with output to outfile.  If from-file is a directory and to-file is not, sdiff compares the file in from-file whose file name is that of to-file, and vice versa.  from-file and to-file may not both be directories.
sdiff options begin with -, so normally from-file and to-file may not begin with -.  However, [--] as an argument by itself treats the remaining arguments as file names even if they begin with -.  You may not use - as an input file.
sdiff without [-o] (or [--output]) produces a side-by-side difference. This usage is obsolete; use the [-y] or [--side-by-side] option of diff instead.
Options to sdiff Below is a summary of all of the options that GNU sdiff accepts. Each option has two equivalent names, one of which is a single letter preceded by -, and the other of which is a long name preceded by --.  Multiple single letter options (unless they take an argument) can be combined into a single command line argument. Long named options can be abbreviated to any unique prefix of their name.
--minimal Change the algorithm to perhaps find a smaller set of changes. This makes sdiff slower (sometimes much slower).See Section “diff Performance”.
--ignore-case Ignore changes in case; consider upper- and lower-case to be the same.See Section “Case Folding”.
--left-column Print only the left column of two common lines.See Section “Side by Side Format”.
--output= file Put merged output into file.  This option is required for merging.
--suppress-common-lines Do not print common lines.See Section “Side by Side Format”.
-w columns
--width= columns Output at most columns (default 130) print columns per line.See Section “Side by Side Format”.  Note that for historical reasons, this option is [-W] in diff, [-w] in sdiff.
--ignore-all-space Ignore white space when comparing lines.See Section “White Space”. Note that for historical reasons, this option is [-w] in diff, [-W] in sdiff.
Standards conformance In a few cases, the GNU utilities' default behavior is incompatible with the POSIX standard. To suppress these incompatibilities, define the POSIXLY_CORRECT environment variable. Unless you are checking for POSIX conformance, you probably do not need to define POSIXLY_CORRECT.
Normally options and operands can appear in any order, and programs act as if all the options appear before any operands. For example, diff lao tzu -C 2 acts like diff -C 2 lao tzu, since 2 is an option-argument of [-C]. However, if the POSIXLY_CORRECT environment variable is set, options must appear before operands, unless otherwise specified for a particular command.
Newer versions of POSIX are occasionally incompatible with older versions. For example, older versions of POSIX allowed the command diff -c -10 to have the same meaning as diff -C 10, but POSIX 1003.1-2001 diff no longer allows digit-string options like [-10].
The GNU utilities normally conform to the version of POSIX that is standard for your system. To cause them to conform to a different version of POSIX, define the _POSIX2_VERSION environment variable to a value of the form yyyymm specifying the year and month the standard was adopted. Two values are currently supported for _POSIX2_VERSION: 199209 stands for POSIX 1003.2-1992, and 200112 stands for POSIX 1003.1-2001. For example, if you are running older software that assumes an older version of POSIX and uses diff -c -10, you can work around the compatibility problems by setting _POSIX2_VERSION=199209 in your environment.
Future Projects Here are some ideas for improving GNU diff and patch.  The GNU project has identified some improvements as potential programming projects for volunteers. You can also help by reporting any bugs that you find.
If you are a programmer and would like to contribute something to the GNU project, please consider volunteering for one of these projects. If you are seriously contemplating work, please write to gvc@gnu.org to coordinate with other volunteers.
Suggested Projects for Improving GNU diff(and) patch One should be able to use GNU diff to generate a patch from any pair of directory trees, and given the patch and a copy of one such tree, use patch to generate a faithful copy of the other. Unfortunately, some changes to directory trees cannot be expressed using current patch formats; also, patch does not handle some of the existing formats. These shortcomings motivate the following suggested projects.
Handling Multibyte and Varying-Width Characters
diff, diff3 and sdiff treat each line of input as a string of unibyte characters. This can mishandle multibyte characters in some cases. For example, when asked to ignore spaces, diff does not properly ignore a multibyte space character.
Also, diff currently assumes that each byte is one column wide, and this assumption is incorrect in some locales, e.g., locales that use UTF-8 encoding. This causes problems with the [-y] or [--side-by-side] option of diff.
These problems need to be fixed without unduly affecting the performance of the utilities in unibyte environments.
The IBM GNU/Linux Technology Center Internationalization Team has proposed http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.patch.gz Unfortunately, these patches are incomplete and are to an older version of diff, so more work needs to be done in this area.
Handling Changes to the Directory Structure
diff and patch do not handle some changes to directory structure. For example, suppose one directory tree contains a directory named D with some subsidiary files, and another contains a file with the same name D.  diff -r does not output enough information for patch to transform the directory subtree into the file.
There should be a way to specify that a file has been removed without having to include its entire contents in the patch file. There should also be a way to tell patch that a file was renamed, even if there is no way for diff to generate such information. There should be a way to tell patch that a file's time stamp has changed, even if its contents have not changed.
These problems can be fixed by extending the diff output format to represent changes in directory structure, and extending patch to understand these extensions.
Files that are Neither Directories Nor Regular Files
Some files are neither directories nor regular files: they are unusual files like symbolic links, device special files, named pipes, and sockets. Currently, diff treats symbolic links as if they were the pointed-to files, except that a recursive diff reports an error if it detects infinite loops of symbolic links (e.g., symbolic links to ..).  diff treats other special files like regular files if they are specified at the top level, but simply reports their presence when comparing directories. This means that patch cannot represent changes to such files. For example, if you change which file a symbolic link points to, diff outputs the difference between the two files, instead of the change to the symbolic link.
diff should optionally report changes to special files specially, and patch should be extended to understand these extensions.
File Names that Contain Unusual Characters
When a file name contains an unusual character like a newline or white space, diff -r generates a patch that patch cannot parse. The problem is with format of diff output, not just with patch, because with odd enough file names one can cause diff to generate a patch that is syntactically correct but patches the wrong files.  The format of diff output should be extended to handle all possible file names.
Outputting Diffs in Time Stamp Order
Applying patch to a multiple-file diff can result in files whose time stamps are out of order.  GNU patch has options to restore the time stamps of the updated files (see Section “Patching Time Stamps”), but sometimes it is useful to generate a patch that works even if the recipient does not have GNU patch, or does not use these options. One way to do this would be to implement a diff option to output diffs in time stamp order.
Ignoring Certain Changes
It would be nice to have a feature for specifying two strings, one in from-file and one in to-file, which should be considered to match. Thus, if the two strings are foo and bar, then if two lines differ only in that foo in file 1 corresponds to bar in file 2, the lines are treated as identical.
It is not clear how general this feature can or should be, or what syntax should be used for it.
A partial substitute is to filter one or both files before comparing, e.g.:
sed 's/foo/bar/g' file1 | diff - file2
However, this outputs the filtered text, not the original.
When comparing two large directory structures, one of which was originally copied from the other with time stamps preserved (e.g., with cp -pR), it would greatly improve performance if an option told diff to assume that two files with the same size and time stamps have the same content.See Section “diff Performance”.
Reporting Bugs If you think you have found a bug in GNU cmp, diff, diff3, or sdiff, please report it by electronic mail to the http://mail.gnu.org/mailman/listinfo/bug-gnu-utils bug-gnu-utils@gnu.org. Please send bug reports for GNU patch to bug-patch@gnu.org.  Send as precise a description of the problem as you can, including the output of the [--version] option and sample input files that produce the bug, if applicable. If you have a nontrivial fix for the bug, please send it as well. If you have a patch, please send it too. It may simplify the maintainer's job if the patch is relative to a recent test release, which you can find in the directory ftp://alpha.gnu.org/gnu/diffutils/
Copying This Manual GNU Free Documentation License Copyright © 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject.  (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ascii without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine- generated HTML, PostScript or PDF produced by some word processors for output purposes only.
A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
1.   Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
2.   List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
3.   State on the Title page the name of the publisher of the Modified Version, as the publisher.
4.   Preserve all the copyright notices of the Document.
5.   Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
6.   Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
7.   Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
8.   Include an unaltered copy of this License.
9.   Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
10.  Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
11.  For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
12.  Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
13.  Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version.
14.  Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section.
15.  Preserve any Warranty Disclaimers.
You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (C)  year  your name. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A copy of the license is included in the section entitled “GNU Free Documentation License”.
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this:
with the Invariant Sections being list their titles, with the Front-Cover Texts being list, and with the Back-Cover Texts being list.
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
Translations of This Manual Nishio Futoshi of the GNUjdoc project has prepared a Japanese translation of this manual. Its most recent version can be found at http://openlab.ring.gr.jp/gnujdoc/cvsweb/cvsweb.cgi/gnujdoc/
iverilog(1)                   Version 11.0 (stable)                  iverilog(1)
iverilog - Icarus Verilog compiler
iverilog [-EiSuVv] [-Bpath] [-ccmdfile|-fcmdfile] [-Dmacro[=defn]] [-Pparameter=value] [-pflag=value] [-dname] [-g1995|-g2001|-g2005 |-g2005-sv|-g2009|-g2012|-g<feature>] [-Iincludedir] [-Lmoduledir] [-mmodule] [-M[mode=]file] [-Nfile] [-ooutputfilename] [-stopmodule] [-ttype] [-Tmin/typ/max] [-Wclass] [-ypath] [-lfile] sourcefile
iverilog is a compiler that translates Verilog source code into executable programs for simulation, or other netlist formats for further processing. The currently supported targets are vvp for simulation, and fpga for synthesis. Other target types are added as code generators are implemented.
iverilog accepts the following options:
-Bbase  The iverilog program uses external programs and configuration files to preprocess and compile the Verilog source. Normally, the path used to locate these tools is built into the iverilog program. However, the -B switch allows the user to select a different set of programs. The path given is used to locate ivlpp, ivl, code generators and the VPI modules.
-cfile -ffile These flags specify an input file that contains a list of Verilog source files. This is similar to the command file of other Verilog simulators, in that it is a file that contains the file names instead of taking them on the command line. See Command Files below.
-Dmacro Defines macro macro with the string `1' as its definition. This form is normally only used to trigger ifdef conditionals in the Verilog source.
-Dmacro=defn Defines macro macro as defn.
-Pparameter=value Override (i.e. defparam) a parameter in a root module. This allows the user to override at compile time (defparam) a parameter in a root module instance. For example, -Pmain.foo=2 overrides the parameter foo in the root instance main with the value 2.
-dname  Activate a class of compiler debugging messages. The -d switch may be used as often as necessary to activate all the desired messages.  Supported names are scopes, eval_tree, elaborate, and synth2; any other names are ignored.
-E      Preprocess the Verilog source, but do not compile it. The output file is the Verilog input, but with file inclusions and macro references expanded and removed. This is useful, for example, to preprocess Verilog source for use by other compilers.
-g1995|-g2001|-g2001-noconfig|-g2005|-g2005-sv|-g2009|-g2012 Select the Verilog language generation to support in the compiler.  This selects between IEEE1364-1995, IEEE1364-2001, IEEE1364-2005, IEEE1800-2005, IEEE1800-2009, or IEEE1800-2012. Icarus Verilog currently defaults to the IEEE1364-2005 generation of the language. This flag is used to restrict the language to a set of keywords/features, this allows simulation of older Verilog code that may use newer keywords and for compatibility with other tools. Much of the IEEE1800 generations functionality is not currently supported.  The IEEE1800 generations do parse all the keywords, so they can be used to verify that IEEE1364 compliant Verilog code does not use any of the new IEEE1800 keywords.
-gverilog-ams|-gno-verilog-ams Enable or disable (default) support for Verilog-AMS.  Very little Verilog-AMS specific functionality is currently supported.
-gassertions|-gsupported-assertions|-gno-assertions Enable (default) or disable SystemVerilog assertions. When enabled, assertion statements are elaborated. When disabled, assertion statements are parsed but ignored. The -gsupported- assertions option only enables assertions that are currently supported by the compiler.
-gspecify|-gno-specify Enable or disable (default) specify block support. When enabled, specify block code is elaborated. When disabled, specify blocks are parsed but ignored. Specify blocks are commonly not needed for RTL simulation, and in fact can hurt performance of the simulation. However, disabling specify blocks reduces accuracy of full-timing simulations.
-gstd-include|-gno-std-include Enable (default) or disable the search of a standard installation include directory after all other explicit include directories. This standard include directory is a convenient place to install standard header files that a Verilog program may include.
-grelative-include|-gno-relative-include Enable or disable (default) adding the local files directory to the beginning of the include file search path. This allows files to be included relative to the current file not the more common files are only found in the working directory or in the specified include file search path.
-gxtypes|-gno-xtypes Enable (default) or disable support for extended types. Enabling extended types allows for new types that are supported by Icarus Verilog as extensions beyond the baseline Verilog. It may be necessary to disable extended types if compiling code that clashes with the few new keywords used to implement the type system.
-gio-range-error|-gno-io-range-error The standards requires that a vectored port have matching ranges for its port declaration as well as any net/register declaration. It was common practice in the past to only specify the range for the net/register declaration and some tools still allow this. By default any mismatch is reported as a error. Using -gno-io-range-error will produce a warning instead of a fatal error for the case of a vectored net/register and a scalar port declaration.
-gstrict-ca-eval|-gno-strict-ca-eval The standard requires that if any input to a continuous assignment expression changes value, the entire expression is re- evaluated. By default, parts of the expression that do not depend on the changed input value(s) are not re-evaluated. If an expression contains a call to a function that doesn't depend solely on its input values or that has side effects, the resulting behavior will differ from that required by the standard. Using -gstrict-ca-eval will force standard compliant behavior (with some loss in performance).
-gstrict-expr-width|-gno-strict-expr-width Enable or disable (default) strict compliance with the standard rules for determining expression bit lengths. When disabled, the RHS of a parameter assignment is evaluated as a lossless expression, as is any expression containing an unsized constant number, and unsized constant numbers are not truncated to integer width.
-gshared-loop-index|-gno-shared-loop-index Enable (default) or disable the exclusion of for-loop control variables from implicit event_expression lists. When enabled, if a for-loop control variable (loop index) is only used inside the for-loop statement, the compiler will not include it in an implicit event_expression list it calculates for that statement or any enclosing statement. This allows the same control variable to be used in multiple processes without risk of entering an infinite loop caused by each process triggering all other processes that use the same varaible. For strict compliance with the standards, this behaviour should be disabled.
-Iincludedir Append directory includedir to list of directories searched for Verilog include files. The -I switch may be used many times to specify several directories to search, the directories are searched in the order they appear on the command line.
-i      Ignore missing modules. Normally it is an error if a module instantiation refers to an undefined module. This option causes the compiler to skip over that instantiation. It will also stop the compiler returning an error if there are no top level modules. This allows the compiler to be used to check incomplete designs for errors.