Commit Graph

735 Commits

Author SHA1 Message Date
Martin Whitaker 689a1c27a8 Fix expansion of unbased unsized literal in port assignment (issue #756)
(cherry picked from commit 310e239637)
2022-08-27 16:22:39 +01:00
Martin Whitaker 12d67bb9ae Support SV [size] dimension for module and gate instances (issue #553).
Also output a proper error message if multiple dimensions are supplied
instead of failing an assertion.

(cherry picked from commit dcc9b59f6d)
2021-11-06 08:44:13 +00:00
Martin Whitaker 52b099feae Remove "using namespace std" from compiler header files and fix the fallout.
(cherry picked from commit ecbbb60fb6)
2021-11-04 19:22:43 +00:00
Martin Whitaker 19dc81a242 Fix detection of directly nested generate constructs.
If a generate construct is enclosed in a begin-end pair, it can't
be directly nested (1364-2005 section 12.4.2).

(cherry picked from commit c34167b2c0)
2021-08-04 15:40:20 +01:00
Martin Whitaker b48cdff89e Fix segfault in wildcard port connection with unnamed port (issue #530).
A module port list may contain unnamed entries, e.g.

  module dut(a,);

When performing a wildcard connection, these entries should be skipped,
as there is no name to match.

(cherry picked from commit 061121203b)
2021-07-30 22:51:52 +01:00
Cary R b613cf4bf5 Update warning to match devel 2021-01-30 14:29:09 -08:00
Martin Whitaker b58ca95909 Elaborate package scopes in textual order (fix for issue #461)
When elaborating a subclass, the base class scope needs to be elaborated
before the subclass scope. If the base class and subclass are defined in
different packages, this requires the package scopes to be elaborated in
the correct order. SystemVerilog reqires packages to be defined before
they are used, so that is the order we should elaborate them in.

(cherry picked from commit ba25b55f53)
2021-01-03 19:50:49 +00:00
Cary R b4d8108409 Check if no argument task calls are allowed in the current context 2020-12-27 12:52:33 -08:00
Martin Whitaker c8aa7bf873 Fix search for class imported from another package (issue #437).
(cherry picked from commit a019994513)
2020-12-23 19:17:59 +00:00
Cary R 864c09d034 Add support for calling queue/darray functions as tasks 2020-12-20 16:50:44 -08:00
Martin Whitaker 04b0a1f80d Add extra debug output.
(cherry picked from commit fbd87b4fee)
2020-12-13 22:59:01 +00:00
Martin Whitaker 1fda3ff23e Fix assertion failure when elaborating a void function call (issue #318)
Depending on the order of elaboration, a function may not have been
elaborated before a call to it is elaborated, so don't assert that it
has been. As an optimisation, try to elaborate it on the fly, so we can
elide the call if the function body is empty.

(cherry picked from commit 393236a9a8)
2020-12-13 22:58:48 +00:00
Martin Whitaker bfac44a630 Fix assertion failure for function body with single null statement (GH issue #411)
(cherry picked from commit 94b503fc64)
2020-12-10 17:42:10 +00:00
Martin Whitaker 20c6d83ae9 Support calls to inherited methods without "this." prefix (GitHub issue #388).
(cherry picked from commit 55e06db693)
2020-11-23 22:06:47 +00:00
Martin Whitaker 103f1fa4bb Add enumeration assignment compatibility check for continuous assignments.
(cherry picked from commit 1b3f0dd689)
2020-11-20 17:38:10 +00:00
Cary R a2ba8a16b1 Add support for inserting into a queue 2020-07-29 23:00:19 -07:00
Cary R 6ecd43d947 Add/update queue compile time error messages 2020-07-25 16:33:30 -07:00
Cary R 1a4345cce9 Add the ability to delete an element of a queue 2020-07-25 00:49:42 -07:00
Purdea Andrei 8889886efd Add assert to protect against potentially dereferencing null pointer.
Assert is apropriate, since it's not expected that the returned value is NULL in this case.
2020-07-11 03:54:29 +03:00
Martin Whitaker b36bca1f1b Add support for return statements in void functions. 2020-07-10 23:34:11 +01:00
Purdea Andrei 01ee6bd5b4 Fix how explicitly unconnected ports are handled in the presence of .*
See this PR: https://github.com/steveicarus/ivtest/pull/15
Which adds test implicit-port7
2020-05-18 22:49:05 +03:00
Martin Whitaker e19109e58f Fix GitHub issue #316 - isolate modpath delays from multi-driven nets.
When module ports are collapsed, we can't tell which of the nexus drivers
are associated with a given module port and should be routed through an
associated modpath delay. Work round this by inserting a transparent
buffer or tran_vp if an output or inout port has a modpath delay. The
target code generator can elide this once it has handled the modpath
delays.
2020-05-07 22:51:38 +01:00
Martin Whitaker 8da7a14800 Fix elaboration and evaluation of SV queue push arguments.
These are assignments to a queue element, so need to consider the
element base type when determining the expression width.
2020-05-01 15:30:44 +01:00
Martin Whitaker 3f49dfcd97 Fix translation of module path connection type in vlog95 target.
The target API needed to be changed to pass the connection type
through to the target code generator.
2020-04-02 12:40:59 +01:00
Martin Whitaker a8f71d3c92 Additional cleanup of void function elaboration. 2019-11-09 20:15:31 +00:00
Stephen Williams 7feb26ff6b Cleaner elaboration of void functions.
This fixed githun issue # 281.
2019-11-07 14:25:51 -08:00
Martin Whitaker de54a58991 Fix issue #265 - emit a sensible error message when an explicit cast is needed. 2019-10-06 17:54:44 +01:00
Stephen Williams befc91340c Parse and elaborate unique and priority case statements
The unique, unique0, and priority keywords can decorate case statements
to tell the run time (or synthesis) to do extra tests (or make extra
assumptions). These tests are not implemented in the vvp run time, but
now the decorations make it to the code generators.
2019-10-05 16:23:04 -07:00
Martin Whitaker 862010ac19 SV does not require constant expression in variable initialisation. 2019-10-05 20:11:38 +01:00
Martin Whitaker 9bb2147fb5 Merge branch 'package-imports-rework' 2019-10-01 23:04:23 +01:00
Stephen Williams da36cee8f0 Detect errors elaborating delay expressions. 2019-10-01 09:29:13 -07:00
Martin Whitaker c5c264400e Add support for package scope resolution for named events. 2019-10-01 09:07:54 +01:00
Martin Whitaker 1e26a808ad Fix error message for failed elaboration of event expression. 2019-10-01 09:07:30 +01:00
Martin Whitaker f69eccf903 Merge remote-tracking branch 'origin/master' into package-imports-rework 2019-10-01 09:06:15 +01:00
Cary R ba82ef463e Fix some always_* issues 2019-09-29 16:59:59 -07:00
Martin Whitaker d3bced57cc Correctly handle explicit and wildcard package imports.
Explicit imports should always conflict with local declarations using
the same name. Wildcard imports only conflict if they are referenced
before a local declaration with the same name.

This also unifies the detection of identifier conflicts.
2019-09-27 22:19:30 +01:00
Martin Whitaker 55219773fd Allow nested scopes to use their parent's imports. 2019-09-27 22:19:30 +01:00
Martin Whitaker 02ee1c65d0 Support dynamic array initialisation in variable declarations. 2019-09-16 20:35:27 +01:00
Martin Whitaker a8318db21c Fix assertion failure when top level module has array ports.
Reported by Kustaa Nyholm on iverilog-devel, 2017-10-17.
2019-08-03 18:52:49 +01:00
Martin Whitaker 6309674a8d Fix GitHub issue #231 - support packed array indexing in foreach statement. 2019-07-25 11:10:08 +01:00
Martin Whitaker 0cb1ebddf1 Fix for GitHub issue #239 - segfault when library file has syntax errors.
If there are errors when parsing a file, it is not safe to elaborate any
modules that have been found in that file.
2019-07-24 10:22:55 +01:00
Cary R 3f24557e90 Add some more always_ff synth checks 2018-09-23 22:32:22 -07:00
Martin Whitaker caf83b02c1 Enable variable declarations/initialisations in the compilation unit scope. 2018-02-18 14:09:03 +00:00
Cary R e7a9662b3d A #0 is not allowed in a final block 2018-01-01 21:35:26 -08:00
Cary R 2bbd077dc9 Add some synthesis checks for the always_comb/ff/latch blocks 2017-12-27 14:51:17 -08:00
Cary R f17992bcd0 Report the lines that have delay or event control in an always_comb/ff/latch process 2017-12-06 00:22:43 -08:00
Cary R cb0ffd734e Check to see that always_comb/ff/latch do not have delays/events 2017-12-05 22:10:43 -08:00
Cary R 575aa9b0fb Fix spelling in always_comb 2017-12-03 20:17:42 -08:00
Cary R 84d0df8a8a Pass to the targets if an implicit T0 trigger event is needed. 2017-12-03 20:17:42 -08:00
Cary R 585a0232cb Add preliminary support for always_comb, always_ff and always_latch 2017-11-20 07:50:05 -08:00