Commit Graph

8065 Commits

Author SHA1 Message Date
Martin Whitaker 4cb9ae0aa2 SIGHUP is not available in Windows.
(cherry picked from commit 3e25b04685)
2018-10-08 22:10:13 +01:00
Martin Whitaker 8e77900b9c Fix deprecated dynamic exception specification warnings.
(cherry picked from commit 4ea18196c8)
2018-10-08 22:10:07 +01:00
Martin Whitaker 400428a2b6 Fix signed/unsigned comparison warning.
(cherry picked from commit e71a76a1e2)
2018-10-08 22:10:00 +01:00
Martin Whitaker de63c0cedb Fix implicit fallthrough warnings when building with recent GCC.
(cherry picked from commit f1608e163f)
2018-10-08 22:09:50 +01:00
Martin Whitaker 10fc8048ac Fix auto_ptr deprecated warnings when building with recent GCC.
(cherry picked from commit 78317a2799)
2018-10-08 22:01:04 +01:00
Martin Whitaker c5df4cfcad Cleanly terminate vvp on SIGHUP or SIGTERM (GitHub issue #203).
(cherry picked from commit 603ff303f5)
2018-10-08 21:50:48 +01:00
Cary R f2a711b8f1 Update to latest GTKWAve files 2018-10-06 09:26:49 -07:00
Martin Whitaker dc6fc7ee77 Enable checks for VPI const-correctness.
Note we only want these enabled when building the compiler and runtime
binaries. If we included the ICARUS_VPI_CONST definition in the global
CPP_FLAGS, that would propagate to the flags used by iverilog-vpi, so
would affect compilation of user VPI code.

(cherry picked from commit 542fe2cf77)
2018-10-06 11:56:35 +01:00
Martin Whitaker 16c18eda2e Further fixes for const-correctness.
- allow ICARUS_VPI_CONST to be pre-defined by the user
- use it for sizetf as well as for compiletf and calltf
- fix remaining warnings when it is defined as 'const'

(cherry picked from commit 0d494da702)
2018-10-06 11:55:03 +01:00
Martin Whitaker 5474f9d5ac Allow %c format to output null characters (GitHub issue #209)
Currently $display et al. output nothing when the expression
corresponding to a %c format specification has the value 0. As
Verilog provides no other way to write raw bytes to a file, we
should allow 0 values to be written. Other simulators allow this.

(cherry picked from commit b066a5815e)
2018-09-29 21:31:18 +01:00
Martin Whitaker d5be428e45 Fix broken links to SourceForge bug/patch trackers (GitHub issue #207).
Also add link to GitHub issues, as a lot of users report bugs there.

(cherry picked from commit 8df2f0cadf)
2018-09-28 10:05:09 +01:00
Stephen Williams c831ce0aae Merge branch 'v10-branch' of github.com:steveicarus/iverilog into v10-branch 2018-07-24 09:37:50 -07:00
Cary R ab6ae797b3 Update fstapi.c to the latest version 2018-07-16 09:03:22 -07:00
Martin Whitaker 52b136d8a8 Fix for GitHub issue #198 - support octal display for thread variables.
(cherry picked from commit 11c826216a)
2018-06-12 23:00:53 +01:00
Martin Whitaker 703363feaf Fix for GitHub issue #199: handle signed division overflow.
When performing a signed division or modulus operation using native
arithmetic, trap the special case that the numerator is the minimum
integer value and the denominator is -1, as this gives an undefined
result in C++.

(cherry picked from commit 7ad5b59a6f)
2018-06-12 23:00:34 +01:00
Martin Whitaker e79d226082 Don't allow non-vectorable arguments to $signed/$unsigned.
This led to an assertion failure in many cases (see br1029).
1364-2012 indicates it is illegal.

(cherry picked from commit 87c01c55c0)
2018-05-14 22:26:36 +01:00
Martin Whitaker 7df0f0c659 Further fix for br1029.
The code in vpi_callback.cc is replicated in vpi_vthr_vector.cc,
so we have to replicate the fix. This should really be factored
out.

(cherry picked from commit 6e49ab10ec)
2018-05-14 22:23:46 +01:00
Martin Whitaker 24731227b4 Fix br1029 - correct rounding when vpi_get_value converts real to integer string.
(cherry picked from commit 5a4e99b0e8)
2018-05-12 23:57:42 +01:00
Yury Gribov 0f28b03dd3 Put start events to proper queue.
(cherry picked from commit 43cd693fe0)
2018-03-10 12:22:35 +00:00
Martin Whitaker 02e220097d Implement supply->strong strength reduction for non-resistive switches.
As specified in 1364-2005 section 7.11.

(cherry picked from commit 36eef5154f)
2018-02-23 22:32:52 +00:00
Martin Whitaker fc62c91496 Improved check for missing task/function port direction.
(cherry picked from commit 69d80839a5)
2018-02-23 22:32:07 +00:00
Martin Whitaker 6dce878638 Fix for br1027: incorrect inference of task/function port direction.
In traditional Verilog, each task_port_item must have an explicit port
direction.

In SystemVerilog, if the port direction is not specified, it should be
inherited from the preceding task_port_item for that task/function, and
only the first task_port_item should infer the direction to be 'input'.

(cherry picked from commit 6b1b402a79)
2018-02-20 21:08:30 +00:00
Cary R 480fb0b418 Update tp the latest files from GTKWave 2017-12-13 21:57:05 -08:00
Cary R dab896c463 The delay for a join_any and join_none is different than join 2017-12-05 21:50:26 -08:00
Cary R 94861872e5 Fix a couple memory leaks in $sdf_annotate() 2017-11-16 19:42:16 -08:00
Cary R cc3e9d791a Update flex destroy to work for version 2.6 and greater 2017-11-16 19:17:50 -08:00
Martin Whitaker 03764a400d Fix assertion failure in vvp wide functor.
If the functor output is read before any values have propagated to
the functor inputs, the internal storage won't have been initialised.

(cherry picked from commit ad83a135e5)
2017-11-08 20:54:25 +00:00
Martin Whitaker 99f66e2781 Fix for GitHub issue #169: nets can get given wrong scope in VPI.
In vvp, the __vpiSignal object holds a pointer to the scope containing
the signal. This was getting set to the current scope when the net was
finally resolved, rather than to the scope where the net was declared.

(cherry picked from commit c622d372f9)
2017-11-07 19:25:02 +00:00
Martin Whitaker a74c3a1207 Factor out common code for warning about inconsistent timescales.
Also reword the warning for SystemVerilog, where `timescale is not
the only (or indeed preferred) way of specifying timescales.

(cherry picked from commit 9382d22063)
2017-11-05 22:32:00 +00:00
Martin Whitaker dec9a8b527 Fix $printtimescale to support 10s and 100s values.
(cherry picked from commit e54d19e2d2)
2017-11-05 22:31:33 +00:00
Cary R 1b0843c94c Update to latest files from GTKWave 2017-10-22 19:40:43 -07:00
Martin Whitaker bb2e270087 Enable base class tasks to be used in an extended class.
(cherry picked from commit 4f383a8a11)
2017-10-08 21:27:49 +01:00
Martin Whitaker a18fe22d32 Fix for GitHub issue #98 and #167
Two fixes needed:
  - when searching for a base class, we need to look in the root scope
    if the base class isn't found in the scope hierarchy
  - the classes in the root scope need to be stored in an ordered
    list, not a map, to ensure they are elaborated in the order they
    were declared. Without this, the compiler may try elaborating an
    extended class before its base class is known about.

(cherry picked from commit 87cddf33dc)
2017-10-08 21:27:13 +01:00
Martin Whitaker 1f7588d3a4 Add support for darray initialisation from another darray.
Fixes GitHub issue #164.

(cherry picked from commit 5ca058bfb5)
2017-10-08 17:53:53 +01:00
Martin Whitaker 09c7c439a1 Add support for vec4 darray initialisation from an array pattern.
This was just a missing case label in tgt-vvp.

(cherry picked from commit 1aeaafa96c)
2017-10-08 17:53:33 +01:00
Martin Whitaker a907200fb9 Generate proper error messages for invalid dynamic array initialisers.
Invalid user code should not result in an "internal_error".

(cherry picked from commit 8a36849fda)
2017-10-08 17:53:21 +01:00
Martin Whitaker bccb7e7def Fix for GitHub issue #165 : assertion failure on thread join.
If a thread becomes detached due to a join_any statement, that
thread must not attempt to join its parent, even if the parent
is waiting on a subsequent join statement.

(cherry picked from commit e315cafa01)
2017-10-07 16:46:49 +01:00
Martin Whitaker 6b11df1999 Fix for br1025 : support nested scopes in root level tasks/functions.
(cherry picked from commit 85fa24fa58)
2017-10-04 21:34:49 +01:00
Martin Whitaker 95d3579509 Fix for GitHub issue #163 : assertion failure caused by syntax error in task.
(cherry picked from commit 3566ff4cd4)
2017-09-28 19:26:27 +01:00
Martin Whitaker a3a8669c6f Fix error in last commit.
(cherry picked from commit a1a7f5deff)
2017-09-17 21:24:50 +01:00
Martin Whitaker 885e25120a Fix use after free bug in vvp when a task or function is disabled.
Use test_joinable() and do_join() to ensure everything gets cleaned
up before the thread is reaped. This should fix br1016, br1017, and
br1018.

(cherry picked from commit 0bed890bc6)
(and subsequent fixup)
2017-09-17 20:01:14 +01:00
Martin Whitaker 7b372c3a0c Fix for GitHub issue #162 : very wide busses cause assertion failure.
This occurs when tgt-vvp attempts to generate a C4<..> constant
value with a bit width >= 65536. The actual failure occurs in the
StringHeap class, which originally supported a maximum string length
of 65535. This fix enables the StringHeap class to support any size
string (provided the system has sufficient memory).

(cherry picked from commit c855b8926e)
2017-09-11 22:29:30 +01:00
Stephen Williams 3d14281e0d Prepare for version 10.2 2017-08-24 08:22:49 -07:00
Stephen Williams 2564554178 Minor tweak to some assertions. 2017-08-24 08:18:55 -07:00
Martin Whitaker 8cd697fd24 Fix for br1019 - allow multiple array words to be attached to a vpi callback.
Normally there is at most one signal attached to a vvp functor, but
due to port collapsing, there can be more than one. If these signals
are array words, we need to trigger vpi callbacks on all the associated
arrays when the functor value changes.

(cherry picked from commit ac87138c44)
2017-08-12 12:31:14 +01:00
Cary R 306d2fb53b V10: Fix class versus struct warning in clang 2017-06-19 21:26:35 -07:00
Martin Whitaker 52b497f74c Don't allow localparams to be overridden (GitHub issue #157)
Currently we only issue a warning if a parameter override references
a parameter that doesn't exist, so do the same in this case.

(cherry picked from commit 42422d9940)
2017-06-16 21:11:18 +01:00
Martin Whitaker ce7f28202a Ensure value passed to named event via vpi_put_value() is initialised.
The __vpiNamedEvent::vpi_put_value() function ignores the value, but
intermediate code looks at it.

(cherry picked from commit e2be64558b)
2017-06-15 09:15:31 +01:00
Martin Whitaker 49bea6a01a Implement vpi_put_value() for named events (GitHub issue #158).
(cherry picked from commit 3de7c234f7)
2017-06-15 08:52:15 +01:00
Martin Whitaker 8ab100c1c7 Fix for GitHub issue #152 - segfault on gate connection syntax error.
If there is a syntax error in the source code, pform_makegate may be
passed a null list of port connections. The error is already reported,
so we just need to ignore it.

(cherry picked from commit 8a5cbd4415)
2017-04-21 21:44:27 +01:00