diff --git a/Documentation/usage/icarus_verilog_quirks.rst b/Documentation/usage/icarus_verilog_quirks.rst new file mode 100644 index 000000000..57583f061 --- /dev/null +++ b/Documentation/usage/icarus_verilog_quirks.rst @@ -0,0 +1,47 @@ + +Icarus Verilog Quirks +===================== + +This is a list of known quirks that are presented by Icarus Verilog. The idea +of this chapter is to call out ways that Icarus Verilog differs from the +standard, or from other implementations. + +This is NOT AN EXHAUSTIVE LIST. If something is missing from this list, let us +know and we can add documentation. + +System Tasks - Unique to Icarus Verilog +--------------------------------------- + +These are system tasks that are unique to Icarus Verilog. Don't use any of +these if you want to keep your code portable across other Verilog compilers. + +$readmempath +^^^^^^^^^^^^ +The "$readmemb" and "$readmemh" system tasks read text files that contain data +values to populate memories. Normally, those files are found in a current work +directory. The "$readmempath()" system task can be used to create a search +path for those files. For example: + +.. code-block:: verilog + + reg [7:0] mem [0:7]; + initial begin + $readmemh("datafile.txt", mem); + end + +This assumes that the "datafile.txt" is in the current working directory where +the vvp command is running. But with the "$readmempath", one can specify a +search path: + +.. code-block:: verilog + + reg [7:0] mem [0:7]; + initial begin + $readmempath(".:alternative:/global/defaults"); + $readmemh("datafile.txt", mem); + end + +In this example, the "datafile.txt" is searched for in each of the directories +in the above list (separated by ":" characters). The first located instance +is the one that is used. So for example, if "./datafile.txt" exists, then it +is read instead of "/global/defaults/datafile.txt" even if the latter exists. diff --git a/Documentation/usage/index.rst b/Documentation/usage/index.rst index 99c7b7b80..9601baa54 100644 --- a/Documentation/usage/index.rst +++ b/Documentation/usage/index.rst @@ -20,4 +20,5 @@ Icarus Verilog. vhdlpp_flags gtkwave vpi + icarus_verilog_quirks reporting_issues diff --git a/ivtest/gold/pr2509349a-msys2.gold b/ivtest/gold/pr2509349a-msys2.gold deleted file mode 100755 index 8fd001964..000000000 --- a/ivtest/gold/pr2509349a-msys2.gold +++ /dev/null @@ -1,5 +0,0 @@ -WARNING: ./ivltests/pr2509349a.v:10: $readmempath could not find directory "/tmp"! -WARNING: ./ivltests/pr2509349a.v:10: $readmempath could not find directory "/no_dir"! -WARNING: ./ivltests/pr2509349a.v:10: $readmempath could not find directory "no_dir2"! -WARNING: ./ivltests/pr2509349a.v:10: $readmempath's path element "vsim" is not a directory! -PASSED diff --git a/ivtest/gold/pr2509349a-vlog95-vvp-stdout.gold b/ivtest/gold/pr2509349a-vlog95-vvp-stdout.gold new file mode 100644 index 000000000..d46d6fb73 --- /dev/null +++ b/ivtest/gold/pr2509349a-vlog95-vvp-stdout.gold @@ -0,0 +1,4 @@ +WARNING: work/a.out.v:17: $readmempath could not find directory "/no_dir"! +WARNING: work/a.out.v:17: $readmempath could not find directory "no_dir2"! +WARNING: work/a.out.v:17: $readmempath could not find directory "vsim"! +PASSED diff --git a/ivtest/gold/pr2509349a-vlog95.gold b/ivtest/gold/pr2509349a-vlog95.gold deleted file mode 100644 index a35abdbd0..000000000 --- a/ivtest/gold/pr2509349a-vlog95.gold +++ /dev/null @@ -1,4 +0,0 @@ -WARNING: vlog95.v:17: $readmempath could not find directory "/no_dir"! -WARNING: vlog95.v:17: $readmempath could not find directory "no_dir2"! -WARNING: vlog95.v:17: $readmempath's path element "vsim" is not a directory! -PASSED diff --git a/ivtest/gold/pr2509349a-vvp-stdout.gold b/ivtest/gold/pr2509349a-vvp-stdout.gold new file mode 100644 index 000000000..a106be50b --- /dev/null +++ b/ivtest/gold/pr2509349a-vvp-stdout.gold @@ -0,0 +1,4 @@ +WARNING: ivltests/pr2509349a.v:11: $readmempath could not find directory "/no_dir"! +WARNING: ivltests/pr2509349a.v:11: $readmempath could not find directory "no_dir2"! +WARNING: ivltests/pr2509349a.v:11: $readmempath could not find directory "vsim"! +PASSED diff --git a/ivtest/gold/pr2509349a.gold b/ivtest/gold/pr2509349a.gold deleted file mode 100644 index decc2f1a1..000000000 --- a/ivtest/gold/pr2509349a.gold +++ /dev/null @@ -1,4 +0,0 @@ -WARNING: ./ivltests/pr2509349a.v:10: $readmempath could not find directory "/no_dir"! -WARNING: ./ivltests/pr2509349a.v:10: $readmempath could not find directory "no_dir2"! -WARNING: ./ivltests/pr2509349a.v:10: $readmempath's path element "vsim" is not a directory! -PASSED diff --git a/ivtest/gold/pr2509349b-vlog95-vvp-stdout.gold b/ivtest/gold/pr2509349b-vlog95-vvp-stdout.gold new file mode 100644 index 000000000..4d9f14feb --- /dev/null +++ b/ivtest/gold/pr2509349b-vlog95-vvp-stdout.gold @@ -0,0 +1,3 @@ +WARNING: work/a.out.v:14: $readmempath's argument (vpiReg) is not a valid string. +WARNING: work/a.out.v:17: $readmempath's argument contains non-printable characters. + "tes\002" diff --git a/ivtest/gold/pr2509349b-vlog95.gold b/ivtest/gold/pr2509349b-vlog95.gold deleted file mode 100644 index 5b8b4c063..000000000 --- a/ivtest/gold/pr2509349b-vlog95.gold +++ /dev/null @@ -1,3 +0,0 @@ -WARNING: vlog95.v:14: $readmempath's argument (vpiReg) is not a valid string. -WARNING: vlog95.v:17: $readmempath's argument contains non-printable characters. - "tes\002" diff --git a/ivtest/gold/pr2509349b-vvp-stdout.gold b/ivtest/gold/pr2509349b-vvp-stdout.gold new file mode 100644 index 000000000..1da0fda16 --- /dev/null +++ b/ivtest/gold/pr2509349b-vvp-stdout.gold @@ -0,0 +1,3 @@ +WARNING: ivltests/pr2509349b.v:5: $readmempath's argument (vpiReg) is not a valid string. +WARNING: ivltests/pr2509349b.v:8: $readmempath's argument contains non-printable characters. + "tes\002" diff --git a/ivtest/gold/pr2509349b.gold b/ivtest/gold/pr2509349b.gold deleted file mode 100644 index bb994b320..000000000 --- a/ivtest/gold/pr2509349b.gold +++ /dev/null @@ -1,3 +0,0 @@ -WARNING: ./ivltests/pr2509349b.v:5: $readmempath's argument (vpiReg) is not a valid string. -WARNING: ./ivltests/pr2509349b.v:8: $readmempath's argument contains non-printable characters. - "tes\002" diff --git a/ivtest/ivltests/pr2509349a.v b/ivtest/ivltests/pr2509349a.v index 27a342070..4c9606529 100644 --- a/ivtest/ivltests/pr2509349a.v +++ b/ivtest/ivltests/pr2509349a.v @@ -7,7 +7,8 @@ module top; pass = 1'b1; // Neither no_dir or no_dir2 should exist and vsim should be a file. - $readmempath("/tmp:/no_dir:no_dir2:vsim:ivltests"); + // The ivltests directory should exist. + $readmempath("/no_dir:no_dir2:vsim:ivltests"); $readmemh("pr2509349.txt", mem); diff --git a/ivtest/regress-ivl1.list b/ivtest/regress-ivl1.list index c4a9ad468..7ba05aba8 100644 --- a/ivtest/regress-ivl1.list +++ b/ivtest/regress-ivl1.list @@ -163,10 +163,6 @@ sv_cast_darray normal,-g2005-sv ivltests br978 normal ivltests br_ml20150424 normal ivltests -# $readmempath -pr2509349a normal ivltests gold=pr2509349a.gold -pr2509349b normal ivltests gold=pr2509349b.gold - # $simparam simparam normal ivltests diff --git a/ivtest/regress-msys2.list b/ivtest/regress-msys2.list deleted file mode 100755 index dd20a4cf2..000000000 --- a/ivtest/regress-msys2.list +++ /dev/null @@ -1,71 +0,0 @@ -# This test list is used to override other test lists when running -# on Windows using MSYS2. - -# -# Copyright (c) 1999-2015 Guy Hutchison (ghutchis@pacbell.net) -# -# This source code is free software; you can redistribute it -# and/or modify it in source code form under the terms of the GNU -# General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -# -# Format of the file -# -# testname testtype directory -# -# The is the verilog file name minus an extension. -# -# The can be one of the following: -# -# normal: Normal results expected, i.e it should compile and execute -# producing at least a single line with PASSED. -# -# CO: Compile Only - Compile the file to the default output type. -# -# CN: Compile Null - Compile with the null target. Similar to CO. -# -# CE: Compile with Errors - We EXPECT errors - we're checking -# illegal syntax -# -# RE: Runtime with Errors - We EXPECT errors - we're checking -# illegal syntax -# -# EF: Expected Fail - We EXPECT this test to fail - only use -# with older versions of Icarus. -# -# TE: Translation Error - We EXPECT the translated code to fail - -# only supported in the vlog95 checker. -# -# NI: Not implemented. Only use for version specific tests. -# -# is where the .v file is located. -# -# An optional fourth and fifth argument can be supplied. -# -# The fourth argument may be one of the following. -# -# modulename - Defines the top level module -# gold=filename - Compare a gold file against the -# generated log file. -# unordered=filename - Compare a gold file against the -# generated log file, allowing for lines -# to appear in any order -# diff=filename1:filename2:skip_ln - Compare the two files for equality. -# Skip the first lines or none. -# -# If a is given you can supply a fifth argument for the -# gold or diff commands. -# - -# Warning about non-existent /tmp directory -pr2509349a normal ivltests gold=pr2509349a-msys2.gold diff --git a/ivtest/regress-vlog95.list b/ivtest/regress-vlog95.list index 199bb2e72..bc1ea261d 100644 --- a/ivtest/regress-vlog95.list +++ b/ivtest/regress-vlog95.list @@ -804,8 +804,6 @@ pic normal contrib gold=pic-vlog95.gold pr910 normal ivltests gold=pr910-vlog95.gold pr1698820 normal ivltests gold=pr1698820-vlog95.gold pr1819452 normal ivltests gold=pr1819452-vlog95.gold -pr2509349a normal ivltests gold=pr2509349a-vlog95.gold -pr2509349b normal ivltests gold=pr2509349b-vlog95.gold # Because the lower module has a parameter it is given a unique name that # does not match what the code is looking for. If we can verify that there # is only a single instance or that the instance has the original or at diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 4649f4c6a..9a8e97fc7 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -120,6 +120,10 @@ pr1864110b vvp_tests/pr1864110b.json pr1864115 vvp_tests/pr1864115.json pr1916261a vvp_tests/pr1916261a.json pr1916261a vvp_tests/pr1916261a.json +pr2509349a vvp_tests/pr2509349a.json +pr2509349a-vlog95 vvp_tests/pr2509349a-vlog95.json +pr2509349b vvp_tests/pr2509349b.json +pr2509349b-vlog95 vvp_tests/pr2509349b-vlog95.json pr2800985b vvp_tests/pr2800985b.json pr3270320_ams vvp_tests/pr3270320_ams.json pr903 vvp_tests/pr903.json diff --git a/ivtest/vvp_reg.pl b/ivtest/vvp_reg.pl index 3828f360e..fb3cfafd8 100755 --- a/ivtest/vvp_reg.pl +++ b/ivtest/vvp_reg.pl @@ -45,9 +45,6 @@ if ($#ARGV != -1) { my $regress_fn = &get_regress_fn; &read_regression_list($regress_fn, $ver, $force_sv, ""); } else { - if ($ENV{MSYSTEM}) { - &read_regression_list("regress-msys2.list", $ver, $force_sv, ""); - } if ($force_sv) { &read_regression_list("regress-fsv.list", $ver, $force_sv, ""); } diff --git a/ivtest/vvp_tests/pr2509349a-vlog95.json b/ivtest/vvp_tests/pr2509349a-vlog95.json new file mode 100644 index 000000000..a69167f12 --- /dev/null +++ b/ivtest/vvp_tests/pr2509349a-vlog95.json @@ -0,0 +1,5 @@ +{ + "type" : "normal-vlog95", + "source" : "pr2509349a.v", + "gold" : "pr2509349a-vlog95" +} diff --git a/ivtest/vvp_tests/pr2509349a.json b/ivtest/vvp_tests/pr2509349a.json new file mode 100644 index 000000000..892462b1b --- /dev/null +++ b/ivtest/vvp_tests/pr2509349a.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "pr2509349a.v", + "gold" : "pr2509349a" +} diff --git a/ivtest/vvp_tests/pr2509349b-vlog95.json b/ivtest/vvp_tests/pr2509349b-vlog95.json new file mode 100644 index 000000000..cc18643da --- /dev/null +++ b/ivtest/vvp_tests/pr2509349b-vlog95.json @@ -0,0 +1,5 @@ +{ + "type" : "normal-vlog95", + "source" : "pr2509349b.v", + "gold" : "pr2509349b-vlog95" +} diff --git a/ivtest/vvp_tests/pr2509349b.json b/ivtest/vvp_tests/pr2509349b.json new file mode 100644 index 000000000..97e175613 --- /dev/null +++ b/ivtest/vvp_tests/pr2509349b.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "pr2509349b.v", + "gold" : "pr2509349b" +}