Commit Graph

10116 Commits

Author SHA1 Message Date
Cary R 788a94b310 Nested generate regions are illegal 2024-12-28 18:46:37 -08:00
Cary R d484cb63d6 Avoid seg fault when the range for a module/gate is empty 2024-12-28 17:16:16 -08:00
Cary R 47cf3707fc Fix some warnings from msys2 build 2024-12-28 10:09:01 -08:00
Cary R. abaa32f793
Merge pull request #1192 from larsclausen/fix-macos-ci
Use `-undefined dynamic_lookup` for linking loadable modules on MacOS
2024-12-27 10:42:36 -08:00
Lars-Peter Clausen 342ba62618 Use `-undefined dynamic_lookup` for linking loadable modules on MacOS
Newer version of the linker on MacOS provide a deprecation warning when
using the `-undefined` flag with the `suppress` value. This is cause CI to
fail to do logs not matching when building VPI modules.

Switch to using the `dynamic_lookup` value for the flag instead, which
resolves the warning and is the behavior we want when loading the module.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-12-26 18:08:24 -08:00
Cary R. 06077ed026
Update test.yml to switch back to macos-13 2024-12-09 08:48:26 -08:00
Cary R. 0914af4c6a
Update test.yml to try macos-14 large 2024-12-09 08:46:58 -08:00
Cary R. 0a671ea459
Update test.yml to use macos-13 2024-12-09 08:31:15 -08:00
Cary R 8edf14ae68 Check for primitive port mismatches and other error cleanup 2024-12-08 22:21:51 -08:00
Cary R b745119746 Update Makefile.in to install PDF correctly 2024-11-27 02:00:41 -08:00
Cary R 361e16bed2 Fix some valgrind compile warnings 2024-11-27 00:11:50 -08:00
Cary R a676078ffc Update config.guess and config.sub 2024-11-26 23:46:58 -08:00
Cary R 527b0daed6 Fix some clang warnings 2024-11-26 23:33:52 -08:00
Martin Whitaker 62727e8b2e Add regression tests for packed/unpacked array parameter declarations.
These are currently unsupported, so should result in a compiler error.
2024-11-15 21:10:51 +00:00
Martin Whitaker b2eaedfc94 Emit "sorry" message for unpacked array parameter declarations (issue #1180)
These aren't yet supported. Make it an error if not compiling fpr a
SystemVerilog generation.
2024-11-15 21:01:12 +00:00
Martin Whitaker aec18a6c19 Emit "sorry" message for packed array parameter declarations (issue #1180)
These aren't yet supported. Make it an error if not compiling fpr a
SystemVerilog generation.
2024-11-15 20:24:58 +00:00
Martin Whitaker 6c8ed62a5a Add regression test for issue #1181. 2024-11-10 19:34:36 +00:00
Martin Whitaker 2817bf59c5 tgt-vlog95: fix mixed-scope multiple constant assignments to a net (issue #1181)
The vlog95 code generator collects all the constant assignments to a net
within each scope and then emits them. The old code only recorded the
ivl_signal_t for each constant assignment, which meant it had to iterate
through the nexus pointers in the assicated nexus to find the constant.
When there were multiple constant assignments to the same net, it needed
to record which assignments had already been emitted, which it did by
keeping a count in the nexus private data and skipping that many constants
on each successive assignment. However the count did not get reset after
emitting all the assignments in that scope, so if there were assignments
to the same net made in another scope, the count would already be positive
and those assignments would also be skipped.

This could probably have been fixed by clearing the nexus private data
after processing the constant assignment list for each scope, but it is
more efficient to record the ivl_nexus_ptr_t for each constant along with
the ivl_signal_t, eliminating the need to search for the associated nexus
pointer.
2024-11-10 13:31:54 +00:00
Cary R 96d28250bd br_gh1178b uses inout which cannot be translated currently 2024-11-09 17:43:32 -08:00
Cary R 7a4e17661a Fix gold file for br_gh1178a (repeat concatenation) 2024-11-09 17:22:40 -08:00
Cary R 00fcd58fab A repeat concatenation cannot be used as a net l-value 2024-11-09 17:21:44 -08:00
Cary R 5e7e7622b4 Update to latest files from GTKWave 2024-11-09 14:07:06 -08:00
martinwhitaker ce7b26e3f9
Merge pull request #1106 from daglem/part-select-address-overflow
Guard against overflow / wrap around of internal bit address
2024-11-03 12:03:07 +00:00
Lars-Peter Clausen d8c3c51ab1
Merge pull request #1176 from HD787/hd787/typo-fixes
Some typo fixes in the developer docs,
2024-10-09 19:13:58 -07:00
henry 01d28ea277 typo fixes 2024-10-07 23:20:12 -05:00
Dag Lem ba7da9d5a5 Guard against overflow / wrap around of internal part-select bit address
Internally, the maximum address space of a vector is 31 bits + a sign bit
to signal invalid addresses (out of bounds or has one or more x or z bits).

This commit ensures that unsigned part-select bit addresses which would
otherwise overflow and wrap around within this address space are correctly
handled as out of bounds.
2024-09-16 23:50:24 +02:00
Dag Lem ff47e6bfbe Correct normalization of base address for bit- and part-selects
The required bit width for the address calculation should now be
exactly determined in all cases.

The normalization is also considerably simplified.
2024-09-16 23:05:43 +02:00
Martin Whitaker 25a84d5cfc Update vlog95 test list for tests containing incomplete for loops.
The for loop initialisation statement, termination condition, and step
statement were only made optional in IEEE 1800-2012. Commit 0695c1fe
enforced this. So we need to compile with -g2012. The vlog95 code
generator doesn't currently translate this, so the tests will fail
when compiling the translated code.
2024-09-07 18:08:44 +01:00
Martin Whitaker 2ab57a2b09 Add regression test for return type of $bits (issue #1163). 2024-09-07 17:56:15 +01:00
Martin Whitaker 0136db7ee7 Fix the return type of the $bits system function (issue #1163)
Early editions of the SystemVerilog standard did not specify the return
type for $bits, so we made it 32 bit unsigned 2-state. Later editions
state the return type is integer (32 bit signed 4-state), so make it so.
2024-09-07 17:52:28 +01:00
martinwhitaker 34ed6f6f97
Merge pull request #1168 from steveicarus/fix-vvp-cg-array-word-aliasing
Fix vvp cg array word aliasing
2024-09-07 17:04:57 +01:00
martinwhitaker 74ba42e2df
Merge pull request #1166 from larsclausen/fix-ix-load-sign
tgt-vvp: Use signedness of expression instead of signal for index load
2024-09-07 17:04:40 +01:00
martinwhitaker 07d5c6fb0c
Merge pull request #1164 from larsclausen/fix-undefined-delay
Fix vector assignment with undefined delay
2024-09-07 17:04:16 +01:00
Martin Whitaker ae78218c2f Add regression test for issue #1155. 2024-09-03 21:38:09 +01:00
Martin Whitaker d6abe59983 Improve annotation in vvp code generation. 2024-09-03 21:34:46 +01:00
Martin Whitaker f8947a6aab Fix indentation and white space. 2024-09-03 21:34:12 +01:00
Martin Whitaker d99add9dbe Fix vvp code generator for array word alias corner case (issue #1155)
When multiple words in one array were connected to the same nexus as a
single word array, the code generator was sometimes failing to generate
all the necessary aliases. This was highly dependent on the elaboration
order.

This fix should be more robust, but there are currently no tests in the
test suite that cause the compiler to generate whole-array aliases, and
I can't think of a way to make it do so as we don't yet support unpacked
arrays in module ports, so that branch of the code is currently untested.
2024-09-03 21:24:25 +01:00
Lars-Peter Clausen 841e5a9d9e ivtest: Add regression test to check that shift rhs is always unsigned
Add a regression test to check that the right-hand side of a shift
operation is always treated as unsigned, even if it is a signed registers
or a variation thereof.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-09-02 19:09:06 +02:00
Lars-Peter Clausen 50d9a32d56 tgt-vvp: Use signedness of expression instead of signal for index load
When loading a signal into into an index register currently the signedness
of the signal is used when deciding whether sign-extension should be
performed or not. But this can lead to incorrect results, instead the
signedness of the expression must be used as that might be different from
the signal. E.g.

```
reg signed [1:0] = 2'b10;
$display(1 << x[1:0]);
```

gives the wrong result without this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-09-02 19:09:06 +02:00
Lars-Peter Clausen fa83f42cba ivtest: Add regression test for undefined intra-assignment delay
Check that assignments with undefined intra-assignment delay get executed
with zero delay. The assignment should not be skipped.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-09-02 14:11:29 +02:00
Lars-Peter Clausen 80fd301fc1 tgt-vvp: Fix vector assignment with undefined delay
Assignments with an undefined intra-assignment delay should be treated like
assignments with zero delay. For the most part this is implemented
correctly, except for assignments to a part of a vector where the offset
inside the vector is an immediate value. E.g.
```
reg [1:0] x;
integer d = 'x;
...
x[0] <= #d 1'b1
```

Here when loading the delay into the index register flag 4 is updated, but
never cleared afterwards. As a result, if the delay is undefined, the vector
assignment will be skipped. Fix this by making sure flag 4 is always
cleared before the vector assignment instruction.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-09-02 14:10:25 +02:00
Cary R. cbdaa865a1
Merge pull request #1162 from larsclausen/vvp-immediate
tgt-vvp: Replace `%pushi ...; %op` with `%opi`
2024-08-31 16:50:44 -07:00
Lars-Peter Clausen de9d5e98b1 tgt-vvp: Replace `%pushi ...; %op` with `%opi`
For sequences where the tgt-vvp backend generates `%pushi` followed by one
of the operations that have an immediate version replace it with the
immediate version. This is slightly more efficient.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-08-31 13:46:30 +02:00
Cary R 8c56b2d116 libbz2-dev is needed for Ubuntu 24.04 2024-08-16 22:27:27 -07:00
Cary R 99160f65b8 Add Ubuntu 24.04 to the test list 2024-08-16 22:10:49 -07:00
Cary R 6f743cd8db Only add -D__USE_MINGW_ANSI_STDIO=1 for MINGW64/32 2024-08-16 18:37:23 -07:00
Cary R cba2417db5 Update the test files to return the number of failures 2024-08-16 18:20:13 -07:00
Cary R ff9a520742 Updateing to latest files from GTKWave 2024-08-16 17:40:33 -07:00
Cary R 676b36e455 Fix space issues in the source code 2024-07-21 11:19:41 -07:00
Martin Whitaker 548010e36b Fix compiler generation option for br_gh801 tests.
These test null for-loop initialisation and step, so need -g2012.
2024-07-13 11:46:08 +01:00