Commit Graph

443 Commits

Author SHA1 Message Date
Martin Whitaker 18720fe060 Enable the sv_literals test, now that it is fixed (issue #1082) 2024-01-28 12:23:45 +00:00
Martin Whitaker 8ee1d56e1a Enable the sv_parameter_type test, now it is fixed (issue #1083) 2024-01-27 16:23:40 +00:00
Martin Whitaker fbb2d91927 Add regression tests for issue #1074. 2024-01-27 16:17:31 +00:00
Stephen Williams 71b9c551df Move tests pr2509349a/b to the new test format.
This removes the regress-msys2.list file, fixes the output from the
pr2509349a.v test to not be different on different systems, and
documents the $readmempath task.
2024-01-21 15:49:09 -08:00
Stephen Williams ed7cac914c
Merge pull request #1077 from steveicarus/steveicarus/remove-sv-regress
Remove the sv_regress.list file
2024-01-21 13:37:59 -08:00
Stephen Williams 5e97884ccd Remove the sv_regress.list file
This file contained some SystemVerilog tests that are not yet supported.
Move the tests to the regress-vvp.list format, and mark them as NI so
that we know what's going on.
2024-01-20 18:51:43 -08:00
Cary R 33edcda800 Ignore new ivtest output files in git 2024-01-20 17:44:59 -08:00
Cary R d42f97ecbe Cleanup space issues 2024-01-20 11:26:06 -08:00
Lars-Peter Clausen 2d611c4347 ivtest: pr1002: Avoid race condition
The pr1002 test has a always block with the `dataout` in its sensitivity
list. It compares `dataout` to `expected_dataout`.

Both `dataout` and `expected_dataout` depend on `datain` and are updated in
the same cycle. This means there is no guarantee in which order they are
updated and the always block might get scheduled before `expected_dataout`
has been updated. This can lead to a test failure.

To avoid this slightly change the test to use a task to perform the
comparison and add an explicit delay before the task is executed so that
all updates have a chance to be fully resolved

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-01-20 10:32:55 -08:00
Lars-Peter Clausen 9b1ac6ab50 ivtest: Fix `assign` vs `initial` race condition in some tests
The first evaluation of an `assign` statement is scheduled at the same time as
`initial` statements.

There are some test cases that evaluate the result of an `assign` statement
in an `initial` statement. This is an inherent race condition and might
fail depending on the exact order of evaluation.

To fix this add an additional delay in the `initial` block. This will make
sure that all `assign` statements get fully resolved first.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-01-20 10:32:02 -08:00
Stephen Williams 192b6aec96
Merge pull request #1070 from larsclausen/ivl_run-escape-char
run_ivl.py: Properly escape `.` in regex
2024-01-19 18:25:46 -08:00
Stephen Williams 8f1fcc988e
Merge pull request #1065 from steveicarus/vvp-undriven-net-initialisation
vvp undriven net initialisation
2024-01-19 18:13:55 -08:00
Lars-Peter Clausen c93e8334a2 run_ivl.py: Properly escape `.` in regex
To escape the `.` in the regex it needs to be prefixed with a `\`. But
since the `\` is a escape character in python strings it needs to be
escaped as well.

Without this some versions of python print the following warning:

      run_ivl.py:36: SyntaxWarning: invalid escape sequence '\.'
        match= re.search(b'Icarus Verilog version ([0-9]+)\.([0-9]+)', text)

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-01-14 17:33:23 -08:00
gatk555 fc9fcb0bf8 Regression test for vvp scheduler fix.
This is for the latent bug exposed when testing the original fix for
issue #1041. Contributed by gatk555 in PR #1065.
2024-01-14 22:23:15 +00:00
Lars-Peter Clausen 26d5cca784 ivtest: Remove outdated pr1963962 SystemVerilog mode gold file
Starting with commit 96df251c95 ("Suppress unnecessary VCD/LXT/LXT2
warnings about packages.") there is no longer a warning printed that the
unit scope can't be printed if it is empty.

Remove the special SystemVerilog mode gold file for the pr1963962 test that
expects this warning.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-01-13 19:07:44 -08:00
Martin Whitaker 7b99cd25ca Add regression tests for suppressed VCD/LXT/LXT2 warnings (issue #710) 2024-01-07 20:34:45 +00:00
Martin Whitaker fa2dfe690c Add regression test for synthesisable for loop check (issue #687) 2024-01-07 13:23:36 +00:00
Martin Whitaker a9eed015c3 Add regression test for undriven net initialisation (issue #1041). 2024-01-07 09:34:50 +00:00
Cary R 7c25e8506c
Merge pull request #1060 from larsclausen/ident-test-width
Correctly calculate width of nested path identifiers
2024-01-01 12:26:51 -08:00
Cary R 1712b2e8e8
Merge pull request #1059 from larsclausen/invalid-partsel
Detect reversed part select on inner dimensions
2024-01-01 12:25:07 -08:00
Cary R 724a88f523
Update array_slice_concat.v
Add delay to avoid race in TB code and DUT code
2024-01-01 11:01:19 -08:00
Lars-Peter Clausen 9a563e9bab Add regression test for nested struct width
Check that expression width is correctly calculated for nested structs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-12-30 18:30:24 -08:00
Johan Euphrosine 0a53b52ed0 ivtest/regress-vvp: add array_slice_concat 2023-12-30 10:57:24 +09:00
Johan Euphrosine 2e00a7d482 ivtests/array_slice_contact: add test manifest 2023-12-30 10:57:24 +09:00
Johan Euphrosine 0b22810a25 ivtests/array_slice_contact: add tb 2023-12-30 10:57:24 +09:00
Johan Euphrosine fbbff9646d ivtest: add array_slice_concat 2023-12-30 10:57:24 +09:00
Lars-Peter Clausen 57f8084d0c Add regression tests for reversed part select indices
Check that reversed part selects result in an error. Check this for both
right-hand and left-hand side expressions as well as for inner and outer
dimensions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-12-29 16:34:46 -08:00
Cary R b4b8006460 vpiFullname of a package should have a "::" after the name 2023-12-28 18:53:11 -08:00
Cary R 4251ea9553 Remove old V0.8 code in VPI tests 2023-12-28 16:02:47 -08:00
Cary R cc829031ff Elaborate system elab tasks in gen blocks 2023-12-28 15:07:37 -08:00
Lars-Peter Clausen 7fb1cabdbb
Merge pull request #1055 from larsclausen/invalid-index-base
Handle invalid vector slice base expressions
2023-12-28 13:38:28 -08:00
Cary R b14c4ca26c add suport for the shortreal conversion functions 2023-12-28 13:30:27 -08:00
Lars-Peter Clausen 8f006a22b4 Add regression tests for invalid part select base expressions
Check that a invalid part select base expression results in a compile
error.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-12-28 13:21:37 -08:00
Stephen Williams bc119f96a9
Merge pull request #1054 from larsclausen/fix-run_ivl_py
Fix run_ivl.py
2023-12-28 13:17:08 -08:00
Cary R 91b1759602 More test version cleanup 2023-12-28 12:14:44 -08:00
Cary R 57524836f1 Fix space issues 2023-12-28 11:21:09 -08:00
Lars-Peter Clausen 5be80046a9 Fix run_ivl.py
Commit 56c5bf1da1 ("ivtest: Remove regress v11, v12, and v13") removed the
`expected_fail` argument from the `check_run_outputs()` function, but did
not remove all references. This causes the run_ivl.py script to fail. The
script is part of the CI pipeline and causes all PRs to fail.

Remove the remaining references to `expected_fail` to make it work again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-12-27 09:31:46 -08:00
Stephen Williams 56c5bf1da1 ivtest: Remove regress v11, v12, and v13
These tests lists are no longer needed.
2023-12-17 20:13:00 -08:00
Stephen Williams c6df820ff9
Merge pull request #1043 from steveicarus/steveicarus/remove-regress-vams
vams: Remove the regress-vams test
2023-12-10 20:40:34 -08:00
Stephen Williams 3c65f5d750 vams: Remove the regress-vams test
Use the more sophisticated python based tests to run these tests, and
remove the verilog-vams list.
2023-12-10 20:06:46 -08:00
Stephen Williams 0be07afab3 ivtest: Remove the regress-v10 test list
This list is not needed with the new scheme. This means that some gold
files that are v10 specific are removed, as well as the list itself.
2023-12-10 19:05:12 -08:00
Cary R 987b7d1dc0 fread() support integral variables not just registers 2023-12-09 14:30:25 -08:00
Cary R 5d561f3ef1 Fix time issue in FreeBSD (pow() bug) 2023-12-09 12:51:13 -08:00
Stephen Williams 58dcf39db3
Merge pull request #1017 from steveicarus/steveicarus/ivtest-test-conversion-20231029
ivtest: reformat some regression tests
2023-11-25 17:43:12 -08:00
Stephen Williams bed166915f ivtest: reformat some regression tests
This empties out the revress-ivl2.list

This includes the tests:
* always4A
* always4B
* br_gh383a
* br_gh383b
* br_gh383c
* br_gh383d
* ca_time_real
* delayed_sfunc
* localparam_type
* parameter_type
* pr1701890
* pr1864110a
* pr1864110b
2023-11-17 15:00:25 -08:00
Sylvain Munaut 483de9a75b ivtest: Add test for partselect on enum inside pack struct
See issue #1033

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2023-11-16 09:26:04 +01:00
Sylvain Munaut d564cecfb9 ivtest: Add test for $left / $right on structure field
See issue #1032

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2023-11-16 09:26:01 +01:00
Marlon James 22b68ad24d ivtest/vpi/br_gh317: Update test for missing case of toplevel module with escaped identifier containing '.' 2023-11-06 15:48:07 -08:00
Lars-Peter Clausen b7ef0b5d88 Add regression test for continuous assignment to 2-state arrays
Check that continuous assignments to both signed and unsigned 2-state
arrays are supported.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-10-15 10:07:24 -07:00
Lars-Peter Clausen 3e58507e87 Enable regression tests for out-of-bounds on 2-state queues and dynamic arrays
Now that out-of-bounds access on 2-state queues and dynamic arrays yields
the right value move the tests from the "Not Implemented" list to the list
of tests that get run.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-10-01 09:09:31 -07:00
Lars-Peter Clausen 560800489d tests: sv_queue_vec: Change base type to 4-state
The sv_queue_vec test uses queues of 2-state vectors, but also checks if
certain operations on the queue yield 'X.

2-state queues should never yield 'X and the test only passes because of a
bug. In preparation for fixing the bug change the test to use a 4-state
base type instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-10-01 09:09:31 -07:00
Lars-Peter Clausen 6e81891de0 Add regression test for 2-state array initial value propagation
Check that the initial value that gets propagated for 2-state arrays is '0.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-09-23 06:19:09 -07:00
Cary R f50cc35d2f Fix space issues 2023-09-04 14:15:11 -07:00
Cary R 7ce068fbdb
Merge pull request #994 from mole99/sdf-interconnect-vector
SDF: Interconnection delays for input/output vectors
2023-09-04 07:02:28 -07:00
Cary R b497d362a7 Cleanup space issues 2023-09-04 00:21:23 -07:00
mole99 023c5f2754 Add testcase with input and output vectors 2023-09-04 09:20:19 +02:00
Cary R 7e62a1b848 Update the gold file for br1005 2023-09-03 21:46:15 -07:00
Cary R b12977d61a A macro can only have `" and add `\`" for pragma comments
We want to support `" and `\`" when a pragma comment is part of a macro
definition, but this cannot be part of a normal pragma comment.
2023-09-03 21:34:31 -07:00
Cary R d938654c36
Merge pull request #993 from ithinuel/escape-in-attribute
add double quote escapes from pragma comments.
2023-09-03 21:14:10 -07:00
Cary R e92caa05db br_gh979 cannot be converted to vlog95 2023-09-03 18:54:18 -07:00
Cary R f229dfcb2b Fix the trigger for user functions with no args 2023-09-03 18:41:38 -07:00
Cary R 64cfd681af
Merge pull request #980 from sifferman/argumentless-functions-fix
Argumentless functions fix
2023-09-03 17:31:10 -07:00
mole99 665295ba00 Also enable -gspecify for interconnect tests 2023-08-30 15:13:18 +02:00
Wilfried Chauveau 873c2fecd4
add double quote escapes from pragma comments. 2023-08-29 22:37:14 +01:00
mole99 306e4cfa6b Add three tests to exercise interconnection delays in designs 2023-08-23 12:56:11 +02:00
mole99 7beadb92f8 Framework of the INTERCONNECT implementation 2023-08-23 12:56:10 +02:00
Cary R 2d41a43ae1 Spelling fixes 2023-08-22 20:41:17 -07:00
Lars-Peter Clausen 250c456f94 Add regression tests for binding task/function arguments by name
Check that binding task and function arguments by name works as expected.
Also check that is works for the various variations of invoking a class
constructor.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-08-20 08:20:54 -07:00
Lars-Peter Clausen 8ca8ad3c81 Add regression tests for chained constructors
Check that constructor chaining for various corner cases of mixing implicit
and explicit constructors are handled correctly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-08-06 02:10:28 -07:00
Cary R 0651e0be17
Merge pull request #982 from larsclausen/const-var-fix
Make sure `const var` variables are constant
2023-08-05 18:27:34 -07:00
Ethan Sifferman 470a3da703 removed wire and assign from test 2023-07-30 22:44:19 -07:00
Lars-Peter Clausen bdfd873dc4 Add regression test for `const var`
Check that variables declared with `const var` can not be modified.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-07-29 12:26:35 -07:00
Lars-Peter Clausen 6928b38720 Add regression tests for automatic 2-state variable default value
Check that automatic 2-state variables get initialized to 0.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-07-29 06:33:46 -07:00
Ethan Sifferman de2f506644 improved test 2023-07-29 00:21:31 -07:00
Ethan Sifferman 44badf50de added test 2023-07-28 23:51:02 -07:00
Lars-Peter Clausen f092820599 Add regression tests for const variables
Check that const variables are supported and they can not be overridden by
type of assignment.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-07-23 15:14:04 -07:00
Cary R 3aafa1333b Update $ferror() and $fgets() to support SV strings 2023-07-19 00:30:50 -07:00
Cary R ceb07dc9db
Merge pull request #966 from mole99/delayed-signals
Handle delayed signals in timing checks as assignments
2023-07-14 06:33:37 -07:00
mole99 7f5b8d49eb Fix timing_check_syntax 2023-07-10 16:12:27 +02:00
mole99 d46628b2f2 Improve parsing of timing checks 2023-07-10 15:59:14 +02:00
Cary R fdb9465329 Indexed part selects cannot use real values 2023-07-09 12:25:34 -07:00
Cary R 095e6daa0a Cannot use posedge, negedge or edge with a real expression 2023-07-09 05:02:01 -07:00
Cary R 2249d224de Bit/part selects cannot have real index expressions 2023-07-09 03:47:41 -07:00
mole99 7aabcc113e Add test for delayed signals in timing checks 2023-07-05 16:24:04 +02:00
mole99 21b73eb187 Add test for parsing timing checks 2023-07-05 16:23:15 +02:00
Lars-Peter Clausen c5f98fb671 Add regression tests for partial ANSI port declarations
Check that it is possible to declare module ports with only partial
attributes. Other attributes should be inherited from the previous port in
the list or use the default.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-30 06:09:45 -07:00
Lars-Peter Clausen 708f7bc651 Add regression test for $bits() on array identifiers
Check that for array identifiers $bits() includes the total size of the
signal.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-27 05:29:47 -07:00
Cary R a3f1aded7c
Merge pull request #961 from larsclausen/fix-bitsel-sign
Fix bit select on signed multi-dimensional packed array
2023-06-26 07:57:03 -07:00
Lars-Peter Clausen 2a17b06fc4 Add regression test for bit select on multi-dimensional signed packed array
Check that element and bit select on multi-dimensional signed packed arrays
are unsigned.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-26 06:27:52 -07:00
Cary R 017a68c193 Update SDF warnings to include SDF file/line information 2023-06-25 20:12:43 -07:00
Lars-Peter Clausen 79fc09717e Add regression test for module array port initializers
Check that initializers are supported for module array ports.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-19 08:08:41 -07:00
Lars-Peter Clausen 1ee189630b Fix module_output_port_list_def test
The module_output_port_list_def declares a output port with an implicit
data type and assigns an initial value to it. Since output ports with an
implicit data type are nets this test is not standard compliant.

This only works because at the moment the parser incorrectly flags all
output ports with an initial value as variables rather than following the
method defined by the standard to decide whether the port should be a net
or variable.

Make the test standard compliant by using an explicit data type for the
output port, in which case it will be a variable.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-19 05:25:02 -07:00
Lars-Peter Clausen 6991b2d84f Add regression tests for assigning scalar value to array
Check that trying to assign a scalar value to an array results in an error.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-17 12:03:20 -07:00
Lars-Peter Clausen 90a1168086 Add regression tests for unpacked array assignment patterns
Check that basic assignment patterns are supported for unpacked arrays.
Check that all of packed types, reals and string arrays are supported.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-17 12:03:20 -07:00
mole99 340e6fa020 Update gold file 2023-06-15 10:06:03 +02:00
Cary R 560fbeeae4
Merge pull request #936 from larsclausen/trailing-module-port
Allow to omit trailing module ports in ordered list connection
2023-06-14 07:35:39 -07:00
Lars-Peter Clausen 9357a62dce Add regression test for implicit named port connection errors
Check that the file and line location is correct for errors
related to implicit named port connections.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-14 04:33:41 -07:00
Lars-Peter Clausen cc74c7f332 vvp_reg.py: Add support for gold files for CE tests
Some tests require a specific compiler error, rather than just failing. Add
support for this by allowing to check for gold files for CE tests.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-14 04:33:41 -07:00
Lars-Peter Clausen ee4476fed2 parser: Require SystemVerilog for implicit named port connections
Implicit named port connections are only supported by SystemVerilog. Add a
check to generate an error when trying to use it in Verilog mode.

Regression test br_gh315 is modified to run in SystemVerilog mode since it
makes use of implicit named port connections.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-06-14 04:33:10 -07:00
Cary R 75cd1a19f0
Merge pull request #938 from larsclausen/unit-scope-possible-imports
Handle implicit task/function imports in the unit scope
2023-06-11 10:07:29 -07:00