Skip to content

Commit

Permalink
Merge pull request #1085 from steveicarus/steveicarus/readmempath-tests
Browse files Browse the repository at this point in the history
Move tests pr2509349a/b to the new test format.
  • Loading branch information
steveicarus authored Jan 22, 2024
2 parents ed7cac9 + 71b9c55 commit 0db1a0c
Show file tree
Hide file tree
Showing 21 changed files with 88 additions and 100 deletions.
47 changes: 47 additions & 0 deletions Documentation/usage/icarus_verilog_quirks.rst
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions Documentation/usage/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ Icarus Verilog.
vhdlpp_flags
gtkwave
vpi
icarus_verilog_quirks
reporting_issues
5 changes: 0 additions & 5 deletions ivtest/gold/pr2509349a-msys2.gold

This file was deleted.

4 changes: 4 additions & 0 deletions ivtest/gold/pr2509349a-vlog95-vvp-stdout.gold
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions ivtest/gold/pr2509349a-vlog95.gold

This file was deleted.

4 changes: 4 additions & 0 deletions ivtest/gold/pr2509349a-vvp-stdout.gold
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions ivtest/gold/pr2509349a.gold

This file was deleted.

3 changes: 3 additions & 0 deletions ivtest/gold/pr2509349b-vlog95-vvp-stdout.gold
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 0 additions & 3 deletions ivtest/gold/pr2509349b-vlog95.gold

This file was deleted.

3 changes: 3 additions & 0 deletions ivtest/gold/pr2509349b-vvp-stdout.gold
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 0 additions & 3 deletions ivtest/gold/pr2509349b.gold

This file was deleted.

3 changes: 2 additions & 1 deletion ivtest/ivltests/pr2509349a.v
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 0 additions & 4 deletions ivtest/regress-ivl1.list
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
71 changes: 0 additions & 71 deletions ivtest/regress-msys2.list

This file was deleted.

2 changes: 0 additions & 2 deletions ivtest/regress-vlog95.list
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ivtest/regress-vvp.list
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions ivtest/vvp_reg.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
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, "");
}
Expand Down
5 changes: 5 additions & 0 deletions ivtest/vvp_tests/pr2509349a-vlog95.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type" : "normal-vlog95",
"source" : "pr2509349a.v",
"gold" : "pr2509349a-vlog95"
}
5 changes: 5 additions & 0 deletions ivtest/vvp_tests/pr2509349a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "pr2509349a.v",
"gold" : "pr2509349a"
}
5 changes: 5 additions & 0 deletions ivtest/vvp_tests/pr2509349b-vlog95.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type" : "normal-vlog95",
"source" : "pr2509349b.v",
"gold" : "pr2509349b-vlog95"
}
5 changes: 5 additions & 0 deletions ivtest/vvp_tests/pr2509349b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "pr2509349b.v",
"gold" : "pr2509349b"
}

0 comments on commit 0db1a0c

Please sign in to comment.