Stephen Williams
3c2fb6a601
Fix dynamic array assignment to make a copy of the rvalue.
...
IEEE Std 1800-2017 Section 7.6 Array assignments
Assignment of a dynamic array creates a duplicate of the source,
so that assignments to the copy don't impact the original. Handle
all sorts of dynamic array base types.
2020-11-26 12:52:06 -08:00
Stephen Williams
7277f4e807
Merge pull request #394 from steveicarus/super-new-handling
...
Fixes for issues #387 and #390
2020-11-22 16:48:45 -08:00
Stephen Williams
919fd22a79
Handle the special case that constructor only chains.
...
Fix the case that a constructure is only a chaining constructor,
with no other content.
2020-11-22 16:13:01 -08:00
Stephen Williams
156644d91e
Detect and complain about some constructor chain errors
...
This.new is not allowed.
super.new beyond the first statement is not allowed.
And while I'm at it, clean up the use of "@" and "#" in
the code as tokens for this and super.
2020-11-22 15:31:40 -08:00
Cary R
292d174cad
Add support for an empty ';' in the description text
2020-11-20 21:42:39 -08:00
Cary R
b14a623eef
Update module items to include just a ';'
2020-11-20 20:48:55 -08:00
Martin Whitaker
1b3f0dd689
Add enumeration assignment compatibility check for continuous assignments.
2020-11-20 17:34:55 +00:00
Martin Whitaker
0fada92389
Fix expression type for packed struct member access (GitHub issue #386 )
...
A NetESelect is used for accessing packed struct members and also for
accessing dynamic array elements. In these cases the expr_type() and
enumeration() methods should reflect the member/element type.
2020-11-20 16:50:11 +00:00
Cary R
ad862020bb
Move GNU lesser to tgt-vvp since that is the only place where LGPL code is located
2020-11-14 19:03:27 -08:00
Cary R
d209e7533a
Update some queue code since deques support random access
2020-11-14 17:09:51 -08:00
Martin Whitaker
d6e01d0c55
Fix assertion failure when no value supplied with -P option (GitHub issue #377 )
2020-10-24 22:48:00 +01:00
Martin Whitaker
359b2b65c2
Support escaped identifiers as macro names.
2020-10-09 11:38:16 +01:00
Martin Whitaker
6566072741
Fix GitHub issue #374 - ordering of `` and embedded macro expansion.
...
The IEEE standard does not clearly state whether the `` directive is applied
before or after embedded macros are expanded. Other simulators vary in their
behaviour. For maximum compatibility, this fix adopts the behaviour found in
Verilator, where `prefix``suffix expands to <prefix>suffix if prefix is a
defined macro, otherwise it expands to <prefixsuffix> (where <...> is the
expanded macro text). Other simulators show this behaviour in at least some
circumstances.
2020-10-09 08:09:04 +01:00
Martin Whitaker
8f8737198c
Bump version to 12.0 in vvp/examples/*.vvp.
2020-10-03 10:57:25 +01:00
Martin Whitaker
4e79c1c861
Bump major version to 12.
2020-10-03 10:13:45 +01:00
Martin Whitaker
6880b39770
Refactor task declaration parsing and fix warning for empty port list.
...
1364-2005 and later allow a task declaration with an empty port list.
2020-10-03 09:30:51 +01:00
Martin Whitaker
c4883da334
Fix width of localparam created from genvar when using -gstrict-expr-width.
2020-10-01 11:33:24 +01:00
Stephen Williams
fec003bd36
vvp: Remove a dead rule for the .port_info statement.
...
We left an old rule that matched a port_info statement without a
trailing semicolon. Remove that rule ahead of the release.
2020-09-22 14:18:24 -07:00
Stephen Williams
a831108c96
Merge pull request #371 from larsclausen/enum_implicit_reg
...
parse.y: Mark enum output ports always as IMPLICT_REG
2020-09-21 08:10:18 -07:00
Lars-Peter Clausen
1064543d27
parse.y: Mark enum output ports always as IMPLICT_REG
...
Unless explicitly declared a wire an enum output port is of variable type
and should be marked as IMPLICT_REG.
Currently this is only done when the base type of the enum is `logic`. But
it should be done for all enums regardless of their base type.
Without this change for example the following snippet
```
typedef enum {
A,
B
} E;
module M (
input E ei,
output E eo
);
always_comb eo = ei;
endmodule
```
fails with the following error message
test_enum.sv:11: error: eo is not a valid l-value in M.
test_enum.sv:8: : eo is declared here as wire.
Signed-off-by: Lars-Peter Clausen <[email protected] >
2020-09-20 19:14:28 +02:00
Stephen Williams
b8c5fd6314
Merge pull request #370 from larsclausen/remove-empty-file
...
tgt-vvp: Remove (almost) empty file vector.c
2020-09-19 08:19:38 -07:00
Lars-Peter Clausen
1ec5a441f3
tgt-vvp: Remove (almost) empty file vector.c
...
Since commit 62fce50f8c ("Remove dead code for allocate_vec handling.")
vector.c only contains the license header and some include directives
but no actual code.
Remove the file.
Signed-off-by: Lars-Peter Clausen <[email protected] >
2020-09-19 12:39:04 +02:00
Martin Whitaker
10685ed89d
Remove redundant test for whether a vvp thread is joinable.
...
Since commit 15cda5fe , forked threads are never embedded in the parent
thread, so we no longer need the special case code that ensured that
task/function calls were reaped before a join.
This also fixes GitHub issue #368 .
2020-09-11 21:18:54 +01:00
Martin Whitaker
d8556e4c86
Fix handling of the SV `` delimiter when combined with macro usage.
...
Given a macro definition like this:
`define name `macro``text
the preprocessor should expand `macro, not `macrotext, when it expands
`name. This also ensures that
`define name(p,s) p``_``s
`define PREFIX my_prefix
`define SUFFIX my_suffix
`name(`PREFIX, `SUFFIX)
expands to
my_prefix_my_suffix
as the user would expect.
2020-08-24 20:29:15 +01:00
Martin Whitaker
dc2aa6efa0
Fix handling of SV " and \`" escape sequences in macros (GitHub issue #366 ).
...
`" overrides the normal behaviour of disabling macro expansion within
a string.
2020-08-24 14:48:40 +01:00
Martin Whitaker
bd0a1c75ed
Add support for string values in event expressions (GitHub issue #365 ).
2020-08-23 11:06:15 +01:00
Martin Whitaker
a69de8b94a
Rework last value storage in vvp_fun_anyedge functors.
...
This prepares the way to support strings and object handle values.
2020-08-23 11:04:44 +01:00
Cary R
0a69303164
Refactor array store for string/real and skip saving when given an undefined index
2020-08-16 19:49:34 -07:00
Cary R
505ee1a96c
Refactor store for real/string
2020-08-16 19:23:41 -07:00
Cary R
aa013a0ef0
Refactor store prop
2020-08-16 19:08:34 -07:00
Cary R
4bf502741d
Refactor store DAR
2020-08-16 18:37:28 -07:00
Cary R
8e3afebb7b
Refactor set DAR object
2020-08-16 18:00:41 -07:00
Martin Whitaker
bd0133b386
Fix GitHub issue #361 - explicit cast check on function return value.
...
A function call returning an enumeration value can be assigned to an
enumeration variable without an explict cast.
2020-08-14 12:30:05 +01:00
Cary R
43441066eb
More refactoring in vthread
2020-08-13 23:28:18 -07:00
Cary R
f3e4287d0a
Refactor prop routines to use common template
2020-08-13 22:30:21 -07:00
Cary R
52c3b901e0
When available print file/line information with thread error messages
2020-08-13 22:05:31 -07:00
Cary R
294005c5b2
Refactor load DAR routines
2020-08-13 21:48:52 -07:00
Cary R
3993241d04
Refactor more of the queue code
2020-08-11 19:46:36 -07:00
Cary R
f6d8cfc80c
Add file/line to Sorry queue message
2020-08-11 19:46:22 -07:00
Cary R
112ebb48d8
Add file/line information to procedural warnings and darray fixes
...
When -pfileline=1 is used the queue procedural warnings have file
and line information added to the messages. Also switch the trace
debugging to be off by default.
Also, Add some preliminary missing darray functionality.
2020-08-10 22:01:55 -07:00
Cary R
61884e559c
Add support for assigning a queue using a normal concatenation
2020-08-09 21:10:30 -07:00
Cary R
1a0c06566d
Update vvp code generation to properly emit file/line for void functions
2020-08-09 20:11:46 -07:00
Cary R
e77d22e135
Add file and line information to warning message
2020-08-07 01:02:00 -07:00
Cary R
bff115b9f7
Add initial support for assigning between queues and darrays
2020-08-07 00:23:43 -07:00
Martin Whitaker
3a70a84e68
Don't use libhistory if libreadline includes the history functions.
2020-08-06 23:58:45 +01:00
Martin Whitaker
a5b3c0483a
Set default nm tool if $NM is not defined.
2020-08-06 23:49:45 +01:00
Martin Whitaker
9d15b771b1
Fix GitHub issue #356 - use pull strength for tri0/tri1 tie-offs.
...
When connecting module inout ports, an island is created. If there
is no other driver on one of the island ports, a tie-off is added.
In the case of a tri0 or tri1 net, this must have the correct (pull)
drive strength.
2020-08-06 14:20:16 +01:00
Cary R
eb8f457803
Fix a spacing issue in output
2020-08-05 23:19:39 -07:00
Cary R
761dc35e0b
A queue or darray can be assign from a queue or darray.
2020-08-05 23:19:32 -07:00
Martin Whitaker
2f317065aa
Fix GitHub issue #352 - typo in README.txt (%time -> $time).
2020-08-05 11:33:34 +01:00
Cary R
a0ef23605a
Update some functions to use inline
2020-08-04 22:11:36 -07:00
Cary R
538a03ba8e
Add templates for queue push
2020-08-04 22:07:02 -07:00
Cary R
f638e9dd5d
Add templates for queue pop
2020-08-04 21:48:47 -07:00
Cary R
84eb70660d
Switch qinsert to use a template
2020-08-04 21:14:17 -07:00
Cary R
d1d6c0f5d2
Start refactoring the queue routines
2020-08-03 23:45:56 -07:00
Cary R
199ed39abe
Report when the array pattern is larger than the maximum queue size
2020-08-02 23:40:35 -07:00
Cary R
83db691586
Merge branch 'master' of github.com:steveicarus/iverilog
2020-07-30 19:54:59 -07:00
Cary R
2530041a38
Add support for assign array patterns to a queue
2020-07-30 19:52:38 -07:00
Martin Whitaker
07bbf4ce0f
CI: run on both Ubuntu 16.04 and 18.04.
2020-07-30 16:40:40 +01:00
Martin Whitaker
8e4cc8e887
Use GNU make pattern rules to handle multiple file output from bison.
...
With a pattern rule, the recipe will only be executed once, even when
the rule has multiple targets. Using this to handle the output from
bison is included as an example in the GNU make manual.
This fixes the makefiles so that bison-generated header files will be
regenerated if they are deleted.
2020-07-30 16:27:01 +01:00
martinwhitaker
a4c9919e3a
Merge pull request #349 from hzeller/fix-bison-include
...
Bison includes its generated header in *.cc. Generate with correct name.
2020-07-30 15:53:21 +01:00
martinwhitaker
929ffed6ab
Merge pull request #347 from vowstar/fix-nm
...
aclocal.m4: fix issue in cross-compiling
2020-07-30 09:38:22 +01:00
Cary R
a2ba8a16b1
Add support for inserting into a queue
2020-07-29 23:00:19 -07:00
Cary R
bed4758b0f
A value of all X or Z can be an immediate number
2020-07-29 23:00:09 -07:00
Henner Zeller
5b699c1be7
Bison includes its generated header in *.cc. Generate with correct name.
...
The current bison (3.7) generates a *.cc file that includes the header
it generated. For parse.cc this would be parse.hh. Right now, we rename
this header to have a common name used in other files, but this results
in a compile error for the parse.cc file:
parse.cc:462:10: fatal error: parse.hh: No such file or directory
462 | #include "parse.hh"
| ^~~~~~~~~~
Fix this by telling bison to output the header file to the correct
filename in the first place so that we don't have to rename it.
(using the --defines instead of -d option).
This looks like a bison specific option not available in Posix yacc;
but looks like we're requiring bison anyway.
Signed-off-by: Henner Zeller <[email protected] >
2020-07-29 15:29:08 -07:00
Huang Rui
d827f674cc
aclocal.m4: fix the comment contradicts the previous line
...
Changed to "the nm(1) utility or an equivalent is available,
and its name is defined by the $NM variable.
Signed-off-by: Huang Rui <[email protected] >
2020-07-28 21:15:49 +08:00
Martin Whitaker
e69549034d
Fix potential buffer overflows (GitHub issue #346 ).
2020-07-28 13:17:57 +01:00
Cary R
fdd902e446
Remove some clang warnings
2020-07-27 21:56:29 -07:00
Cary R
14ade1a9f4
Pass the max size when storing to a queue
2020-07-27 21:24:22 -07:00
Cary R
cf8222fcfe
A queue does not have dimensions so just assume the base is 0 for an L-val
2020-07-26 14:02:37 -07:00
Cary R
c969c324ed
Add initial support for using a queue element as an L-value
2020-07-26 14:02:29 -07:00
Cary R
520d5b392a
Add support for pop_back/front without ()
2020-07-25 22:16:54 -07:00
Cary R
6ecd43d947
Add/update queue compile time error messages
2020-07-25 16:33:30 -07:00
Cary R
d1b75d9407
Update some queue warning messages and optimize element erase
2020-07-25 15:32:28 -07:00
Cary R
1a4345cce9
Add the ability to delete an element of a queue
2020-07-25 00:49:42 -07:00
Huang Rui
f3396d502d
aclocal.m4: fix issue in cross-compiling
...
The aclocal.m4 called nm directly.
It can cause issue in cross-compiling and because is not possible
use a different NM implementation (like llvm-nm).
The compile error log:
https://bugs.gentoo.org/attachment.cgi?id=648556
Closes: https://bugs.gentoo.org/731906
Signed-off-by: Huang Rui <[email protected] >
2020-07-25 12:50:49 +08:00
Cary R
e94291c88f
Handle negative and undefined queue addresses correctly
2020-07-23 22:49:33 -07:00
Cary R
f0f045f1f9
Add warning messages when popping from an empty queue
2020-07-23 22:04:27 -07:00
Cary R
1b52a4a578
Don't fail when pushing/poping from an empty queue
2020-07-23 19:12:35 -07:00
Cary R
5f8aa24093
Remove duplicate FILE_NAME() call
2020-07-23 18:49:54 -07:00
Cary R
e1870acfac
Return the correct value when a queue or darray references an undefined element
2020-07-22 21:47:37 -07:00
Cary R
5ebd08c7f8
The queue needs to be implemented using a deque
2020-07-21 20:02:11 -07:00
Cary R
2999f351d2
Update queue error/warning messages
2020-07-20 20:34:17 -07:00
Cary R
1b7cd5c237
Add initial support for real queues
2020-07-19 21:34:56 -07:00
Cary R
bf6c4329b9
Add push front for string queues and improve some warning messages
2020-07-19 19:18:59 -07:00
Cary R
83c86735bb
Update vlog95 to not crash with queue maximum index
2020-07-17 02:19:36 -07:00
Cary R
6ff07c1074
Enable support for providing a queue maximum index
2020-07-17 01:32:53 -07:00
martinwhitaker
2c9cce2303
Merge pull request #342 from purdeaandrei/f_add_assert_before_dereferencing_pointer
...
Add assert to protect against potentially dereferencing null pointer.
2020-07-16 10:48:11 +01:00
Martin Whitaker
4cc929c71a
CI: ignore line-endings when checking results on Windows.
2020-07-11 09:26:23 +01: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
martinwhitaker
3d305b33df
Merge pull request #339 from dredozubov/update-osx-readme
...
Update MacOS instructions
2020-07-11 00:10:42 +01:00
Martin Whitaker
b36bca1f1b
Add support for return statements in void functions.
2020-07-10 23:34:11 +01:00
martinwhitaker
07256646a5
Merge pull request #334 from purdeaandrei/f_fix_portless_declarationless_functions
...
Fix port-list-less declaration-less functions for SystemVerilog
2020-07-10 22:47:53 +01:00
Martin Whitaker
4e7dfac6c4
CI: automatically update expected results for msys2.
2020-07-10 22:05:07 +01:00
Cary R
dd80607ceb
Add CA version of the <-> operator
2020-07-09 01:45:43 -07:00
Cary R
c003bcc59a
Add support for <-> in constant and procedural contexts
2020-07-07 23:29:19 -07:00
Cary R
018a649f59
A time variable defaults to unsigned, but can be declared as signed
2020-07-07 20:33:03 -07:00
Cary R
b8ae9a85fa
Update size check in $fread()
2020-07-03 23:15:39 -07:00
Denis Redozubov
e5ca8c4fa4
Update MacOS instructions
...
* Update README to reflect that bison fails to generate correct code
on newer MacOS as well and bison 3.6+ works fine as well
* macos.txt removed because it contains outdated instructions
2020-06-30 22:09:54 +03:00
Cary R
6d8dea8d05
Update fstapi.c to latest from GTKWave
2020-06-28 20:12:14 -07:00
Martin Whitaker
085f466377
Fix GitHub issue #337 - incorrect uninitialised function return value.
2020-06-25 00:31:43 +01:00
Purdea Andrei
a4d91c9023
Fix port-list-less declaration-less functions for SystemVerilog
...
For functions without a port list in parantheses, declarations are optional in SystemVerilog.
This is true even in IEEE1800-2005, but not in IEEE1364-2005
2020-06-22 23:51:10 +03:00
martinwhitaker
ed7734c795
Merge pull request #328 from purdeaandrei/f_allow_libext_and_y_commands_to_be_given_in_any_order
...
Allow +libext+ and -y commands to be given in any order (and small fix in manpage)
2020-06-03 14:57:09 +01:00
Purdea Andrei
c217d7d759
fix compilation issues on older gcc5
2020-06-03 15:58:27 +03:00
Purdea Andrei
859341273e
Don't use C++11 feature std::tuple, instead use std::pair
2020-06-03 14:47:11 +03:00
martinwhitaker
a849ca28ef
Merge pull request #327 from purdeaandrei/f_fix_how_explicitly_unconnected_ports_are_handled_with_dotstar
...
Fix how explicitly unconnected ports are handled in the presence of .*
2020-06-03 11:42:29 +01:00
martinwhitaker
0b87ecb173
Merge pull request #325 from tpambor/fix-missing-include
...
Add missing include for malloc
2020-06-02 20:56:37 +01:00
Martin Whitaker
8e4593bf90
CI: really fix Windows build, check VVP results, run VPI tests.
2020-06-02 20:27:58 +01:00
Martin Whitaker
4466a19fb1
Attempt to fix Travis CI on Windows.
2020-06-01 13:18:00 +01:00
Cary R
0fca1bdab0
Add vpiIndex for array words
2020-05-31 14:27:19 -07:00
Cary R
fb237fb006
Update the user visible copyright to be 2020
2020-05-31 13:41:38 -07:00
Cary R
89d3342804
Increase the thread flag count from 256 to 512
2020-05-31 12:39:54 -07:00
Cary R
1fefa8eb1b
Add support for vpi_put_value for vpiBit
2020-05-31 10:49:54 -07:00
Cary R
7eb0efd424
Add basic support for vpiBit
2020-05-31 00:27:15 -07:00
Purdea Andrei
37da3c530c
Allow +libext+ and -y .f command file options to be given in any order.
2020-05-19 22:49:35 +03:00
Purdea Andrei
13f6a916b3
man page: fix typo regarding +libext+ command
2020-05-19 22:49:35 +03:00
Cary R
a1518b5761
Report any failures in $fclose()
2020-05-18 22:58:24 -07:00
Cary R
19d63f0c96
A VPI by index will only work for a reg or a net
2020-05-18 22:57:18 -07: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
Cary R
38d16e5f2f
Use a common routine to get and check the FD/MCD
2020-05-16 21:06:35 -07:00
Cary R
0a06ecb203
Update vpi_mcd_close() to return the correct value
2020-05-16 19:19:45 -07:00
Cary R
fc7f0739d3
When a FD is passed to vpi_mcd_(v)print return EOF since this is an error
2020-05-16 19:19:30 -07:00
Cary R
9b9be11cf6
Factor out the common code for checking if a FD/MCD is valid
2020-05-16 18:04:09 -07:00
Tim Pambor
514ddade39
Add missing include for malloc()
2020-05-11 19:00:38 +02:00
Martin Whitaker
cf44f05cd3
Fix GitHub issue #324 - replace __CYGWIN32__ with __CYGWIN__.
...
__CYGWIN32__ is not defined when building with the 64-bit Cygwin
toolchain. According to the Cygwin FAQ, __CYGWIN__ has been defined
since 1998, so this should still work for users on 32-bit systems.
2020-05-10 14:06:53 +01:00
Cary R
cb3469cf51
Fix space issue
2020-05-09 23:08:43 -07:00
Cary R
cf193b3055
Cleanup vpiClassTypespec when running valgrind
2020-05-09 23:04:37 -07:00
Martin Whitaker
40d2a49b90
Update vlog95 target to handle buffers/tran_vps used to prevent port collapsing.
2020-05-07 23:05:52 +01: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
Cary R
58eb202376
Update find_scope and vpi_handle_by_name to work with escaped identifiers
2020-05-02 19:47:56 -07: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
7af04c62ee
Fix GitHub issue #319 - export ivl_path_is_parallel for Windows DLLs.
2020-04-30 22:55: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
a44ffe5746
Fix GitHub issue #315 - support modpath delays on multiply-driven nets.
2020-04-02 10:56:03 +01:00
Cary R
f76e1c1ecb
Update to the latest GTKWAve files
2020-03-30 15:49:28 -07:00
Stephen Williams
7bbafe6109
Merge pull request #66 from themperek/master
...
Add travis-ci integration (linux + windows)
2020-03-24 09:35:37 -07:00
Stephen Williams
462ee62f8b
Merge pull request #300 from vowstar/fix-makefile
...
Fix iverilog files not update bug during overwrite installation
2020-02-29 09:38:42 -08:00
Martin Whitaker
875431a3ea
Merge pull request #311 from nmoroze/master.
...
Replaces assertion in evaluate_index_prefix() with useful error message.
2020-02-18 19:53:22 +00:00
Noah Moroze
d0fe513c7e
Replace assertion in evaluate_index_prefix with useful error message.
2020-02-15 16:32:32 -05:00
Martin Whitaker
8b85064341
Fix GitHub issue 310 - improve port declaration error message.
2020-02-15 12:02:15 +00:00
Huang Rui
11001f58d5
Thoroughly fix parallel installation issues
...
In PR #300 , @xdch47 pointed out a stable way to fix parallel
installation problems.
This fix applied the method, thanks!
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:42:04 +08:00
Huang Rui
969426a21e
Fix install missing file bug in PR #300
...
When installing tgt-stub and tgt-vhdl, due to the wrong target
path, the install scripts can't find the file to be installed.
The missing file is: stub.conf, stub-s.conf, vhdl.conf, vhdl-s.conf
Changed to right path fixed this problem.
Thanks @minux help to fix.
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:39:30 +08:00
Huang Rui
357d9ae6f0
[20/20]Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
dd5a288567
[19/20]cadpli/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
9e8692fac5
[18/20]driver-vpi/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
0602ef46c6
[17/20]driver/Makefile.in:fix install timestamp check
...
Fix tgt-fpga/Makefile.in vvp/Makefile.in doc
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
593d5b5c83
[16/20]ivlpp/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
80bcd36cb8
[15/20]libveriuser/Makefile.in:Remove useless $(INSTALL32)
...
fix install timestamp check and Remove useless $(INSTALL32)
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
93d2aa03d6
[14/20]tgt-blif/Makefile.in:Remove useless $(INSTALL_DOC)
...
fix install timestamp check and Remove useless $(INSTALL_DOC)
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
f517b5fc4e
[13/20]tgt-fpga/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
5f0f186b51
[12/20]tgt-null/Makefile.in:Remove useless $(INSTALL_DOC)
...
fix install timestamp check and Remove useless $(INSTALL_DOC)
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
1313722438
[11/20]tgt-pal/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
d7e1df5638
[10/20]tgt-pcb/Makefile.in:Remove useless $(INSTALL_DOC)
...
fix install timestamp check and Remove useless $(INSTALL_DOC)
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
b5a44195ff
[9/20]tgt-sizer/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
af152bec32
[8/20]tgt-stub/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
404e475022
[7/20]tgt-verilog/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
439d4405dd
[6/20]tgt-vhdl/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
c1229b7565
[5/20]tgt-vlog95:Remove useless $(INSTALL_DOC)
...
fix install timestamp check and Remove useless $(INSTALL_DOC)
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
bd130786ff
[4/20]tgt-vvp/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
0100c0bc5c
[3/20]vhdlpp/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
0c12a24cfd
[2/20]vpi/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Huang Rui
081fe1c816
[1/20]vvp/Makefile.in:fix install timestamp check
...
Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294
Signed-off-by: Huang Rui <[email protected] >
2020-02-12 22:08:40 +08:00
Martin Whitaker
387d18d222
Fix GitHub issue #306 - segfault when synthesising deassign statement.
...
Synthesis doesn't properly support any of the procedural continuous
assignment statements, so output a "sorry" message and abort synthesis.
2020-02-09 18:22:58 +00:00
Martin Whitaker
fb29da0bd8
Fix for GitHub issue #309 - allow braced expressions as macro arguments.
...
As for parentheses, we need to ignore commas within a pair of braces
when parsing a macro argument, e.g. `MACRO({a,b}) has one argument.
This fix is a little crude in that it doesn't distinguish between
parentheses and braces, e.g. it will accept {a,b). But any errors
like that will be caught by the compiler proper.
2020-02-08 20:51:50 +00:00
Martin Whitaker
97edccceab
Merge pull request #308 from blackgnezdo/blackgnezdo-master.
...
Fixes loop end condition in __vpiDecConst::vpi_get_value().
2020-02-08 19:29:49 +00:00
Greg Steuck
3ed7e7b295
Merge pull request #1 from blackgnezdo/blackgnezdo-patch-1
...
Fix bad bounds check in for loop
2020-02-05 08:06:44 -08:00
Greg Steuck
398d0cb82f
Fix bad bounds check in for loop
2020-02-05 08:05:50 -08:00
Martin Whitaker
b1114760fc
Fix for compatibility with old C++ standard.
2020-02-02 09:25:05 +00:00
Martin Whitaker
33b822d997
Add support for local genvar declaration in generate loops.
...
As requested in GitHub issue #304 .
2020-01-31 20:29:22 +00:00
Martin Whitaker
0023804777
Add support for increment/decrement operators in generate loop iteration.
...
As requested in GitHub issue #303 .
2020-01-30 21:45:04 +00:00
Martin Whitaker
20d7309ec2
Merge pull request #302 from vowstar/vowstar-fix-gcc10.
...
Fixes build with -fno-common (default in GCC 10).
2020-01-30 18:34:21 +00:00
Huang Rui
d49d26a5c5
Fix fails to build with -fno-common or gcc-10
...
See also: https://bugs.gentoo.org/706366
gcc-10 and above flipped a default from -fcommon to -fno-common:
https://gcc.gnu.org/PR85678
Usually all it takes is to add a few 'extern' declarations and
move definitions from header files to modules. I've port iverilog
to gcc-10 accroding to this guide:
https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
To fix this, I analyzed the code, and found ``pli_trace`` has been
defined at here:
https://github.com/steveicarus/iverilog/blob/v10_3/libveriuser/priv.c#L24
So I changed ``FILE* pli_trace;`` to ``extern FILE* pli_trace;``.
The var ``current_file`` only in ``cfparse_misc.h``, I changed it
from ``char *current_file;`` to ``extern char *current_file;`` and
declaring it in cflexor.lex
And then it works.
Signed-off-by: Huang Rui <[email protected] >
2020-01-29 00:08:59 +08:00
Stephen Williams
78f12dec1c
Merge pull request #294 from minux/fix-make-j-install
...
Makefile.in: fix mkdir race during "make -j N install"
2020-01-06 12:30:33 -08:00
minux
7de00ee73a
Makefile.in: fix mkdir race during "make -j N install"
2020-01-06 00:46:14 -05:00
Cary R
9c777c0420
Update to the latest fstapi files from GTKWave
2020-01-01 19:59:33 -08:00
Martin Whitaker
b91d5d1a82
vvp: recognise signed logic types when parsing class properties.
2019-12-23 09:48:07 +00:00
Martin Whitaker
8dc395940d
Fix issue #298 : elaborate types in the scope where they were declared.
...
The compiler elaborates types on the fly as they are used. For user-
defined types (typedefs) we must do the elaboration in the scope where
the type was declared, not in the scope where it is used.
2019-12-22 17:29:23 +00:00
Martin Whitaker
e8e2c35df0
Fix some errors in pform dumps.
2019-12-22 11:26:13 +00:00
Martin Whitaker
732a763188
Record typedef name in data_type_t struct.
...
This will be used to locate the scope where the type was declared.
2019-12-22 11:21:05 +00:00
Martin Whitaker
95147a2cc2
Record data type for all pform "wires" added the new way.
...
For unpacked arrays, record both the array type and the base type.
This will be needed to elaborate typedefs in the correct scope.
2019-12-22 11:03:50 +00:00
Martin Whitaker
465e0d2710
Allow classes to reference declarations in their enclosing scope(s).
...
The original implementation made each class a root scope. They should
be added to the scope hierarchy just like any other declaration.
2019-12-22 10:46:38 +00:00
Stephen Williams
7f95abc6ab
Make a pass at implementing cbAtEndOfSimTime.
...
In Icarus Verilog, AtEndOfSimTime is practically the same as
cbReadWriteSync, since the latter is after non-blocking events
in Icarus Verilog.
2019-11-25 17:57:10 -08:00
Stephen Williams
b25df08c99
Fix possible buffer overflow.
2019-11-21 18:48:57 -08:00
Stephen Williams
f147cf9c61
Merge branch 'master' of github.com:steveicarus/iverilog
2019-11-21 18:35:55 -08:00
Stephen Williams
7cf8bb9875
Put some buffer overflow checks in.
...
Also, do a minor rework of StringHeap, and have it check its
assumptions more thoroughly.
2019-11-21 18:35:43 -08:00
Martin Whitaker
351a4e5f5e
Improve vvp handling of excessively large shift distances.
2019-11-16 12:11:49 +00:00
Martin Whitaker
0a4cae2644
Fix vvp %shift instructions to treat right operand as unsigned.
...
1364-2005 section 5.1.12 says "The right operand is always treated
as an unsigned number".
This fixes GitHub issue #283 .
2019-11-15 21:24:47 +00:00
Martin Whitaker
4a8f4d65d0
Fix spelling of pulsere_flag in vpi_user.h (from Pablo Bleyer).
2019-11-12 18:01:39 +00:00
Martin Whitaker
9f712429c8
Fix elaboration of void functions with no arguments (GitHub issue #281 )
...
N.B. commit 82c8a495 incorrectly referenced issue #281 . It should have
referenced issue #280 .
2019-11-09 20:16:25 +00:00
Martin Whitaker
a8f71d3c92
Additional cleanup of void function elaboration.
2019-11-09 20:15:31 +00:00
Martin Whitaker
cab9526e6c
vlog95 target: better solution for void functions with no arguments.
2019-11-09 20:14:57 +00:00
Martin Whitaker
39238fd1cd
vlog95 target: ! operator does not require explicit type conversion.
2019-11-09 16:52:28 +00:00
Martin Whitaker
58aa08ab64
Handle SV void functions in vlog95 target.
2019-11-09 16:14:09 +00:00
Martin Whitaker
82c8a49573
Fix for issue #281 - the condition operator may return a valid enum type.
...
If the condition expression is 2-state, the result won't be blended, so
the result will be a valid enum value if both true and false expressions
return the same enum type.
2019-11-09 13:11:16 +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
a621fa48a6
Merge branch 'sft-rework'
2019-11-04 22:24:45 +00:00
Martin Whitaker
d1d409fd88
Add version check for VPI routines callback.
2019-10-30 20:16:30 +00:00
Stephen Williams
eeeb9ff099
Create files with default suffix when $dumpfile doesn't include a suffix.
2019-10-30 12:23:24 -07:00
Stephen Williams
d718e7b468
Handle case that strings are arguments of functions/tasks.
...
When strings are arguments to functions/tasks, that doesn't suddenly
make them implicitly scalar. Strings are vectors and should be treated
that was, even if they are IMPLICIT_REG.
2019-10-29 22:58:48 -07:00
Martin Whitaker
16e8563c6e
Fix for GitHub issue #277 - incorrect sensitivity calculation.
...
The fix for the compiler hang when calculating the sensitivity list
for an always_comb construct containing recursive function calls
could cause the compiler to ignore sequential calls to the same
function, and thus not add the arguments of those calls to the
sensitivity list.
2019-10-28 21:01:42 +00:00
Martin Whitaker
9fb952ed72
Use functions instead of macros for VPI routine redirection in Windows.
2019-10-27 09:06:55 +00:00
Martin Whitaker
3f1253039a
Only use VPI routine jump table in Windows.
2019-10-25 10:07:57 +01:00
Martin Whitaker
f0326bc9c2
Fix bug in converting directory separators for MinGW.
2019-10-23 13:05:48 +01:00
Martin Whitaker
160bfbf2fc
Another makefile fix.
2019-10-23 13:03:32 +01:00
Martin Whitaker
c98f8b17ba
Support IVERILOG_VPI_MODULE_PATH in compiler driver.
...
Also make sure we convert '/' to '\' before doing any searches when
running in Windows.
2019-10-23 12:26:28 +01:00
Martin Whitaker
a8fc131fc9
Use more explicit name for VPI routine jump table.
2019-10-23 11:41:14 +01:00
Martin Whitaker
1c26bcef2d
Update vpi.txt.
2019-10-23 10:04:58 +01:00
Martin Whitaker
79d3a21b65
Minor code tidy-up.
2019-10-22 21:52:52 +01:00
Martin Whitaker
f5cb5b2d90
Make sure vlog_startup_routines is exported from Windows VPI modules.
2019-10-22 20:33:52 +01:00
Martin Whitaker
5f0bbe4cdb
One more makefile fix.
2019-10-22 20:30:09 +01:00
Martin Whitaker
e6b0396e6f
Makefile fixes.
2019-10-22 16:51:14 +01:00
Martin Whitaker
a59b183bd1
Allow VPI modules to be loaded by multiple clients under Windows.
...
The old scheme of linking the VPI modules with the vvp exports meant they
did not work when loaded by the compiler. Instead, let each client create
a jump table for the VPI routines and pass that to each VPI module as it
is loaded.
2019-10-22 16:00:13 +01:00
Martin Whitaker
e63135b412
Add -BM driver option to specify different base path for VPI modules.
...
This is needed for 'make check'.
2019-10-21 19:43:00 +01:00
Martin Whitaker
1c7f7aedbe
Update man page.
2019-10-21 15:33:39 +01:00
Martin Whitaker
8d3e895593
Remove obsolete SFT files.
2019-10-21 13:53:53 +01:00
Martin Whitaker
d1ae818a9f
Remove static system function return descriptors.
...
The information is provided by the VPI modules.
2019-10-21 13:49:19 +01:00
Martin Whitaker
a92a3074c0
Fix some missing/incorrect function return types in the system VPI modules.
2019-10-21 13:45:09 +01:00
Martin Whitaker
9f93989944
Extract system function return types from VPI modules, not SFT files.
2019-10-21 13:40:40 +01:00
Cary R
df38460d26
Add the missing ivl_stmt_case_quality to ivl.def
2019-10-20 16:35:31 -07:00
Cary R
077d8d6c4d
Update fstapi.c to latest from GTKWave
2019-10-20 16:35:24 -07:00
Martin Whitaker
1069a0ef02
Don't evaluate built-in system functions if they are overridden.
...
We don't support evaluating user-defined system functions at compile
time. If possible, defer evaluation until run time. If used in a
constant expression, output a "sorry" message.
2019-10-19 16:12:17 +01:00
Stephen Williams
bf655003e8
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-14 14:11:58 -07:00
Stephen Williams
0abf91ca4e
Make vvp exit with FAILURE if $fatal is used to exit the simulation.
2019-10-14 14:11:50 -07:00
Martin Whitaker
cb69a321ab
Enable user-defined system functions to override built-in functions.
...
Fixes bug reported on iverilog-devel on 2019-10-13.
2019-10-14 21:41:58 +01:00
Martin Whitaker
b82c185051
iverilog: Allow the user to specify the location of VPI modules.
...
Make it explicit in the manual that a path can be supplied with the -m
option, and when it is, search for a SFT file there, not in the base
directory.
2019-10-14 21:34:40 +01:00
Martin Whitaker
9f7dc732ab
Add error recovery for invalid cast expressions.
2019-10-11 19:04:23 +01:00
Martin Whitaker
d56e90c3f4
Fix casts to integer types.
...
Casting from signed to unsigned types and vice versa is legal in SV,
as is casting from a larger to a smaller size. Obey Verilog rules
for expression bit width and signedness.
2019-10-10 23:48:11 +01:00
Stephen Williams
1a40a6f902
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-09 09:02:57 -07:00
Stephen Williams
55efaf8769
Merge pull request #269 from nbrereton/features/nsb/check-case-handled
...
Validate that value is handled for case priority qualifier.
2019-10-09 09:00:31 -07:00
Stephen Williams
a5ddf129a4
Merge pull request #273 from pkrc267/master
...
corrected a few typos for better readability
2019-10-09 08:44:45 -07:00
Prakhar Yadav
f795e2be18
corrected a few typos for better readability
2019-10-09 21:02:08 +05:30
Stephen Williams
54d7d26933
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-07 13:21:22 -07:00
Stephen Williams
0d29bd7c1c
Add a little note about Xcode bison not cutting it.
2019-10-07 13:21:16 -07:00
Martin Whitaker
f2ca63a5a1
Disable debug output when debug_elaborate is not set.
2019-10-06 18:10:58 +01:00
Martin Whitaker
68a6fa06a2
Improve old code for detecting missing explicit cast.
2019-10-06 18:03:37 +01: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
Martin Whitaker
06a60cac01
For SystemVerilog, support localparam in module parameter port lists.
2019-10-06 08:44:51 +01:00
Nick Brereton
414fafda2b
Check that value is handled for case priority and unique qualifiers.
2019-10-05 21:42:17 -04:00
nbrereton
cce30e89bb
Merge pull request #1 from steveicarus/master
...
update
2019-10-05 21:04:03 -04:00
Stephen Williams
763cc9c162
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-05 16:23:16 -07: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
Cary R
b1699a2781
Fix two compiler warnings
2019-10-05 15:29:08 -07:00
Martin Whitaker
70da8db6b5
Fix assignment to scalar class property in tgt-vvp.
2019-10-05 20:12:52 +01:00
Martin Whitaker
862010ac19
SV does not require constant expression in variable initialisation.
2019-10-05 20:11:38 +01:00
Martin Whitaker
c86dc285cc
Fix for br1004 - fully support class construction in variable initialisation.
2019-10-05 20:10:11 +01:00
Martin Whitaker
c9d849ed7b
Fix style in iverilog man page.
2019-10-05 13:41:50 +01:00
Martin Whitaker
05641f386f
Add -g option to only enable supported assertion statements.
2019-10-05 13:37:03 +01:00
Martin Whitaker
455702810e
Add support for parsing (and ignoring) the other unsupported SV assertions.
2019-10-05 08:55:11 +01:00
Martin Whitaker
9167a236d8
Support import statements in packages and in the unit scope.
2019-10-03 19:44:44 +01:00
Stephen Williams
2ced291d33
Replace an assert with an internal error message.
2019-10-03 08:38:36 -07:00
Stephen Williams
4f48a7ed41
Fix assertion in error recovery.
2019-10-02 19:30:47 -07:00
Martin Whitaker
ed75bc22ec
Fix incorrect loop termination test when searching for typedefs.
2019-10-03 00:32:09 +01:00
Stephen Williams
1147881176
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-02 09:34:36 -07:00
Stephen Williams
30fbc020e6
Don't allow nil bytes in string literals.
2019-10-02 09:34:18 -07:00
Cary R
eeae2bfee9
Fix a syntax issue found while compiling with gcc 5.4
2019-10-01 18:58:28 -07:00
Martin Whitaker
7cead04e6a
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-02 00:16:18 +01:00
Stephen Williams
5651adf73a
Handle breakage in nested module parsing.
2019-10-01 15:19:46 -07:00
Martin Whitaker
9bb2147fb5
Merge branch 'package-imports-rework'
2019-10-01 23:04:23 +01:00
Stephen Williams
c62472f7ac
Merge branch 'master' of github.com:steveicarus/iverilog
2019-10-01 09:29:30 -07:00
Stephen Williams
da36cee8f0
Detect errors elaborating delay expressions.
2019-10-01 09:29:13 -07:00
Martin Whitaker
1cc872be8c
Downward references may also activate potential imports.
2019-10-01 09:08:15 +01:00
Martin Whitaker
1fca7b41a4
Delay potential imports for task/function calls until end of scope.
...
A local task/function definition takes precedence, even if it appears
after the call.
2019-10-01 09:08:07 +01:00
Martin Whitaker
17f0dd7e6e
Enable package imports in blocks.
2019-10-01 09:07:59 +01:00
Martin Whitaker
c5c264400e
Add support for package scope resolution for named events.
2019-10-01 09:07:54 +01:00
Martin Whitaker
12fe4f2bf3
Fix handling of wildcard-imported types.
...
Don't add them to the explicit imports until they are referenced legally.
Stop searching when a matching name is found, even if it isn't a type name.
2019-10-01 09:07:48 +01:00
Martin Whitaker
b0142a6406
Add support for named events in packages.
2019-10-01 09:07:39 +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
ea4e41207c
Update cppcheck standards that are checked
2019-09-30 22:14:15 -07:00
Stephen Williams
1d2259e0a7
Merge branch 'master' of github.com:steveicarus/iverilog
2019-09-30 13:14:58 -07:00
Stephen Williams
3cc6e74e38
Have $readmem() print a warning if there are too many digits in words.
...
If there are more digits than needed to fill a word, print a warning
message. The excess bits are thrown away, so there is no need for an
error.
2019-09-30 13:14:40 -07:00
Stephen Williams
d232335d9d
Merge pull request #267 from sielicki/master
...
replace deprecated yacc directives
2019-09-30 08:23:38 -07:00
Stephen Williams
80478db6cc
Support typedefs in class definitions.
2019-09-30 08:07:56 -07:00
Cary R
6d71870853
Merge branch 'master' of github.com:steveicarus/iverilog
2019-09-29 20:20:23 -07:00
Cary R
5047aa2839
Add support for recursive function support for always_* sensitivity
2019-09-29 20:20:10 -07:00
Stephen Williams
185586e5ec
Merge branch 'master' of github.com:steveicarus/iverilog
2019-09-29 18:37:39 -07:00
Stephen Williams
50d71c8512
Support for enumerations in classes.
2019-09-29 18:27:27 -07:00
Cary R
e4ef928751
Fix some space issues
2019-09-29 17:11:19 -07:00
Cary R
ba82ef463e
Fix some always_* issues
2019-09-29 16:59:59 -07:00
Nicholas Sielicki
031caca8ca
replace deprecated yacc directives
...
bison 3.4.2 complains when encountering '%pure-parser':
"warning: deprecated directive, use ‘%define api.pure’"
A quick google suggests this option has been around since at least
2012, maybe longer, so probably safe to replace.
Signed-off-by: Nicholas Sielicki <[email protected] >
2019-09-29 18:19:45 -05:00
Cary R
8a85d62ec7
Update to latest GTKWave files
2019-09-29 09:59:56 -07:00
Martin Whitaker
e73da43cc1
Remove obsolete checks for name collisions during elaboration.
...
This is now handled by the parser.
2019-09-27 22:19:30 +01:00
Martin Whitaker
439688fa46
Add anonymous enums to the scope local symbols.
2019-09-27 22:19:30 +01:00
Martin Whitaker
2ae910750b
Put generate case item block names in correct scope.
...
The compiler creates an artificial scope around the case items. We need
to add the block names to the real containing scope.
2019-09-27 22:19:30 +01:00
Martin Whitaker
03c4c63df1
Fix file/line reported for duplicate named blocks.
2019-09-27 22:19:30 +01:00
Martin Whitaker
628f5645bf
Fix file/line reported for duplicate parameter declarations.
...
We need to retain the old parameter information until we have reported
the error.
2019-09-27 22:19:30 +01: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
b88d91c617
Create new base class for all named items that can be added to a scope.
...
Provide a helper function to identify the derived classes when reporting
errors.
2019-09-27 22:19:30 +01:00
Martin Whitaker
269ec2f042
Remove redundant checks for package imports during parsing.
...
The find_* and symbol_search functions now handle this.
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
Stephen Williams
d7ee6bb6bb
Support struct member part selects in l-values.
2019-09-27 13:51:51 -07:00
Stephen Williams
65aff65344
Better job choosing unique scope-local symbols during elaboration.
2019-09-25 12:18:41 -07:00
Stephen Williams
ecd7b39244
Merge branch 'master' of github.com:steveicarus/iverilog
2019-09-24 15:05:51 -07:00
Stephen Williams
7b66de0711
Handle nested packed strucdts in r-values.
2019-09-24 15:05:39 -07:00
Martin Whitaker
714b211d9f
Document the iverilog '-i' option in the man page.
2019-09-23 20:10:38 +01:00
Martin Whitaker
abd63e80e1
With '-i', don't return an error when there are no top-level modules.
...
The '-i' option is there to allow the compiler to be used to check an
incomplete design for errors. With no top-level modules, nothing will
be elaborated, but at least will be checked for syntax errors.
2019-09-23 20:05:03 +01:00
Martin Whitaker
791c056b77
Document -gassertions/-gno-assertions in driver man page.
2019-09-20 21:30:43 +01:00
Martin Whitaker
823a508d6b
Implement SV immediate assertions.
2019-09-20 21:30:43 +01:00
Stephen Williams
9e10645722
Merge branch 'master' of github.com:steveicarus/iverilog
2019-09-17 14:12:43 -07:00
Stephen Williams
2aa7700970
Add support for packed arrays in nested struct l-values.
2019-09-17 13:34:36 -07:00
Stephen Williams
1c281c2d77
Support nested struct l-values.
2019-09-16 13:50:17 -07:00
Martin Whitaker
41ac0b2621
Include wires in items imported by an "import ::*".
2019-09-16 20:42:32 +01:00
Martin Whitaker
d6391490e3
Resize vector before assigning to a dynamic array word.
...
Failing to do this leads to an assertion failure in vvp.
2019-09-16 20:39:19 +01:00
Martin Whitaker
02ee1c65d0
Support dynamic array initialisation in variable declarations.
2019-09-16 20:35:27 +01:00
Stephen Williams
b639c4c9aa
Clean up some debug dump formatting.
2019-09-15 21:17:16 -07:00
Martin Whitaker
832adc5c74
Improve handling of invalid packed and unpacked dimensions.
...
As reported on iverilog-devel on 2018-10-12, a dimension size of zero
could case the compiler to go into an infinite loop. Further tests
showed that unsized or queue dimensions entered as packed dimensions
would cause the compiler to crash.
2019-09-14 09:10:52 +01:00
Martin Whitaker
a6bcbc3d1d
Remove obsolete private VPI functions.
2019-09-13 08:40:58 +01:00
Martin Whitaker
a0ef6c4b62
Fix design dump to correctly report cast operations.
2019-09-11 22:14:03 +01:00
Martin Whitaker
c066e2d15c
Properly implement casts from strings and dynamic arrays to vectors.
...
As discussed on iverilog-devel (2018-03-09), the existing implementation
(using Icarus-specific vpi functions) only worked with assignments to
simple variables, and could not be easily modified to work more generally.
So use the new vvp instructions added in the previous two commits.
2019-09-11 22:08:46 +01:00
Martin Whitaker
1aa22735ce
Add new %cast/vec2/dar and %cast/vec4/dar instructions to vvp.
2019-09-11 21:56:27 +01:00
Martin Whitaker
74ff44314e
Add new %cast/vec4/str instruction to vvp.
2019-09-11 21:56:09 +01:00
Martin Whitaker
34bb98676a
Fix assertion failure on illegal SV cast.
...
Bug reported on iverilog-devel on 2018-02027.
2019-09-07 14:35:19 +01:00
Martin Whitaker
b43fcccc0f
Add support for PATHPULSE, PATHPULSEPERCENT, and PERIOD in SDF parser.
...
As requested on iverilog-devel. These are all parsed then ignored for now.
2019-08-24 00:23:29 +01:00
Martin Whitaker
3bdb50da29
Schedule UDP initial 0/1 assignments to occur during time 0.
...
This allows any always processes that are sensitive to the UDP output
to start first. This fixes a time 0 race that was found in a Lattice
Semiconductor simulation library (reported on iverilog-devel).
If the initial value is 'x', propagate the value to the UDP output
before the start of simulation, to avoid unwanted update events on
the z -> x transition on downstream nets.
2019-08-09 21:00:10 +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
7fa781d5f3
Re-enable disabled compiler warnings for Windows builds.
2019-08-03 12:41:38 +01:00
Martin Whitaker
326945329e
Add note that bison 2.3 is known to generate bad code (br1028).
2019-08-02 15:45:20 +01:00
Martin Whitaker
e97883b1db
Fix for br1015 : assertion failure when task/function port is an array.
...
This is an error for Verilog and not yet supported for SystemVerilog.
2019-08-02 15:34:31 +01:00
Martin Whitaker
866cc46915
Fix for GitHub issue #256 - don't use V as Makefile variable name.
...
Some build systems override V on the make command line, wrongly assuming
it is the automake verbose option.
2019-08-02 10:27:40 +01:00
Martin Whitaker
b7769dd059
Merge branch 'fix-cfparse-include-order' of https://github.com/StefanBruens/iverilog
2019-08-01 19:13:31 +01:00
Martin Whitaker
10168d542c
Change minimum gperf version to 3.0.
...
vhdlpp uses the --ignore-case option, which isn't supported in 2.7.
2019-08-01 19:11:44 +01:00
Martin Whitaker
c383d2048c
Fix initialisation of vvp symbol table values.
...
In 64-bit Windows, an unsigned long is 32 bits, so initialising the num
member of the union did not properly initialise the ptr member. The num
member isn't actually needed, so eliminate it.
2019-08-01 12:34:47 +01:00
StefanBruens
d58fde6f36
Fix redefinition of YYLTYPE struct caused by wrong include order
...
cfparse.h defines the YYLTYPE struct in case it has not been defined, and
also declares an extern YYLTYPE cflloc which is used in cflexor.
As cfparse_misc.h defines an extended YYLTYPE, the cflloc instance in
cfparse.c has this extended type, i.e. there is a type mismatch.
Changing the include order in cflexor causes both cflexor.c and
cfparse.c to use the definition from cfparse_misc.h.
This has been uncovered by GCC when using LTO:
---
gcc -flto=8 main.o substit.o cflexor.o cfparse.o -o iverilog
cfparse.h:105:16: warning: type of 'cflloc' does not match original declaration [-Wlto-type-mismatch]
105 | extern YYLTYPE cflloc;
| ^
cfparse.c:1162:9: note: type 'struct cfltype' should match type 'struct YYLTYPE'
1162 | YYLTYPE yylloc
| ^
cfparse.c:1162:9: note: 'cflloc' was previously declared here
cfparse.c:1162:9: note: code may be misoptimized unless '-fno-strict-aliasing' is used
---
2019-07-26 21:26:08 +02:00
Martin Whitaker
893bb62d82
Fix broken 'make install' in MSYS2.
...
The commands added to copy MINGW DLLs into the install directory only
work when cross-compiling.
2019-07-26 17:29:27 +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
8402696676
Fix VPI interface to APV objects.
...
- type is vpiPartSelect, not vpiMemoryWord
- left/right range is for part, not full word
- index is not valid for a part select
The user will now get a sensible error message if they pass part of an
array word to $dumpvars (GitHub issue #230 ).
2019-07-25 08:58:00 +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
Martin Whitaker
8cd8bed22e
Fix GitHub issue #243 - support arbitrary width static bit arrays in vvp.
2019-07-24 09:15:44 +01:00
Martin Whitaker
89cbc42094
Reset parser tracking variables when starting a new compilation unit.
...
This fixes the problem reported in GitHub issue #254 , where if the
parser aborted on one compilation unit, spurious errors were reported
for the next compilation unit.
2019-07-23 22:18:39 +01:00
Martin Whitaker
acdd78db7d
Merge branch 'primitive_redefinition' of https://github.com/thasti/iverilog
...
- make primitive redefinition a warning, not an error
- make edge-sensitive ifnone a warning, not an error
This allows Icarus to be used to simulate designs using third-party
cell libraries that contain such things.
2019-07-23 21:53:57 +01:00
Stefan Biereigel
ca19ebe5d5
remove Error:/Warning: prefix from VLerror/VLwarn
2019-07-23 18:58:20 +02:00
Martin Whitaker
4055752959
Fix white space errors.
2019-07-23 10:08:37 +01:00
Martin Whitaker
93ea864106
Merge branch 'antmicro-attribute_support'
2019-07-23 10:06:57 +01:00
Maciej Kurc
b619b43ddd
Added support for parsing attributes on function calls
...
Signed-off-by: Maciej Kurc <[email protected] >
2019-06-05 16:42:52 +02:00
Maciej Kurc
e6fa2625a4
Added support for parsing attributes on port connections
...
Signed-off-by: Maciej Kurc <[email protected] >
2019-06-05 16:28:45 +02:00
Martin Whitaker
5bb6c7f53a
Fix makefile rules for header files generated by bison.
...
bison 3.4.1 writes the header file before the c++ file. Our makefile
rules make the header files depend on the c++ files, so we need to
fix the timestamps accordingly.
2019-06-02 18:50:18 +01:00
Stefan Biereigel
c6cf83a13a
make ifnone-error a warning
2019-05-17 16:17:08 +02:00
Stefan Biereigel
0cfb66ecbc
fix warning call
2019-05-17 15:32:45 +02:00
Stefan Biereigel
7f5145d758
emit only warning for primitive redefinition
2019-05-17 15:20:49 +02:00
Cary R
e93ee3967e
Update cppcheck suppression file
2019-05-14 22:34:58 -07:00
Cary R
4c58b88792
Update files from GTKWave
2019-05-14 22:34:34 -07:00
Martin Whitaker
ffb34861cf
Fix GitHub issue #244 : handle mixed signed/unsigned power operations.
...
The signed version of the power operation in vvp should only be used
if the exponent is signed. Both signed and unsigned versions will
produce the correct result regardless of the type of the base operand,
provided it has been appropriately extended to the result size.
2019-05-11 21:33:29 +01:00
Martin Whitaker
c4f71db00a
Update some comments.
2019-05-10 20:00:04 +01:00
Cary R
a9388a895e
Update cppcheck waivers
2019-03-26 22:43:03 -07:00
Cary R
407b5a1d7a
Update fstapi.c to the latest from GTKWave
2019-03-26 19:59:18 -07:00
Stephen Williams
cc921de717
Improve mingw cross instructions.
2019-03-24 10:42:36 -07:00
Stephen Williams
a518d594d2
Merge pull request #135 from udif/cross_compile
...
Fixed cross-compile using mingw 64 bit under Windows 10 Linux subsyst…
2019-03-24 10:28:23 -07:00
Stephen Williams
c3575d379b
Merge branch 'master' into cross_compile
2019-03-24 10:27:33 -07:00
Martin Whitaker
51a13e883a
Fix for GitHub issue 235: segfault when calling vpi_handle_by_name().
...
When vpi_handle_by_name() iterates over the VPI objects in a scope, handle
the case that vpi_get_str() returns a null value. This currently occurs if
the scope contains an enum type definition, as vpi_get_str() is not
implemented for __vpiEnumTypespec.
2019-03-23 17:21:40 +00:00
Tomasz Hemperek
45fa3b1dec
cleanup travis.yml
2019-03-23 16:29:09 +01:00
Stephen Williams
df92caadbc
Document cross-compile from Linux to Windows.
...
This uses the mingw32 tool chain on Linux to build Windows
binaries.
2019-03-22 13:57:38 -07:00
Stephen Williams
c3d5b23ac4
Fix some Windows build issues.
2019-03-22 08:08:29 -07:00
Martin Whitaker
9369d6db57
Update README to say "or later" for build tool versions.
2019-03-16 12:40:08 +00:00
martinwhitaker
3b32288c6f
Merge pull request #232 from cdlscpmv/fix
...
Fix a typo in the man page
2019-03-16 12:32:00 +00:00
Konst Mayer
f95ae911d0
Fix a typo in the man page
2019-03-13 00:16:41 +07:00
Martin Whitaker
dc5429e5e7
Fix assertion failure on assignment to part of variable member (GitHub issue #226 )
...
For now, output a "sorry" message, as the compiler doesn't support this.
2019-01-26 17:36:19 +00:00
Martin Whitaker
2ff6af254b
Use LLONG_MIN instead of LONG_LONG_MIN.
...
GCC 8 no longer defines LONG_LONG_MIN. We already assume a C99 compliant
compiler in other places.
2019-01-26 16:47:28 +00:00
Martin Whitaker
e745304cc4
Fix for GitHub issue #224 - import * does not import enum members.
2019-01-15 19:58:37 +00:00
Martin Whitaker
7cd078e7ab
Restrict cast type to what's allowed by the IEEE standard.
2018-12-15 12:26:33 +00:00
Martin Whitaker
230f0bc13c
Fix GitHub issue #219 and #220 - incorrect results from SV size cast.
2018-12-15 11:11:35 +00:00
Cary R
172d7eb0a3
Fix space issues in a couple files
2018-11-13 21:57:46 -08:00
Tomasz Hemperek
5cb562be48
No clang for travis.
2018-11-03 22:43:16 +01:00
Tomasz Hemperek
5911fbf872
Merge remote-tracking branch 'upstream/master'
2018-11-03 22:22:41 +01:00
Tomasz Hemperek
cbe9bba291
Add windows build to travis-ci
2018-11-03 21:35:13 +01:00
Tomasz Hemperek
a96609d482
Update .travis.yml
2018-11-03 08:15:22 +01:00
Tomasz Hemperek
8b67c9ff62
Update .travis.yml
2018-11-03 08:07:11 +01:00
Martin Whitaker
3612076943
Undo redefinition of unique_ptr at end of header files.
...
It seems that clang both defines __cplusplus < 201103L and provides
unique_ptr (GitHub issue #215 ).
2018-11-02 21:22:10 +00:00
Martin Whitaker
6887c31d8c
Refactor vpi module path code.
...
Also restore the original behaviour of the '-M -' option, although it's
probably not needed now we add the default path last.
2018-10-29 20:33:52 +00:00
Martin Whitaker
dd33da0d5b
Merge branch 'alexforencich-master'
2018-10-29 19:37:33 +00:00
Alex Forencich
a1ad6d4b51
Support IVERILOG_VPI_MODULE_PATH environment variable
2018-10-28 12:44:09 -07:00
Alex Forencich
a638d1eed0
Check for too many paths specified and fix path priority so paths specified on command line supersede built-in paths
2018-10-28 12:43:40 -07:00
Cary R
844fa056f7
Update fstapi files to the latest from GTKWave
2018-10-12 21:30:20 -07:00
Martin Whitaker
fdf353af29
Don't use MinGW strtod workaround when building for MinGW-w64.
...
The host triplet for MinGW-w64 has changed to more closely match that
for MinGW, so we need to update the pattern in the test.
2018-10-07 23:49:19 +01:00
Martin Whitaker
2f142c4858
Revert "Fix x86_64-w64-mingw32 build: undefined ___strtod"
...
This reverts commit bef04508f2 .
2018-10-07 23:47:26 +01:00
Martin Whitaker
9d0d1938dc
Fix bug in output of null character with %c format.
2018-10-07 18:59:53 +01:00
Martin Whitaker
5aae9ea770
Fix bit width when converting real value to binary/hex string in VPI.
2018-10-07 17:17:33 +01:00
Martin Whitaker
a03995b4da
Fix another implicit fallthrough warning.
2018-10-07 11:23:40 +01:00
Martin Whitaker
5cd0ba08b1
Fix alloc size warning when building with recent GCC.
2018-10-06 23:25:13 +01:00
Martin Whitaker
6415d84ed5
Fix invalid cast of TF sizetf callback.
2018-10-06 22:56:04 +01:00
Martin Whitaker
3e25b04685
SIGHUP is not available in Windows.
2018-10-06 21:07:13 +01:00
Martin Whitaker
4ea18196c8
Fix deprecated dynamic exception specification warnings.
2018-10-06 21:02:41 +01:00
Martin Whitaker
e71a76a1e2
Fix signed/unsigned comparison warning.
2018-10-06 20:40:54 +01:00
Martin Whitaker
0d20c50de4
Fix typo in last commit.
2018-10-06 20:22:12 +01:00
Martin Whitaker
f1608e163f
Fix implicit fallthrough warnings when building with recent GCC.
2018-10-06 20:15:42 +01:00
Cary R
27b5c2cdc8
Merge branch 'master' of github.com:steveicarus/iverilog
2018-10-06 09:27:10 -07:00
Cary R
7fa6eaef0a
Update to latest GTKWAve files
2018-10-06 09:26:39 -07:00
Martin Whitaker
78317a2799
Fix auto_ptr deprecated warnings when building with recent GCC.
2018-10-06 17:15:31 +01:00
Martin Whitaker
542fe2cf77
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.
2018-10-06 11:48:19 +01:00
Martin Whitaker
603ff303f5
Cleanly terminate vvp on SIGHUP or SIGTERM (GitHub issue #203 ).
2018-09-29 23:25:04 +01:00
Martin Whitaker
b066a5815e
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.
2018-09-29 21:22:17 +01:00
Martin Whitaker
0d494da702
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'
2018-09-29 12:04:16 +01:00
Martin Whitaker
8df2f0cadf
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.
2018-09-28 10:03:06 +01:00
Cary R
3f24557e90
Add some more always_ff synth checks
2018-09-23 22:32:22 -07:00
Cary R
e6f957b0b6
Add support for a constant $countbits() function
2018-09-03 15:58:57 -07:00
Cary R
1da9b2cea0
Add support for constant $countones, $isunknown, $onehot, $onehot0
2018-09-03 08:32:41 -07:00
Cary R
2b030ce27a
Update the bit vector table name
2018-09-03 08:32:35 -07:00
Cary R
b35f9e13c7
Move the bit vector functions to the SV table
2018-09-03 08:32:28 -07:00
Cary R
40558160e7
Add support for bit vector system function in vpi
2018-08-30 22:31:15 -07:00
Cary R
ff8ccc0b3e
Update fstapi.c to the latest version
2018-07-16 09:03:38 -07:00
Martin Whitaker
11c826216a
Fix for GitHub issue #198 - support octal display for thread variables.
2018-06-12 22:58:07 +01:00
Martin Whitaker
7ad5b59a6f
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++.
2018-06-12 21:59:58 +01:00
Martin Whitaker
6e49ab10ec
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.
2018-05-14 22:14:51 +01:00
Martin Whitaker
87c01c55c0
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.
2018-05-14 22:13:56 +01:00
Martin Whitaker
5a4e99b0e8
Fix br1029 - correct rounding when vpi_get_value converts real to integer string.
2018-05-12 23:49:11 +01:00
Stephen Williams
6c39348d1a
Merge branch 'master' of github.com:steveicarus/iverilog
2018-04-11 13:40:04 -07:00
Stephen Williams
6c9b3c39b4
Add the --ccflags option to iverilog-vpi
2018-04-11 13:39:53 -07:00
Stephen Williams
797fe44011
Merge pull request #186 from anparks/master
...
Fixed install step misnomer in README
2018-03-28 12:42:37 -07:00
Aaron Parks
fdaf923532
Fixed install step misnomer in README
2018-03-28 12:24:47 -07:00
Stephen Williams
64618af4a9
Merge pull request #123 from dcandrade/master
...
Added missing compilation instruction on README
2018-03-26 09:55:34 -07:00
Martin Whitaker
5cfb7d68ae
Add support for rtran switches in vvp.
2018-02-23 22:30:32 +00:00
Martin Whitaker
36eef5154f
Implement supply->strong strength reduction for non-resistive switches.
...
As specified in 1364-2005 section 7.11.
2018-02-23 22:07:59 +00:00
Martin Whitaker
69d80839a5
Improved check for missing task/function port direction.
2018-02-21 20:07:13 +00:00
Martin Whitaker
6b1b402a79
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'.
2018-02-20 20:59:26 +00:00
Martin Whitaker
f8a2a4816c
Enable parameter/localparameter definitions in the compilation unit scope.
2018-02-18 19:21:18 +00:00
Martin Whitaker
2a21fe77ac
Output an error message when a SV variable declaration reuses a name.
...
Assertion failures are not the right way to handle user code errors.
2018-02-18 17:51:56 +00:00
Martin Whitaker
caf83b02c1
Enable variable declarations/initialisations in the compilation unit scope.
2018-02-18 14:09:03 +00:00
Martin Whitaker
0f95770418
Include compilation units in pform dump.
2018-02-18 12:53:29 +00:00
Cary R
e7a9662b3d
A #0 is not allowed in a final block
2018-01-01 21:35:26 -08:00
Cary R
24a4ec3bb2
Hide the always_comb/latch TO event by not attaching it to a scope.
2018-01-01 21:19:58 -08:00
Cary R
ca01385797
The synth check needs to check the task scope
2017-12-28 08:50:32 -08:00
Cary R
932241ee87
Check system/user tasks for always_comb/ff/latch synth.
2017-12-27 23:08:32 -08:00
Cary R
7d11fa662e
Fix space issues
2017-12-27 14:51:56 -08:00
Cary R
2bbd077dc9
Add some synthesis checks for the always_comb/ff/latch blocks
2017-12-27 14:51:17 -08:00
Stephen Williams
0caa109174
Merge pull request #181 from phire/portinfo_grammar
...
vvp grammar: .port_info statements should require/generate semicolons.
2017-12-18 10:04:42 -08:00
Scott Mansell
d01e5accc0
vpp: Require semicolon after .port_info statements
...
Optional until 12.0
2017-12-17 00:06:09 +13:00
Scott Mansell
7b84b29bbc
tgt-vvp: Output semicolon after .port_info statements
...
Backwards compatablity is perserved due to the parser interperting the
unexpected semicolon as an empty statement.
2017-12-16 23:59:48 +13:00
Cary R
9a8212a54f
Update tp the latest files from GTKWave
2017-12-13 21:56:59 -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
39c14edb76
The delay for a join_any and join_none is different than join
2017-12-05 21:49:52 -08:00
Cary R
c38ca2114b
Note the always_comb/ff/latch have not been looked at for synthesis
2017-12-03 20:17:42 -08:00
Cary R
db1ea05452
Fix #0 to trigger in the inactive region and add a trigger for always_comb/latch
2017-12-03 20:17:42 -08:00
Cary R
a5b945f8f5
Initialize the t0 trigger value to false.
2017-12-03 20:17:42 -08:00
Cary R
e611e8acc0
Add support to convert always_comb/latch to vlog95
2017-12-03 20:17:42 -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
Cary R
c68a7fede3
Fix spacing
2017-11-20 07:30:52 -08:00
Cary R
3fc9ad2db0
Add support for the wild compare operators ==? and !=?
2017-11-17 19:32:50 -08:00
Cary R
d23b046203
Update the enumeration methods to set their width test attributes correctly
2017-11-17 13:09:14 -08:00
Cary R
21418c6a41
Fix a couple memory leaks in $sdf_annotate()
2017-11-16 19:42:07 -08:00
Cary R
f03033e612
Update flex destroy routines to work for version 2.6 and greater
2017-11-16 19:11:50 -08:00
Martin Whitaker
d1487c10f1
Fix shadow warning when using older versions of gcc.
2017-11-08 21:23:22 +00:00
Martin Whitaker
ad83a135e5
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.
2017-11-08 20:35:18 +00:00
Martin Whitaker
0f2ce7da45
Fix for GitHub issue #172 : don't use %precedence in parser.
...
Older versions of bison don't support this. Use %nonassoc instead.
2017-11-08 20:20:04 +00:00
Martin Whitaker
c0845d8bea
Fix assertion failure when using -Wmacro-redefinition, -y, and -D.
...
Predefined macros get stored in the precompiled macro file that gets
read back in when processing library files. This means the predefined
macros get processed twice. We need to skip the check in this case.
2017-11-08 20:07:38 +00:00
Martin Whitaker
02daffc97e
Add option to only warn about macro redefinitions that change the text.
...
A common use case (prior to the introduction of localparam) was to
use macros to define constant values, and to put global constant
values in an include file that gets included by each source file.
This will generate a lot of spurious warnings if we warn about all
redefinitions. Make this new option the default for -Wall.
2017-11-08 19:50:42 +00:00
Martin Whitaker
c622d372f9
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.
2017-11-07 18:48:48 +00:00
Martin Whitaker
1f85cd4154
Merge branch 'nekromant-master'
...
Adds warning about macro redefinition (GitHub pull request #168 ).
2017-11-06 21:07:47 +00:00
Martin Whitaker
af1ea13c47
Don't check for macro redefinition if the warning is disabled.
...
And reword the comment to be a bit less dictatorial.
2017-11-06 21:03:03 +00:00
Martin Whitaker
e408550d9d
Merge branch 'master' of https://github.com/nekromant/iverilog into nekromant-master
2017-11-06 20:59:27 +00:00
Martin Whitaker
f83e01847a
Fix a couple of minor bugs in the timescale parsing rework.
2017-11-06 00:37:56 +00:00
Martin Whitaker
479af09cc3
Fix trailing whitespace.
2017-11-05 22:28:53 +00:00
Martin Whitaker
fd807a7700
Rework handling of timescales in parser.
...
This implements and enforces the full set of rules for determining
timescales in SystemVerilog. The previous relaxation of the rules
that allowed timescales to be redefined within the compilation unit
scope has been removed. Time unit and precision redeclarations are
now recognised after a nested module declaration.
2017-11-05 17:50:05 +00:00
Martin Whitaker
9382d22063
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.
2017-11-05 09:39:21 +00:00
Martin Whitaker
e54d19e2d2
Fix $printtimescale to support 10s and 100s values.
2017-11-05 09:28:19 +00:00
Martin Whitaker
913fb34799
Add support for the $unit scope identifier.
...
This relies on using the automatically generated name for the unit scope.
This could collide with an escaped identifier, so it would be better to
identify the scope by a reference to the PPackage object, but for now,
do it the easy way.
2017-10-31 20:39:49 +00:00
Martin Whitaker
988816c0b1
Support separate compilation units in SystemVerilog.
...
The compilation unit scope is now treated as a specialised form of
package (with an automatically generated name). All items declared
outside a design element are added to the current compilation unit
package. Apart from when searching for a symbol, once we get into
elaboration we can treat these just like any other package.
2017-10-31 20:38:59 +00:00
Martin Whitaker
dfddbea26b
First step towards supporting separate compilation units in SV.
...
This adds a -u option to the driver to allow the user to specify that
they want each source file to be treated as a separate compilation
unit, and modifies the compiler to accept a list of files (either on
the command line or via a file specified by a new -F option). This
list of files is then preprocessed and parsed separately, causing all
compiler directives (including macro definitions) to only apply to the
file containing them, as required by the SystemVerilog standard.
2017-10-31 20:36:27 +00:00
Cary R
7d78f5b2ea
A few updates based on cppcheck results
2017-10-23 00:22:01 -07:00
Cary R
d9478bd837
Update cppcheck waiver files
2017-10-23 00:21:51 -07:00
Cary R
97e2123724
Update to latest files from GTKWave
2017-10-22 19:41:14 -07:00
Andrew Andrianov
3e87a4d242
driver: Add -Wno-macro-redefinition, properly pass -Wredef to ivlpp
...
Signed-off-by: Andrew Andrianov <[email protected] >
2017-10-22 13:53:07 +03:00
Andrew Andrianov
9e2252bc39
ivlpp: Actually take warn_redef flag into account
...
Signed-off-by: Andrew Andrianov <[email protected] >
2017-10-22 13:28:15 +03:00
Andrew Andrianov
94e42e5bfc
driver: Update manpage
...
Signed-off-by: Andrew Andrianov <[email protected] >
2017-10-19 11:40:50 +03:00
Andrew Andrianov
6c2fba1139
driver: Implement -Wr handling for macro redefinitions
...
Signed-off-by: Andrew Andrianov <[email protected] >
2017-10-19 11:40:07 +03:00
Andrew Andrianov
0c84413347
ivlpp: Add -Wredef option to enable redefinition warnings
...
Signed-off-by: Andrew Andrianov <[email protected] >
2017-10-18 19:18:14 +03:00
Martin Whitaker
4f383a8a11
Enable base class tasks to be used in an extended class.
2017-10-08 21:16:50 +01:00
Martin Whitaker
87cddf33dc
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.
2017-10-08 21:15:11 +01:00
Martin Whitaker
5ca058bfb5
Add support for darray initialisation from another darray.
...
Fixes GitHub issue #164 .
2017-10-08 17:51:33 +01:00
Martin Whitaker
1aeaafa96c
Add support for vec4 darray initialisation from an array pattern.
...
This was just a missing case label in tgt-vvp.
2017-10-08 17:41:58 +01:00
Martin Whitaker
8a36849fda
Generate proper error messages for invalid dynamic array initialisers.
...
Invalid user code should not result in an "internal_error".
2017-10-08 12:59:30 +01:00
Andrew Andrianov
73167563d5
ivlpp: Warn about macro redefinition
...
Verilog spec has a very nasty system of macros jumping from
file to file, resulting in a global macro scope. We abosolutely
MUST track macro redefinitions and warn user about them.
Signed-off-by: Andrew Andrianov <[email protected] >
2017-10-08 14:22:40 +03:00
Martin Whitaker
e315cafa01
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.
2017-10-07 16:41:26 +01:00
Martin Whitaker
85fa24fa58
Fix for br1025 : support nested scopes in root level tasks/functions.
2017-10-04 21:31:56 +01:00
Martin Whitaker
3566ff4cd4
Fix for GitHub issue #163 : assertion failure caused by syntax error in task.
2017-09-28 19:24:04 +01:00
Martin Whitaker
a1a7f5deff
Fix error in last commit.
2017-09-17 19:58:13 +01:00
Martin Whitaker
0bed890bc6
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.
2017-09-17 19:48:54 +01:00
Martin Whitaker
c855b8926e
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).
2017-09-11 21:49:35 +01:00
Martin Whitaker
ac87138c44
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.
2017-08-12 12:23:43 +01:00
Cary R
917d754e37
Fix space issue
2017-07-22 13:00:50 -07:00
Daniel Andrade
7362c7cbf8
Clarifying compilation instructions
2017-06-30 20:41:55 -03:00
Cary R
62e0f59b07
No need for class in previous patch
2017-06-19 21:26:24 -07:00
Cary R
10ef0eb109
Fix class versus struct warning in clang
2017-06-19 21:26:16 -07:00
Martin Whitaker
42422d9940
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.
2017-06-16 20:56:31 +01:00
Martin Whitaker
e2be64558b
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.
2017-06-15 09:11:11 +01:00
Martin Whitaker
3de7c234f7
Implement vpi_put_value() for named events (GitHub issue #158 ).
2017-06-15 08:47:29 +01:00
Martin Whitaker
8a5cbd4415
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.
2017-04-21 21:37:17 +01:00
Stephen Williams
0f57cceecc
Merge pull request #154 from 8tab/depfile
...
Return if unable to open dependencies file
2017-04-10 09:43:05 -07:00
8tab
cac5388451
Return if unable to open dependencies file
...
Return and print an error if iverilog is unable to open dependencies
file. User can pass e.g path to existing directory in '-M' option,
which makes fopen to return NULL followed by crash in fclose.
2017-04-09 23:18:49 +02:00
Stephen Williams
02ed16a50e
Merge pull request #151 from tumik/master
...
Added an option for ignoring errors about missing modules
2017-03-22 15:33:58 -07:00
Mikael Tuomisalo
c967ed238c
Added option for ignoring errors about missing modules
2017-03-21 17:34:44 +02:00
Stephen Williams
135b7fba7e
Merge pull request #149 from jersey99/master
...
Add support to handle attributes at module instantiation sites.
2017-03-16 09:38:04 -07:00
Vamsi Vytla
cfd3b893be
Add support to handle attributes at module instantiation sites.
...
(* my_fancy_attribute *)
foobar1 foobar (clk(clk), rst(rst) ...);
- Modifies PGModule to hold the attribute map (can be verified with pform_dump)
- pform_make_modgate(s) bind the attributes from the parser to the above map
- The attributes from PGModule are inserted into the NetScope of that module
PGModule::elaborate_scope_mod_instances_
- Currently these attributes automatically make it into netlist
- These attributes are accessible via ivl_scope_attr_cnt and ivl_scope_attr_val
from ivl_target.h
2017-03-16 07:41:10 -07:00
Stephen Williams
fbd69e1774
Merge pull request #148 from Jesus89/mingw-fix
...
Fix x86_64-w64-mingw32 build: undefined ___strtod
2017-02-27 15:12:12 -08:00
Jesús Arroyo Torrens
bef04508f2
Fix x86_64-w64-mingw32 build: undefined ___strtod
2017-02-24 10:43:30 +01:00
Stephen Williams
a427440054
Merge branch 'master' of github.com:steveicarus/iverilog
2017-02-17 10:40:14 -08:00
Johann Klammer
8bccbe7cb5
fix for const eval
2017-02-17 09:55:39 -08:00
Martin Whitaker
3c91630b53
Improved error checking for defparam values supplied on the command line.
...
Fixes GitHub issue #139 plus various assertion failures when invalid
values are specified.
2017-01-29 20:13:01 +00:00
Martin Whitaker
8f6f999ea7
Fix for GitHub issue #142 - assertion failure when parameter expression
...
contains undefined variable.
2017-01-29 10:47:54 +00:00
Martin Whitaker
4e2ba29dc6
Add library search path option to iverilog-vpi (GitHub issue #145 ).
2017-01-29 09:32:14 +00:00
Stephen Williams
221084d838
Sorry message for procedural assertion statements.
2017-01-10 11:38:38 -08:00
Cary R
3d9e777ae5
Allocate the correct amount of memory when escaping a string
2017-01-08 20:46:20 -08:00
Udi Finkelstein
7cf279b8a5
Turn off warnings caused by gcc 6.2.0 as installed by the MSYS2 mingw32
...
package. This probably affects all gcc 5.x installs as well.
2017-01-02 22:46:07 +02:00
Johann Klammer
c79df7c44b
fix failing VPI callbacks the vpip_cur_task was left dangling
2017-01-01 17:44:54 -08:00
Stephen Williams
6e5558e67d
Trivial fixes to pform dumps.
2016-12-29 09:39:45 -08:00
Udi Finkelstein
a3bedb8e00
mingw installs now also pack the required DLLs.
2016-12-11 16:18:36 +02:00
Udi Finkelstein
f48b0e3434
Allows compiling for Windows (32 or 64 bits) under Linux.
2016-12-11 03:40:35 +02:00
Udi Finkelstein
2127680e49
Fixed cross-compile using mingw 64 bit under Windows 10 Linux subsystem (Ubunto 14.04)
...
Should work with true Ubuntu 14.04 as-is.
2016-12-08 00:11:22 +02:00
Stephen Williams
063ae77568
Merge pull request #132 from Fatsie/master
...
[vhdlpp]Added to_bit and to_bitvector standard functions
2016-11-29 08:59:51 -08:00
Staf Verhaegen
447f941f35
[vhdlpp]Added to_bit and to_bitvector standard functions
2016-11-27 01:28:39 +01:00
Martin Whitaker
b4e8a12309
Fix for GitHub issue #128 - disable CONCATZ generation for vhdl target.
2016-11-25 22:23:58 +00:00
Martin Whitaker
7cac4677bf
Fix for GitHub issue #130 part 2 : assertion failure on unsupported cast.
2016-11-25 22:11:13 +00:00
Martin Whitaker
002f118bb5
Fix for GitHub issue #130 part 1 - null dereference when assigning int to enum.
2016-11-25 21:53:35 +00:00
Henry Wong
182c08b528
Fix segfault when error in multi-dimensional part select.
2016-10-27 10:59:31 -07:00
Henry Wong
69a96112e8
Fix null-pointer when trying to dump null statements.
2016-10-27 10:55:50 -07:00
Henry Wong
f827e4f748
Pop current_block_stack after for_variable_declaration and foreach.
2016-10-27 10:29:18 -07:00
Martin Whitaker
991d7d7582
Fix indentation in previous patch.
2016-10-20 16:25:34 +01:00
Henry Wong
1f9bf656ed
Adding implementation of NetEvWait::nex_input to handle event controls inside always@(*) blocks
2016-10-20 16:19:55 +01:00
Martin Whitaker
a9f1f306f1
Replace strndup with strdup and fix a few potential buffer overrun bugs.
...
strndup is not available in Windows.
2016-10-14 22:19:33 +01:00
Martin Whitaker
edb922f613
Use correct format strings for PLI_UINT64 in printf/scanf functions.
2016-10-14 20:35:36 +01:00
Martin Whitaker
7ddc514518
Allow library files to be specified on the iverilog command line.
...
This was already supported in command files, using the '-v' flag.
'-v' is already in use on the command line, so use '-l' instead,
and make that an alias for '-v' in command files.
2016-10-02 18:57:32 +01:00
Martin Whitaker
0fdf29e099
Fix for GitHub issue #117 - delays in VPI simulation time callbacks.
...
Change cbReadWriteSynch and cbReadOnlySynch to interpret the passed
time value as a relative delay, not an absolute time. This matches
the behaviour of other simulators.
2016-09-25 20:43:58 +01:00
Stephen Williams
e56e52bc42
Merge branch 'master' of github.com:steveicarus/iverilog
2016-09-19 12:59:41 -07:00
Maciej Suminski
f32b64f497
Fixed warnings about shifting a negative value
2016-09-19 12:54:15 -07:00
Maciej Suminski
151f061298
vhdlpp: Removed unused parameters to mute warnings
2016-09-19 12:53:41 -07:00
Maciej Suminski
3710d35dd1
Added missing brackets
2016-09-19 12:53:06 -07:00
Maciej Suminski
aaf0a9e623
vhdlpp: Accept uppercase letters in based literals
2016-09-19 12:46:24 -07:00
Martin Whitaker
080dd0323d
Fix for GitHub issue #127 - coerce output ports to inout when necessary.
2016-09-17 19:20:48 +01:00
Cary R
5853e32f82
Fix some cppcheck warning issues
2016-09-13 23:45:25 -07:00
Cary R
c706c5dd90
The array properties can be available in a constant context
...
For most arrays the various properties are available as constant
values and can be evaluated in the compiler.
2016-09-11 14:25:00 -07:00
Martin Whitaker
3c9b39846c
Use gn_system_verilog() where appropriate.
...
Replace explicit comparisons against generation_flag with calls to
the gn_system_verilog helper function, both for code clarity and
to fix a couple of bugs. Also simplify the implementation of the
function, as we already rely on the generation_flag enumeration
being an ordered list.
2016-09-08 23:00:48 +01:00
Daniel Andrade
fb2cd4775f
Added missing compilation instruction on README
2016-09-04 00:51:57 -03:00
Stephen Williams
301e85a8ca
Merge pull request #122 from orsonmmz/resize_fix
...
vhdlpp update
2016-09-02 10:01:02 -07:00
Maciej Suminski
5dd2e6a7c8
vhdlpp: Corrected standard library function headers
2016-09-01 12:08:44 +02:00
Maciej Suminski
8ba3d62071
vhdlpp: Better resize() implementation.
...
Previous version did not work well with signed expressions or expressions that
were temporarily resized (e.g. a + 32'd42, where a is a[7:0]).
2016-09-01 12:08:44 +02:00
Maciej Suminski
bab39dae19
vhdlpp: Some of the standard library functions are imported only on request
...
Previously they have been always enabled, now it is required to put a
'use' directive.
2016-09-01 12:08:44 +02:00
Maciej Suminski
089dd037d6
vhdlpp: Use the wider variable size for arith operations on (un)signed
2016-09-01 12:08:44 +02:00
Maciej Suminski
25f4a54852
vhdlpp: Subprograms are matched once. ExpFunc::probe_type() return exact type
2016-09-01 12:08:44 +02:00
Maciej Suminski
8f86004100
vhdlpp: Clearer error messages
2016-09-01 12:08:44 +02:00
Maciej Suminski
07543315cf
vhdlpp: Stricter array type matching
...
Arrays type match if they have a common parent, instead of the
element type. Now (un)signed & std_logic_vector types do not match,
as it should be in VHDL.
2016-09-01 12:08:43 +02:00
Maciej Suminski
fe77b0ac87
vhdlpp: VTypeArray::dimensions() returns std::vector<range_t>
2016-09-01 12:08:43 +02:00
Maciej Suminski
643a3f2f2c
vhdlpp: Do not evaluate generics.
...
They might change depending on the instance, so they cannot be evaluated using the default value.
2016-09-01 12:08:43 +02:00
Maciej Suminski
ed3e67926f
vhdlpp: Evaluate conditional signal assignments upon simulation start.
2016-09-01 12:08:43 +02:00
Maciej Suminski
798adc9863
vhdlpp: Support for unary sign operator.
2016-09-01 12:08:43 +02:00
Maciej Suminski
9e95ae5859
vhdlpp: Moved Exp*::dump() methods from debug.cc to expression_debug.cc.
2016-09-01 12:08:39 +02:00
Stephen Williams
d44c814bab
Remove .alias records from vvp generated code.
...
Net arrays can be handled by nets directly, instead of creating
.alias records.
2016-08-31 14:05:09 -07:00
Martin Whitaker
41075a45e6
Fix for GitHub issue #121 - correctly determine ivl_root.
...
Pull request #116 added the ability for the iverilog driver to determine
ivl_root from the location of the iverilog executable (this is needed to
support relocation at the time iverilog is installed). However, the code
did not support the possible variations in the library path name.
2016-08-24 00:00:24 +01:00
Cary R
a2fbdeff78
Add some pass by reference to vvp
2016-08-14 22:26:16 -07:00
Cary R
ad5a7f7ca3
Update cppcheck vvp suppression file
2016-08-14 21:18:55 -07:00
Cary R
d0e0776910
Make the base class match the derived classes regarding passing by reference
2016-08-14 21:18:44 -07:00
Cary R
255701a787
Fix space issue
2016-08-14 20:55:55 -07:00
Cary R
5f1e63604c
Update cppcheck vpi suppression file
2016-08-14 20:53:57 -07:00
Cary R
9cf23b4c3b
Make getting ivl_root more robust
2016-08-14 19:41:35 -07:00
Cary R
446e825ed3
Fix space issues
2016-08-14 19:37:40 -07:00
Cary R
1d4230472a
Fix getting timeunit outside of module to use a defined check value
2016-08-14 17:26:23 -07:00
Cary R
13189f7431
Update fstapi.c to latest from GTKWave
2016-08-14 12:46:48 -07:00
Martin Whitaker
b51e58fa9d
Fix for br1007 - out-of-range constant bit select should be a warning.
...
An out-of-range constant bit select on the LHS of an assignment was being
treated as an error, whereas an out-of range constant part select would
only result in a warning. In any other context, either case would result
in a warning, so convert the error to a warning.
In addition, all warnings for out-of-range or undefined constant bit/part
selects should be controlled by -Wselect-range.
2016-08-08 22:10:16 +01:00
Martin Whitaker
8461e1d9c4
Fix vlog95 target to handle hierarchical references in root-level tasks.
2016-07-26 22:01:22 +01:00
Martin Whitaker
2bc42fc6e2
Fix for GitHub issue #104 - assigning hierarchical signal from top level task.
...
When emitting a design, all scopes must be emitted before emitting any
top level task/function/method definitions, otherwise hierarchical
references can't always be resolved.
2016-07-26 22:01:22 +01:00
Martin Whitaker
7d5f6c551a
Fix unused variable warning and assumed buffer size from last merge.
2016-07-23 12:01:58 +01:00
Martin Whitaker
191811f78f
Merge branch 'conda-fix' of https://github.com/tfors/iverilog
2016-07-23 11:40:09 +01:00
Martin Whitaker
b1b91f49c8
Update vlog95 target to handle timescales for root scope tasks/functions.
2016-07-23 00:10:01 +01:00
Martin Whitaker
27213f2af8
Fix for GitHub issue #115 - synthesis aborts on case with max guard of 0.
...
The calculation of the required multiplexer width was incorrect for
the corner case of a single guard value of zero.
2016-07-22 23:09:36 +01:00
Martin Whitaker
7bed181f68
Support timescales in design units that aren't inside a module.
...
SystemVerilog allows tasks, functions, and classes to be defined at the
root level or inside packages, so we can't rely on an enclosing module
being present to provide the timescale.
2016-07-22 22:48:20 +01:00
Martin Whitaker
e316cc708b
Fix assignment of outputs from class methods.
...
As for inputs, skip over the implicit 'this' parameter.
2016-07-21 19:06:21 +01:00
Martin Whitaker
b8f9ed27c5
Fix for br1003 - prevent segfault when delays are used outside a module.
2016-07-21 08:40:45 +01:00
Thomas Fors
cada40ebd1
Updated comments
2016-07-18 08:10:41 -05:00
Thomas Fors
3afbb903d6
Use /proc/self/exe on linux, if it exists, to find ivl_root
2016-07-18 08:05:16 -05:00
Yury Gribov
43cd693fe0
Put start events to proper queue.
2016-07-17 09:47:08 -07:00
Stephen Williams
c37d6ac3ac
Merge branch 'master' of github.com:steveicarus/iverilog
...
Conflicts:
vhdlpp/parse_misc.cc
vhdlpp/vtype.cc
2016-07-17 09:36:34 -07:00
Martin Whitaker
ad1101cc80
Fix for br1005 - segfault when SV queue is declared inside a class.
...
For now, output a "sorry" message to indicate this is not yet
supported.
2016-07-11 20:04:24 +01:00
Martin Whitaker
ad87704809
Partial fix for br1006 - allow part selects in path declarations.
...
This just enables the compiler to parse path declarations that
contain part selects. As for bit selects, the part select is
discarded, and if elaboration of specify blocks is enabled,
the path declaration will be applied to the entire vector. If
elaboration is enabled, a warning message will now be output
when a bit or part select is discarded.
2016-07-10 20:00:39 +01:00
Martin Whitaker
7f612270b3
Improved fix for GitHub issue #112 .
...
This does a better job of setting the intermediate expression types
and widths when calculating the canonical index into a packed array.
It still doesn't properly handle out-of-bound indices (br953).
2016-07-10 13:30:58 +01:00
Martin Whitaker
1448210f28
Fix for GitHub issue 112 - index calculation for >2D packed arrays.
2016-07-09 23:33:33 +01:00
Martin Whitaker
d496b095ff
Fix vector width calculation for multi-dimensional packed arrays.
2016-07-09 17:10:22 +01:00
martinwhitaker
e1ec23d160
Merge pull request #114 from wzab/master
...
Changes necessary to compile with gcc on Debian/Linux testing
2016-07-09 09:04:24 +01:00
Wojciech M. Zabolotny
2c52fd65d3
Changes necessary to compile with gcc on Debian/Linux testing
2016-07-07 23:01:02 +02:00
Stephen Williams
6c7495c93e
Merge branch 'master' of github.com:steveicarus/iverilog
2016-07-05 07:59:29 -07:00
Stephen Williams
f03e9d4180
Merge pull request #113 from CastMi/original_master
...
Checks for pointers
2016-07-05 07:59:16 -07:00
Stephen Williams
540bb5afa6
Revert "Update parse_misc.cc"
...
This reverts commit 6d06e9351a .
2016-07-05 07:56:18 -07:00
Stephen Williams
f657d1d7d7
Revert "Update vtype.cc"
...
This reverts commit 49515ff62b .
2016-07-05 07:56:06 -07:00
Stephen Williams
70031c9d0f
Merge pull request #111 from forflo/master
...
Resolved #110
2016-07-05 07:50:52 -07:00
Michele Castellana
0aa5487214
Check pointers before dereferencing
2016-06-30 17:47:34 +02:00
Michele Castellana
3aa9d535f1
Avoid out of bounds
2016-06-30 17:47:34 +02:00
Michele Castellana
9ad46044b4
Cleanup
2016-06-30 17:47:34 +02:00
Yury Gribov
2d7534b005
Implement barrel shifter LPM for BLIF target
2016-06-13 10:55:38 -07:00
Yury Gribov
31482cbceb
Implement sign extension LPM for BLIF target
2016-06-13 10:51:46 -07:00
Yury Gribov
2d5a48c579
Support PULLUP/DOWN and BUFZ in BLIF backend
2016-06-13 10:26:46 -07:00
anon
6d06e9351a
Update parse_misc.cc
...
Fixed bug described in #110
2016-06-13 00:56:43 +02:00
anon
49515ff62b
Update vtype.cc
...
Fixed bug described in #110
2016-06-13 00:55:28 +02:00
Martin Whitaker
8234f1845d
Fix for GitHub issue #106 - prevent VPI writes during read-only synch.
2016-06-09 21:27:20 +01:00
Martin Whitaker
332170d36b
Fix for GitHub issue #105 - fully support SV macro escape sequences.
...
The existing support for ``, `", and `\`" did not work in nested macro
definitions. Note that the new implementation only detects and replaces
these sequences inside the macro text (as required by the IEEE standard),
whereas the old implementation would detect and replace them anywhere in
the source files.
2016-06-06 20:12:04 +01:00
Cary R
45fbf55806
Add basic support for parameters using typedefs
2016-05-14 10:34:50 -07:00
Martin Whitaker
61c82d2cb0
Handle mixed continuous and non-blocking assignments to same vector.
...
SystemVerilog allows a mixture of procedural and continuous assignments
to be applied to different parts of the same vector. The previous attempt
to make this work for non-blocking assignments was flawed (see preceding
fix for vvp_fun_part_pv::recv_vec4_pv). Instead, handle this case by
converting the non-blocking assignment into a delayed force statement,
which matches the way mixed continuous and blocking assignments are
handled.
2016-05-10 22:16:40 +01:00
Martin Whitaker
0c66116f51
Fix for GitHub issue #103 - vvp assertion failure on part select propagation.
...
The implementation of vvp_fun_part_pv::recv_vec4_pv was incorrect, and
propagated the incoming widths rather than the stored widths.
2016-05-10 21:59:21 +01:00
Stephen Williams
a219df2f18
Merge pull request #95 from orsonmmz/automatic_rebased
...
vhdlpp: Specify lifetime for variables.
2016-05-04 08:05:01 -07:00
Martin Whitaker
6e5ed73b09
Extended fix for GitHub issue #99 .
...
Most vvp functors need to support recv_vec4_pv. Any that are strength-aware
also need to support recv_vec8_pv. Note the simplifying assumption that is
documented in the base class recv_vec4_pv_ implementation.
2016-04-18 23:47:43 +01:00
Martin Whitaker
b2f7d09f0d
Fix GitHub issue #99 - recv_vec4_pv not implemented for arithmetic functors.
...
Also initialise the stored operand values to 'bz instead of 'bx to get
the correct results when bits are not driven.
2016-04-04 22:29:54 +01:00
Martin Whitaker
6ba2bee977
Fix for br974 - support SV types in non-ansi port declarations.
2016-04-04 20:40:30 +01:00
Martin Whitaker
9f88b26a67
Fix vlog95 target to handle delayed CA to vector part select.
2016-04-02 22:24:14 +01:00
Martin Whitaker
20104c92c8
Fix for GitHub issue #96 - support mixed constant/variable delays in vvp.
...
If all three rise/fall/decay delay values are constant, we can use
the vvp .delay statement variant that takes three literal numbers.
If not, we have to use the variant that takes three net inputs. If
some of the delay values are constant, we need to create constant
drivers for those delay inputs.
2016-04-02 19:55:56 +01:00
Larry Doolittle
4521be4510
More spelling, comments only
2016-04-01 11:02:34 -07:00
Larry Doolittle
89edf62206
Capitalize Verilog in a few places
2016-04-01 11:02:24 -07:00
Maciej Suminski
163a913559
vhdlpp: Specify lifetime for variables.
2016-03-29 11:27:14 +02:00
Maciej Suminski
b7d263462c
vhdlpp: Fixed automatic variables initalization in subprograms.
2016-03-29 11:27:14 +02:00
Maciej Suminski
4c82352229
vhdlpp: Corrected the comment mark from the previous commit.
2016-03-29 11:27:14 +02:00
Maciej Suminski
97e31ec9fa
vhdlpp: Workaround to make subprograms work as if they were automatic.
2016-03-29 11:27:14 +02:00
Maciej Suminski
d6ef813a20
vhdlpp: Emit subprograms as automatic by default.
2016-03-29 11:27:14 +02:00
Martin Whitaker
7f475d4210
Refactor to use new pad_to_width/cast_to_width functions.
2016-03-25 22:23:45 +00:00
Martin Whitaker
dc1c3a4043
Fix for GitHub issue #94 - enhance support for SystemVerilog size casting.
...
Allow the size expression to be any constant expression. Also ensure that
the expression width and type are correctly calculated and applied.
2016-03-25 21:49:28 +00:00
Cary R
b5324c7ba2
Fix reference to undefined value (valgrind)
2016-03-24 23:43:07 -07:00
Cary R
fb77cc4000
Fix a cppcheck warning
2016-03-24 20:23:47 -07:00
Martin Whitaker
9538c81d34
Add check for explicit lifetime when initialising static variables.
...
If a static variable declared in a task, function, or block has an
initialisation expression, SystemVerilog requires the declaration to
have an explicit static lifetime. This is supposed to be a compile
error, but for now just output a warning.
Implementing this required adding support in the parser for explicit
lifetimes in variable declarations. For now, just output an error if
the user asks for a lifetime that isn't the default for that scope.
2016-03-19 20:44:36 +00:00
Martin Whitaker
6e718c2e0c
Added support for default subroutine lifetimes (SystemVerilog).
2016-03-19 17:27:27 +00:00
Martin Whitaker
7c3cee5f7a
Updated comment in tgt-vlog95 to reflect changes in variable initialization.
2016-03-19 14:47:38 +00:00
Martin Whitaker
0dcb46e4c4
Fix shadow warning.
2016-03-19 14:42:34 +00:00
Martin Whitaker
72bb63cf42
Variable initialization blocks should be unamed.
...
Also add file/line info to initial process.
2016-03-19 14:21:10 +00:00
Martin Whitaker
54feb89bf5
For SystemVerilog, run variable initialization before main simulation starts.
2016-03-19 13:46:09 +00:00
Martin Whitaker
635adfc01e
Fully support variable initialization in tasks/functions/named blocks.
2016-03-19 13:04:38 +00:00
Cary R
28b446ca30
Use correct type when printing supply pull message
2016-03-15 03:49:20 -07:00
Stephen Williams
78a49eacef
Merge branch 'master' of github.com:steveicarus/iverilog
2016-03-14 12:26:12 -07:00
Larry Doolittle
1784488096
Spelling and whitespace
2016-03-14 12:25:50 -07:00
Martin Whitaker
dbaf2471f2
Fix for br1001 - connect undriven wand/wor to 'bz in tgt-vvp.
2016-03-13 16:38:55 +00:00
Martin Whitaker
a5dac08a50
tgt-vlog95: Find the original signal when a port connection is cast.
2016-03-12 23:22:14 +00:00
Martin Whitaker
c4b3f256af
Don't mislabel signals as ports when casting port connections.
...
The original signal should retain the port type. Moving it to the cast
signal was confusing the vlog95 and stub targets.
2016-03-12 23:17:54 +00:00
Martin Whitaker
081f5e6960
tgt-vlog95: Fix infinite loop caused by searching the wrong scope.
2016-03-12 23:11:11 +00:00
Martin Whitaker
5d9a196819
tgt-vlog95: Handle variable initialisation in named blocks.
2016-03-12 23:06:54 +00:00
Martin Whitaker
dc189fec8c
Added new vvp latch statement to README file.
2016-03-12 12:14:03 +00:00
Maciej Suminski
9d487c6951
vhdlpp: Fixed a few shadow warnings.
2016-03-12 12:03:17 +00:00
Martin Whitaker
708a7d0621
Move some redundant initialisation of bitmasks in synthesis.
...
These are made obsolete by an earlier bugfix.
2016-03-12 12:02:22 +00:00
Martin Whitaker
b4d438ea9f
Fixed bug in vlog95 dff output when using asynchronous set.
2016-03-12 11:39:32 +00:00
Martin Whitaker
22bc798696
Added warning when a latch enable is a synthesised expression.
2016-03-12 11:21:23 +00:00
Martin Whitaker
c0542af6bf
Updated copyright dates following previous patch.
2016-03-12 09:10:58 +00:00
Johann Klammer
89333fa3a5
add latch primitive for vlog95
2016-03-12 09:06:42 +00:00
Martin Whitaker
99afea6946
Added support for LPM latches to vvp.
2016-03-12 09:04:51 +00:00
Martin Whitaker
b47482880c
Added support for LPM latches to stub target.
2016-03-12 09:03:42 +00:00
Martin Whitaker
5dfc9fdefb
Code and comment cleanup for latches in target interface.
2016-03-12 00:10:47 +00:00
Johann Klammer
d7736d7eba
latch for vvp output
2016-03-11 23:44:06 +00:00
Johann Klammer
35a61b4680
Add LATCH to target interface
2016-03-11 23:43:58 +00:00
Martin Whitaker
0e537c5465
Enable latch generation in synthesis.
...
(reworked patch supplied by Johann Klammer)
2016-03-11 23:29:58 +00:00
Martin Whitaker
81d3b7a25c
Updated copyright notices.
2016-03-11 23:14:55 +00:00
Johann Klammer
c92b630728
NetLatch class
2016-03-11 23:11:54 +00:00
Martin Whitaker
f176106c54
Added notes on synthesis implementation.
2016-03-11 18:35:13 +00:00
Martin Whitaker
c1c4d8c863
Fix bitmask merging in synthesis.
...
A conditional clause that doesn't drive any bits of a particular nexus
should not affect the bitmask generated for that nexus. The completely
undriven case is handled by the enable signal.
2016-03-11 17:32:12 +00:00
Stephen Williams
6a8303bdaf
Merge pull request #92 from orsonmmz/vhdlpp_fixes
...
Vhdlpp fixes
2016-03-07 09:05:36 -08:00
Maciej Suminski
de775975e8
ivl: Fixed slice base calculation
...
when range is rising (e.g. logic [0:3] arr) or when it
starts with a non-zero integer (e.g. logic [4:1] arr).
2016-03-07 17:11:53 +01:00
Maciej Suminski
770906ba0d
vhdlpp: Write binary constants as a string of bits.
2016-03-07 17:11:53 +01:00
Maciej Suminski
c25be111a3
vhdlpp: Apply case equality operator for logic type.
2016-03-07 17:11:53 +01:00
Maciej Suminski
41a45a8db0
vhdlpp: Avoid unnecessary toupper() call.
2016-03-07 17:11:53 +01:00
Maciej Suminski
7c10de918e
vhdlpp: read() takes into account the size of the destination variable.
2016-03-07 17:11:53 +01:00
Maciej Suminski
94f7504372
vhdlpp: Subprograms are linked to Package instead of generic Scope.
2016-03-07 17:11:53 +01:00
Maciej Suminski
78d6ee26dd
vhdlpp: Do not allow 'wire real' nets.
2016-03-07 17:11:49 +01:00
Maciej Suminski
7bb4cef9bc
vhdlpp: ExpScopedName class to handle names with a specified scope.
2016-03-07 11:38:11 +01:00
Maciej Suminski
03e85850e1
vhdlpp: Variables are moved to respective process scopes.
2016-03-07 11:38:11 +01:00
Maciej Suminski
b037d533f9
vhdlpp: ProcessStatement inherits after ScopeBase.
2016-03-07 11:38:11 +01:00
Maciej Suminski
25cd0827ba
vhdlpp: Removed ProcessStatement::rewrite_as_always_edge_() & extract_anyedge_().
...
Processes sensitive to edges are now handled with $ivlh_{rising,falling}_edge().
2016-03-07 11:38:11 +01:00
Maciej Suminski
7cbb275ffe
vhdlpp: Handle limited-length strings in reports.
...
Currently limited-length strings (e.g. string(1 to 4)) are
emulated using 2D array of bits (e.g. bit [1:4][7:0]).
Because of that, ivl treats them as standard vectors and
$display() does not show them as strings. Now, they are
wrapped with $sformatf("%s", ..) to fix it.
2016-03-07 11:38:11 +01:00
Maciej Suminski
e4bc404e99
vhdlpp: ExprVisitor stores the recursion level.
2016-03-07 09:54:28 +01:00
Maciej Suminski
cef45ff21a
vhdlpp: Emit init values for wires as a weak assignment.
2016-03-07 09:54:28 +01:00
Maciej Suminski
fca2fff24e
vhdlpp: VTypeRange::type_match()
2016-03-07 09:54:28 +01:00
Maciej Suminski
1ed4603a18
vhdlpp: Set EOF flag right after reaching the end of file.
2016-03-07 09:54:28 +01:00
Maciej Suminski
83330c22fb
vhdlpp: Refactored code for format matching in read/write() sys functions.
2016-03-07 09:54:28 +01:00
Maciej Suminski
a7f4d65aaa
vhdlpp: More robust report messages display.
2016-03-07 09:54:28 +01:00
Maciej Suminski
9cf1dcbae2
vvp: Corrected vvp_net_fun_t::recv_vec4_pv() (commit de968e18)
2016-03-07 09:54:28 +01:00
Maciej Suminski
c23f970a5f
vhdlpp: Do not display an error message when probing type without a context.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f620727555
vhdlpp: Added a few missing FILE_NAME directives in the parser.
2016-03-07 09:54:28 +01:00
Maciej Suminski
b4baace4b1
ivl: Support for part selection in multidimensional packed ports assignment.
2016-03-07 09:54:28 +01:00
Maciej Suminski
045d9e7117
vhdlpp: Improved type matching rules.
2016-03-07 09:54:28 +01:00
Maciej Suminski
69b7c000d0
vvp: Implemented vvp_net_fun_t::recv_vec4_pv().
2016-03-07 09:54:28 +01:00
Maciej Suminski
a40d1a65c4
vhdlpp: Emit enum type as int.
2016-03-07 09:54:28 +01:00
Maciej Suminski
248275e5e1
vhdlpp: Refactored VType::emit_decl().
2016-03-07 09:54:28 +01:00
Maciej Suminski
5f1cd624fe
vhdlpp: Set reg flag only for arrays of unpacked types.
2016-03-07 09:54:28 +01:00
Maciej Suminski
996201a745
vhdlpp: Time type can be packed.
2016-03-07 09:54:28 +01:00
Maciej Suminski
1647e192e5
vhdlpp: Added ExpDelay::visit() method.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f802c782b8
vhdlpp: Elaborate wait statement argument as time type.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f88b48c7da
vhdlpp: Do not emit explicit 'reg' for user-defined types.
2016-03-07 09:54:28 +01:00
Maciej Suminski
d20549b27a
vhdlpp: Fixed a crash in case of dynamic_cast failure.
2016-03-07 09:54:28 +01:00
Maciej Suminski
bba312fee1
vhdlpp: Minor code formatting.
2016-03-07 09:54:28 +01:00
Maciej Suminski
78bd9a389d
vhdlpp: Handle multidimensional arrays based on typedefs.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f584b4ea50
vhdlpp: Treat range as an expression.
2016-03-07 09:54:28 +01:00
Maciej Suminski
5488ea1e2c
vhdlpp: Support for ExpNames with multiple indices.
2016-03-07 09:54:28 +01:00
Maciej Suminski
34b5834a84
vhdlpp: Added file_open() variant that returns status.
2016-03-07 09:54:28 +01:00
Maciej Suminski
0f3f8907c3
vhdlpp: Removed an unnecessary check.
2016-03-07 09:54:28 +01:00
Maciej Suminski
08150eae83
vhdlpp: Add line information for procedure calls.
2016-03-07 09:54:28 +01:00
Maciej Suminski
609f266a8c
vhdlpp: Additional variants for standard library functions.
2016-03-07 09:54:28 +01:00
Maciej Suminski
2c4deee0c3
vhdlpp: Support for subprogram overloading.
2016-03-07 09:54:28 +01:00
Maciej Suminski
cfa038e75c
vhdlpp: VType::type_match() fixes.
2016-03-07 09:54:28 +01:00
Maciej Suminski
ad5b003488
vhdlpp: Improved handling for subprogram-related errors.
2016-03-07 09:54:28 +01:00
Maciej Suminski
8d3f559b38
vhdlpp: ExpName::probe_prefixed() returns correct type for complex expressions.
...
E.g. array_of_records(2).fieldname
2016-03-07 09:54:28 +01:00
Maciej Suminski
25671048f6
vhdlpp: ExpInteger::probe_type() returns either INTEGER or NATURAL, depending on the value.
2016-03-07 09:54:28 +01:00
Maciej Suminski
6b1e08cdb0
vhdlpp: Removed a non-existing method declaration.
2016-03-07 09:54:28 +01:00
Maciej Suminski
32f202bddc
vhdlpp: VTypeRangeExpr::elaborate()
2016-03-07 09:54:28 +01:00
Maciej Suminski
42ead3a482
vhdlpp: Elaborate types for signals & variables.
2016-03-07 09:54:28 +01:00
Maciej Suminski
414f240694
vhdlpp: Code cleaning (std_funcs).
2016-03-07 09:54:28 +01:00
Maciej Suminski
cc729e8dd9
vhdlpp: Removed redundant ActiveScope::bind_name() for subprograms.
2016-03-07 09:54:28 +01:00
Maciej Suminski
8298c96dee
vhdlpp: Turned elaborate_argument() into a SubprogramHeader method.
2016-03-07 09:54:28 +01:00
Maciej Suminski
b707228171
vhdlpp: file_open_status enum.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f2c8fb0479
vhdlpp: Display an error message when calling a function with too many arguments.
2016-03-07 09:54:28 +01:00
Maciej Suminski
3b165a5f25
vhdlpp: Skip package name emission when calling functions from the same package.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f1c07b86a3
vhdlpp: Implemented ReturnStmt::elaborate() method.
2016-03-07 09:54:28 +01:00
Maciej Suminski
00f5785f2c
vhdlpp: Minor changes to write_to_stream functions.
2016-03-07 09:54:28 +01:00
Maciej Suminski
b79f0d763f
vhdlpp: Implemented ExpLogical::write_to_stream() method.
2016-03-07 09:54:28 +01:00
Maciej Suminski
daed47eb45
vhdlpp: Improved conditional assignments.
...
Now they handle expressions without the final 'else'.
2016-03-07 09:54:28 +01:00
Maciej Suminski
19a187fa90
vhdlpp: Fixed the Expression visitor code.
2016-03-07 09:54:28 +01:00
Maciej Suminski
db77fafe72
vhdlpp: Clone the initializing expression in signal declarations.
2016-03-07 09:54:28 +01:00
Maciej Suminski
7f6f4157d1
vhdlpp: ExpRange::emit() now returns the number of errors.
2016-03-07 09:54:28 +01:00
Maciej Suminski
a884faa8c1
vhdlpp: Delayed assignment statements.
2016-03-07 09:54:28 +01:00
Maciej Suminski
eeb5728e20
vhdlpp: emit() methods are const.
2016-03-07 09:54:28 +01:00
Maciej Suminski
730fdaf0f0
vhdlpp: Concurrent assertion statements.
2016-03-07 09:54:28 +01:00
Maciej Suminski
5748018409
vhdlpp: Limited support for final wait statement.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f6ee5d0f22
vhdlpp: Corrected an error message.
2016-03-07 09:54:28 +01:00
Maciej Suminski
2e6fb9b3f6
vhdlpp: shift_left/right() functions.
2016-03-07 09:54:28 +01:00
Maciej Suminski
03434efed3
vhdlpp: Elaborate ExpAttribute arguments.
2016-03-07 09:54:28 +01:00
Maciej Suminski
3af3c12b11
vhdlpp: Added system function NOW.
2016-03-07 09:54:28 +01:00
Maciej Suminski
2606d0e897
vhdlpp: Minor code clean up.
2016-03-07 09:54:28 +01:00
Maciej Suminski
52c912c4af
vhdlpp: Allow calling functions without parameters and brackets.
2016-03-07 09:54:28 +01:00
Maciej Suminski
b08ae23d0d
vhdlpp: line feed character (LF).
2016-03-07 09:54:28 +01:00
Maciej Suminski
054dfdf0cf
vhdlpp: Simpler enum definitions storage.
2016-03-07 09:54:28 +01:00
Maciej Suminski
f52de62729
vhdlpp: Elaborate if statement condition as bool.
2016-03-07 09:54:28 +01:00
Maciej Suminski
b6f1cb221e
vhdlpp: Fixes for subtypes handling.
2016-03-07 09:54:28 +01:00
Maciej Suminski
79f38b8c56
vhdlpp: Basic loop support (loop..end loop).
2016-03-07 09:54:28 +01:00
Martin Whitaker
b4d5248c67
Fix for br1000 - avoid infinite loop when processes share a for-loop index.
2016-03-05 17:43:25 +00:00
Stephen Williams
9a7f31c728
Functions that return strings pass the return value on the stack.
2016-03-01 15:38:28 -08:00
Cary R
7d21891147
Fix space issues.
2016-02-28 22:09:39 -08:00
Martin Whitaker
ca02b3ae53
vlog95 target enhanced to support constant input to LPM_SUBSTITUTE.
2016-02-27 21:13:57 +00:00
Martin Whitaker
f84f0535cf
Renamed synthsplit to exposenodes.
...
This was needed to avoid automatically setting the synth flag in the
compiler.
2016-02-27 20:24:28 +00:00
Martin Whitaker
a33255f0e0
Add support for LPM_SUBSTITUTE and wider LPM_MUX objects in vlog95 target.
2016-02-27 18:08:56 +00:00
Martin Whitaker
9d5f4ad048
Add new synthsplit functor.
...
This provides support for handling synthesis constructs in the vlog95
target.
2016-02-27 16:40:55 +00:00
Martin Whitaker
8348c25104
Take heed of disable_concatz_generation flag in mux synthesis.
2016-02-27 16:39:15 +00:00
Martin Whitaker
a0bee0a76f
Add support for real valued compressed assignment statements in tgt-vvp.
2016-02-23 22:02:03 +00:00
Martin Whitaker
a85c64d347
Revert "Add support for real valued compressed assignment statements in tgt-vvp."
...
This reverts commit 3fede95f5e .
2016-02-23 21:49:49 +00:00
Martin Whitaker
3fede95f5e
Add support for real valued compressed assignment statements in tgt-vvp.
2016-02-23 20:58:30 +00:00
Martin Whitaker
a7066e3686
Fix expression/operator type for compressed assignment/shift.
2016-02-23 20:57:30 +00:00
Martin Whitaker
0199ad129d
Fix expression type for compressed assignment statements.
...
A compressed assignment statement should give exactly the same
result as the equivalent uncompressed statement. This means
that the type (signed/unsigned) of the LHS affects the type of
the RHS expression (unlike in normal assignments). We need to
take care that bit/part selects and concatenations are correctly
identified as unsigned values, even in the cases where they
reduce to a single whole signal.
2016-02-23 16:53:01 +00:00
Martin Whitaker
241b6723e5
Fix lval extension for compressed assignment in constant function.
...
The type of extension (zero/sign) is determined by the expression
type, not the operand type, so we need to cast to the expression
type before extending the value.
2016-02-23 16:46:26 +00:00
Martin Whitaker
b77d758f19
Fix compressed assignments to concatenations.
...
When loading a lval concatenation, tgt-vvp was loading the elements
in the wrong order for the %concat instruction.
2016-02-23 16:44:03 +00:00
Martin Whitaker
1a78784205
Removed some dead code.
2016-02-23 11:58:27 +00:00
Martin Whitaker
f9f51db7ba
Extended constant function assignment operator support to real values.
...
Also output a "sorry" message if the LHS is a concatenation.
2016-02-22 23:31:35 +00:00
Martin Whitaker
74b8c04b91
Add support for SystemVerilog assignment operators in constant functions.
2016-02-22 22:22:22 +00:00
Stephen Williams
bc23bc71e3
Merge branch 'master' of github.com:steveicarus/iverilog
2016-02-22 09:49:28 -08:00
Peter Jakobsen
cbced021a1
Add missing symbols for dlltool to export
2016-02-22 09:49:06 -08:00
Martin Whitaker
f3cf7ca546
Updated comments for synthesis.
2016-02-21 22:39:52 +00:00
Martin Whitaker
f29935d8dd
Enhanced support for asynchronous set/reset in synthesis.
...
Added the ability to coalesce set/reset values to different parts
of the same vector. Also added a check that all bits of the vector
are assigned a value.
Enabled coalescence of asynchronous set/reset part-vectors
2016-02-21 21:46:36 +00:00
Martin Whitaker
3fc0204b99
Fix cleanup of NetEvWait class.
...
The destructor needs to delete the stored NetEvent objects. Failure
to do this was causing a compiler crash after synthesis if the
nodangle functor was disabled.
2016-02-21 21:22:35 +00:00
Martin Whitaker
5286fb858d
Synthesis rework.
...
Synthesis could only handle relatively simple conditional constructs.
This rework aims to make it handle anything the user can throw at it
(or output a sensible message as to why it can't).
2016-02-21 00:00:39 +00:00
Martin Whitaker
46105e0c5a
Delayed output of vvp dff to end of current time slot.
...
Flip-flops are generally modelled in behavioural code using non-blocking
assignments. This change makes the synthesised code behave the same as
the behavioural code. It's a more realistic model of a real flip-flop
too, which will always have some clock-to-output delay.
2016-02-21 00:00:39 +00:00
Cary R
70a350f2e8
Merge branch 'master' of github.com:steveicarus/iverilog
2016-02-10 22:33:21 -08:00
Cary R
03cb74ba57
Fix compile warning
2016-02-10 22:33:10 -08:00
Maciej Suminski
71084109f6
Save the time format suffix string.
...
In case of a vhdlpp-specific () call, the timeformat suffix string was overridden,
therefore it has to be restored to the previous value after the call.
2016-02-10 22:33:06 -08:00
Stephen Williams
12c39aa4bb
Fix broken "inherits dimensions from var/net" warning.
2016-02-10 10:56:14 -08:00
Stephen Williams
139c4154c3
Merge branch 'master' of github.com:steveicarus/iverilog
2016-02-06 16:08:15 -08:00
Stephen Williams
f3647578d4
Add the -Wimplicit-dimensions warning.
2016-02-06 16:07:50 -08:00
Cary R
eef3e8c09f
Fix memory leak in time suffix code (VHDL)
2016-02-04 07:21:22 -08:00
Cary R
3e52b2be66
Fix valgrind compile
2016-02-03 22:25:57 -08:00
Cary R
841593d013
Remove some compile warnings
2016-02-03 21:40:18 -08:00
Stephen Williams
76ced1cf7c
Fix %ret/* and %retload/* opcodes to search up for function thread.
2016-02-01 14:51:18 -08:00
Stephen Williams
f494b478cc
Merge branch 'master' into return-stack
...
# Conflicts:
# sv_vpi_user.h
2016-02-01 14:47:44 -08:00
Stephen Williams
469d4fefa7
Handle compressed assign to function return value.
2016-02-01 12:38:48 -08:00
Stephen Williams
ce692f90ad
Implement and use the %retload/real opcode.
2016-02-01 09:31:06 -08:00
Stephen Williams
c114edfa6c
Handle void functions with new .scope format.
2016-02-01 09:29:49 -08:00
Stephen Williams
fac7de2133
Better handle some different function types in the .scope setup.
2016-01-31 16:16:02 -08:00
Stephen Williams
604a62379c
Make .scope aware of return type, and extend %ret/vec4 operands
...
The .scope needs to be aware of return types so that the %call/vec4
function knows how to intialize the return value. We also need to
extend the %ret/vec4 to support writing parts of the return value.
2016-01-31 15:29:52 -08:00
Martin Whitaker
83a82914e0
Temporary fix for br993 - assertion failure in flip-flop synthesis.
...
Synthesis does not currently support some commonly used styles for
representing flip-flops, e.g.
q <= 0;
if (en) q <= 1;
or
if (clr) q <= 0;
if (set) q <= 1;
For now, output a "sorry" message.
2016-01-30 22:38:08 +00:00
Martin Whitaker
a006dee990
Fix for br994 - assertion failure when synthesising a mux.
...
The elaborator allows the RHS of assignment to be wider than the
LHS. When using an if statement to represent a mux, this meant the
mux inputs could be different widths, resulting in an assertion
failure during synthesis. The fix is to prune the RHS to match the
LHS for each assignment. This has the benefit of minimising the
mux width.
2016-01-30 20:11:58 +00:00
Martin Whitaker
fbeee1bae3
Temporary fix for br995 - assignment to memory not supported in synthesis.
...
For now, output a "sorry" message.
2016-01-30 17:01:13 +00:00
Stephen Williams
e435a879fc
Add ability to read back return value / Add vec4 stacked user functions.
...
Also:
- handle functions as arguments to system tasks.
- Cleanup detect of signal as return value.
2016-01-24 18:36:26 -08:00
Stephen Williams
0c91a6b041
Add .ufunc/real functor to handle functions with return value on stack.
2016-01-17 16:23:28 -08:00
Stephen Williams
bfc9cd8715
Make real functions in processes use parent stack for return value.
2016-01-10 17:09:33 -08:00
Stephen Williams
37a63e5d6d
Merge pull request #88 from orsonmmz/image_attr
...
'image attribute
2016-01-10 15:49:26 -08:00
Martin Whitaker
eb2a9be0c9
Fix for br999 - incorrect result from binary comparison.
...
When a binary (in)equality comparison has a constant left operand,
the tgt-vvp code generator swaps the left and right operands to
allow the cmpi instruction to be used. The code for swapping the
operands was incorrect.
2016-01-07 19:11:42 +00:00
Maciej Suminski
32fab21e95
ivl: Allow concatenating strings returned by function calls.
2016-01-07 11:11:04 +01:00
Maciej Suminski
ba274936e5
vhdlpp: Added 'image attribute for time type.
2016-01-06 15:30:24 +01:00
Maciej Suminski
214c940a1a
vhdlpp: Fixing memory leaks and muting valgrind.
2016-01-06 15:30:20 +01:00
Maciej Suminski
b711f16f05
vhdlpp: 'image attribute.
2016-01-06 15:30:06 +01:00
Maciej Suminski
dff1ad08b0
vhdlpp: ExpAttribute split to Exp{Obj,Type}Attribute.
2016-01-06 15:30:06 +01:00
Maciej Suminski
71c63bf993
vhdlpp: Added argument_list token.
2016-01-06 15:30:06 +01:00
Maciej Suminski
e0b2a5b337
vhdlpp: Refactored prange_t (class ExpRange).
2016-01-06 15:30:06 +01:00
Maciej Suminski
2c010d34bb
vhdlpp: Unified Expression::evaluate() method.
2016-01-06 15:30:06 +01:00
Maciej Suminski
23633c498f
vhdlpp: Moved dump_scope() to ScopeBase class.
2016-01-06 15:30:06 +01:00
Maciej Suminski
40075e11ab
Code formatting.
2016-01-06 15:30:06 +01:00
Maciej Suminski
1d2aef7142
vpi: $sformatf() function.
2016-01-06 15:30:06 +01:00
Maciej Suminski
9276515e19
vhdlpp: Minor fix for ReportStmt::write_to_stream.
2016-01-05 14:23:25 +01:00
Maciej Suminski
3b310e8227
vhdlpp: Elaborate subprograms in packages.
2016-01-05 14:23:25 +01:00
Maciej Suminski
517c9785e8
vvp: Code cleaning (vpi_tasks).
2016-01-05 14:23:25 +01:00
Maciej Suminski
df6b24fd3a
ivl & vvp: Enabled 'string' as the return type in VPI functions.
2016-01-05 14:23:25 +01:00
Maciej Suminski
9886b8cb36
vhdlpp: Distinguish character and an array of bits during emission.
2016-01-05 13:55:22 +01:00
Maciej Suminski
1c4b1c12e4
vhdlpp: Fixes for 'wait for' statements emission.
2016-01-05 13:55:22 +01:00
Maciej Suminski
ef3d0e4e0d
vhdlpp: ExpString::emit distinguishes between array and string types.
2016-01-05 13:55:22 +01:00
Maciej Suminski
442750ca2c
vhdlpp: Refactored {Report,Assert}Stmt so they handle expressions instead of strings.
2016-01-05 13:55:22 +01:00
Maciej Suminski
597001ee2f
vhdlpp: Variables have always reg_flag set.
2016-01-05 13:55:22 +01:00
Maciej Suminski
acb4ca8e47
vhdlpp: More descriptive error message for a missing function.
2016-01-05 13:55:22 +01:00
Cary R
e44010c2a3
Remove redundant class keyword
2015-12-29 13:02:58 -08:00
Cary R
71ff9e70ea
Fix valgrind release code to work with new scope definition
2015-12-29 12:46:42 -08:00
Cary R
8367285f3b
Fix some struct versus class warnings for vpiScope
2015-12-29 12:29:10 -08:00
Stephen Williams
63ad15ee2e
Rework user function calls to use specialized opcodes.
...
Create The %callf/* opcodes to invoke user defined functions in a
more specialized way. This allows for some sanity checking on the
way, and also is a step towards keeping return values on stacks.
2015-12-27 20:29:10 -08:00
Stephen Williams
1b33bf8615
Normalize the parsing of %fork and %disable opcodes.
2015-12-27 13:07:42 -08:00
Stephen Williams
f275dac7a8
Kill a bunch of __vpiScope struct vs class warnings.
2015-12-27 11:37:10 -08:00
Stephen Williams
2fedb4942e
C++-ify more __vpiScope members.
2015-12-23 17:38:13 -08:00
Stephen Williams
fff69390ac
C++-ify the __vpiScope classes.
2015-12-20 20:26:57 -08:00
Stephen Williams
c88a60537a
Merge branch 'master' of github.com:steveicarus/iverilog
2015-12-20 16:31:15 -08:00
Stephen Williams
3e3f245d8c
Document the vvp .scope record.
...
Also clean up some dead code in the vvp parser.
2015-12-20 16:31:03 -08:00
Cary R
3b7ebf6aa2
If ret is already defined then don't overwrite it.
2015-12-20 12:28:29 -08:00
Cary R
eb8ad92422
Add cppcheck suppressions for libveriuser
2015-12-19 19:56:49 -08:00
Cary R
1b8ed5f3ed
Fix a few more cppcheck warnings and ignore the exported functions
2015-12-19 18:51:18 -08:00
Cary R
399384d81b
Fix some cppcheck warnings and bugs
2015-12-19 17:19:19 -08:00
Cary R
2aaa050b7c
Update cppcheck suppression file
2015-12-19 11:58:31 -08:00
Cary R
a4177f6ddc
VHDL: Add some missing newlines
2015-12-19 10:50:16 -08:00
Cary R
4b9b0b7125
GTKWave (fstapi.c) needs realpath() so check for it
2015-12-19 09:11:48 -08:00
Cary R
e85d95a659
Cleanup any allocated event queue data
2015-12-14 21:08:17 -08:00
Cary R
ad4b523edc
A VHDL ExpAttribute() can share the base so don't just delete them
2015-12-13 19:01:33 -08:00
Cary R
45fc06cf11
A format is a vpiStringVal not vpiStringVar, fix memory leak
2015-12-13 18:57:09 -08:00
Cary R
aacb4df1dd
Fix memory leak found with valgrind
2015-12-13 14:55:05 -08:00
Cary R
24d1f49f3e
Fix compile warning from recent patch
2015-12-08 22:07:27 -08:00
Stephen Williams
fbeac729af
Merge pull request #86 from orsonmmz/files
...
Basic support for std.textio/ieee.std_logic_textio
2015-12-07 10:37:13 -08:00
Maciej Suminski
ab025f1e3b
vhdlpp: VTypeRange split to VTypeRangeConst and VTypeRangeExpr.
...
When range cannot be evaluated it uses the original expressions.
2015-12-04 11:40:03 +01:00
Maciej Suminski
7cebed7382
vhdlpp: Disabled evaluation for ExpTime.
...
It was always evaluated to a value expressed in femtoseconds,
which not always might be the case.
2015-12-04 11:38:19 +01:00
Maciej Suminski
96a0a84e6c
vhdlpp: Fixed the range boundaries order.
2015-12-04 10:29:08 +01:00
Maciej Suminski
2e9c3555cb
vhdlpp: AssertStmt::elaborate() probes the condition type.
2015-12-03 17:56:56 +01:00
Maciej Suminski
f4238eb563
vhdlpp: Minor code cleaning.
2015-12-03 17:56:41 +01:00
Maciej Suminski
652fe378b8
vhdlpp:: Added ExpUnary::probe_type() function.
2015-12-03 17:54:22 +01:00
Maciej Suminski
9df470c341
vhdlpp: While loops.
2015-12-03 17:53:13 +01:00
Maciej Suminski
bb695c6e11
vhdlpp: Fixed infinite recursion when evaluating ExpTime.
2015-12-01 16:38:54 +01:00
Maciej Suminski
d5853ff5d7
vhdlpp: File declarations with specified file name and open mode.
2015-12-01 16:38:54 +01:00
Maciej Suminski
83f01a5fc4
vhdlpp: Support for implicit initalizers and finalizers.
2015-12-01 16:38:54 +01:00
Maciej Suminski
e4ba4b5acd
vhdlpp: Added means to use 'initial' and 'final' blocks during translation.
2015-12-01 10:33:20 +01:00
Maciej Suminski
cb40a845e1
vhdlpp: Allow procedure calls with empty param list.
2015-12-01 10:33:20 +01:00
Maciej Suminski
5535b7d26c
vhdlpp: Corrected error messages.
2015-12-01 10:33:20 +01:00
Maciej Suminski
2f40c96527
vhdlpp: Basic support for std.textio & ieee.std_logic_textio.
2015-12-01 10:33:20 +01:00
Maciej Suminski
7b483e69d8
vhdlpp: Minor changes.
2015-12-01 10:32:47 +01:00
Maciej Suminski
46ea9e6954
vhdlpp: Out & inout arguments in subprogram calls are turned to registers.
...
Otherwise it is not possible to modify their values in subprograms.
Argument elaboration has been moved to a separate function, so now it is
common for procedure and function calls.
2015-12-01 10:32:47 +01:00
Maciej Suminski
637d7c9633
vhdlpp: Special handling for STRING type during type emission.
2015-11-24 17:19:33 +01:00
Maciej Suminski
ba3c07a59a
vhdlpp: CHARACTER type is converted to bit[7:0] instead of byte.
...
This way it is possible to have limited size strings. Previously they
were translated to unpacked array of bytes, which cannot be assigned as
it was a string.
2015-11-24 17:19:33 +01:00
Maciej Suminski
b414733f34
vhdlpp: std.textio & ieee.std_logic_textio functions implemented using VPI.
2015-11-24 17:16:51 +01:00
Maciej Suminski
6fee37a640
vhdlpp: Simplified regex to detect string literals.
2015-11-23 16:25:08 +01:00
Maciej Suminski
925827d2c2
vhdlpp: Escape quotation marks in emitted strings.
2015-11-23 16:25:08 +01:00
Maciej Suminski
6f5addb1b7
vhdlpp: Fixed a gcc warning.
2015-11-23 16:25:08 +01:00
Maciej Suminski
5b0bf08638
vhdlpp: Simplified a few find_* functions.
2015-11-23 16:25:08 +01:00
Maciej Suminski
0569474d17
vhdlpp: Evaluate power (**) and division remainder (REM) operators.
2015-11-23 16:25:08 +01:00
Stephen Williams
a62a095717
Merge pull request #83 from chrta/fix_compiler_warnings
...
Fix 3 compiler warnings
2015-11-02 17:20:57 -08:00
Cary R
6c91588d33
Fix some errors found with cppcheck
2015-11-02 00:14:29 -08:00
Christian Taedcke
3ffe6684e2
Add definition of _DEFAULT_SOURCE.
...
Since glibc version 2.20, _SVID_SOURCE is deprecated, see
'man 7 feature_test_macros'. To be able to compile this code without compiler
warnings in new and old glibc versions, both _DEFAULT_SOURCE and _SVID_SOURCE
must be defined.
2015-10-31 11:17:18 +01:00
Christian Taedcke
be06aa39ab
Remove unused static function basename.
2015-10-31 11:17:18 +01:00
Stephen Williams
1b3da449dc
Merge pull request #82 from chrta/fix_cppcheck_issues
...
Make a few constructors explicit.
2015-10-30 15:57:34 -07:00
Christian Taedcke
6d5aabd4f0
Make a few constructors explicit.
...
This removes cppcheck warnings.
2015-10-22 12:33:33 +02:00
Cary R
97fca3fc4b
Fix the modpath delay to ignore bits that are not changing
2015-10-21 22:01:24 -07:00
Stephen Williams
a93139f141
Merge branch 'master' of github.com:steveicarus/iverilog
2015-10-17 17:06:26 -07:00
Stephen Williams
da9f7878bc
Fix minor uninitialized memory access.
2015-10-17 17:06:12 -07:00
Stephen Williams
35b6bdf578
Don't warning about floating local/internal symbols.
2015-10-02 11:23:05 -07:00
Cary R
fbc94a95df
Update LZ4 files to latest from GTKWave
2015-10-02 10:32:34 -07:00
Cary R
a65c007fdb
Fix some cppcheck warnings
2015-10-02 09:43:54 -07:00
Stephen Williams
8f095f12de
Add -Wfloating-nets warnings.
2015-10-01 15:17:03 -07:00
Stephen Williams
466b6464bc
Some minor vvp runtime performance tweaks.
2015-10-01 12:43:56 -07:00
Stephen Williams
4338d43cea
Opcodes documentation fixes.
2015-09-30 16:25:35 -07:00
Stephen Williams
f01a312f17
Minor code generation improvements
...
Use $flag_inv instead of %inv is several places.
2015-09-30 16:25:10 -07:00
Stephen Williams
fe7156289b
Remove some useless vvp opcodes.
2015-09-30 15:41:22 -07:00
Stephen Williams
571109481f
Use cmpi in more cases
...
Before this patch, only literals on the right side of a < compare
(or left side of a > compare) would be blended into a %cmpi instruction.
This patch broadends the cases where the %cmpi can be used.
2015-09-30 12:35:19 -07:00
Stephen Williams
81f54ec0cb
Have scope auto-rename generate names that use the index numbers
...
In generate blocks such as for loops, there may be many generated
scopes that have the same generated name. But in these cases, there
is an index number in the hname that can be used. So do so.
2015-09-29 17:44:28 -07:00
Stephen Williams
66de0fc3e2
Merge branch 'master' of github.com:steveicarus/iverilog
2015-09-22 16:15:47 -07:00
Stephen Williams
8803eb3288
Handle numeric literals with no digits.
2015-09-22 16:15:41 -07:00
Martin Whitaker
a1e0040d82
Fix for GitHub issue #79 - literal numbers must have at least one digit.
...
The bug report was for an assertion failure when a number contained only
a lowline (e.g. 'b_), but the standard says that a number can't start
with a lowline (e.g. 'b_1). The parser already rejected these cases for
decimal numbers, but allowed them through for binary/octal/hex numbers.
2015-09-23 00:01:39 +01:00
Tomasz Hemperek
821b87a3eb
Update .travis.yml
2015-08-24 10:58:54 +02:00
Tomasz Hemperek
a844f4a8a2
use docker infrastructure for travis
2015-08-24 10:57:47 +02:00
Martin Whitaker
027e060865
Fix for br992 - prevent assertion/crash on declarations outside a module.
...
parse.y has been updated to allow declarations outside a module (legal
in SystemVerilog), but not all types of declaration are supported yet.
Output a sorry or error message as appropriate.
2015-08-21 00:02:42 +01:00
Stephen Williams
d2c72a126d
Remove synthesis warning.
2015-08-20 13:51:42 -07:00
Stephen Williams
238c7b3b9a
Merge branch 'master' of github.com:steveicarus/iverilog
2015-08-20 13:49:53 -07:00
Stephen Williams
f372cb0c0b
Fix windres input version string for v10 and later.
2015-08-20 13:49:38 -07:00
Cary R
19009ec808
Merge branch 'master' of github.com:steveicarus/iverilog
2015-08-18 16:23:02 -07:00
Cary R
e682029648
A concatenation or the expression being replicated must have a non-zero width
2015-08-18 16:22:50 -07:00
Stephen Williams
df7b1879dd
Rework vvp file version checking.
2015-08-17 15:37:28 -07:00
Martin Whitaker
9f4b485c1c
Updated copyright dates displayed for main programs and targets.
2015-08-17 22:05:08 +01:00
Martin Whitaker
5dc8edef84
Fix for br991 - compiler crashes due to null statements.
...
The reported problem was caused by a null statement in a case statement,
which caused the check for an infinite loop to fail. Further testing
exposed more problems with null statements in loop statements - these
caused crashes earlier in elaboration.
2015-08-17 21:52:31 +01:00
Larry Doolittle
29478eba4c
Squelch just a few trailing spaces in source code
2015-08-17 11:44:45 -07:00
Larry Doolittle
4dd65926ae
Spelling fixes
2015-08-17 11:35:10 -07:00
Martin Whitaker
94595fb5f2
Fixed version number in vvp man page.
2015-08-16 23:07:09 +01:00
Cary R
3082dceb6e
Update vvp examples to have correct version number
2015-08-15 20:30:20 -07:00
Stephen Williams
caffcc14cd
Switch devel branch to version 11.
2015-08-15 14:23:20 -07:00
Stephen Williams
f66f573fb6
Change Version numbering scheme.
2015-08-15 14:20:41 -07:00
Maciej Suminski
434bf0fe46
Fixed vhdlpp bison conflicts.
2015-08-12 11:43:09 -07:00
Stephen Williams
5147105042
Merge pull request #76 from orsonmmz/fixes
...
Fixes for br985, br986, br987
2015-08-11 10:40:59 -07:00
Maciej Suminski
fc2139f01c
vhdlpp: Allow sequence_of_statements to be empty.
...
Fix for br987.
2015-08-09 19:45:44 +02:00
Maciej Suminski
775904ab0f
vhdlpp: ExpName::elaborate_rval accepts enum values.
...
Fix for br986.
2015-08-09 18:48:59 +02:00
Maciej Suminski
0ae3414ec5
vhdlpp: ExpUnary::elaborate_expr() elaborates its operand as well.
...
Fix for br985.
2015-08-09 18:48:15 +02:00
Maciej Suminski
f3321126ed
vhdlpp: Fixed a problem with types defined as an array of arrays.
2015-08-09 16:43:04 +02:00
Martin Whitaker
428f059c58
Fix shadow warning introduced by MVSE 2015 hacks.
2015-08-07 23:05:02 +01:00
Martin Whitaker
e98bcb61bb
Fix for br988 - support begin/end blocks nested inside generate blocks.
...
This is syntax permitted in 1364-2001 but removed in 1364-2005.
Also update the iverilog man page to document the anachronisms warning
class that warns about use of this feature when a later generation is
selected.
2015-08-07 22:46:09 +01:00
Martin Whitaker
5facf243cd
Fix for br990 - handle empty expression in parameter assignment by name.
2015-08-07 21:11:07 +01:00
Martin Whitaker
853f119d83
Fix for br989 - unsupported attributes are not fatal.
...
The compiler was emitting a "sorry" message and aborting compilation when
it encountered attributes on a wire declaration/assignment. Change this
to a warning, as most attributes are ignored anyway.
2015-08-05 18:22:25 +01:00
Larry Doolittle
3e2196651a
Remove unused parameter to indices_to_expressions
...
need_addr has been hanging around, unused, since commit 078a3fd4 on Jan 17, 2014.
2015-07-31 09:48:33 -07:00
Stephen Williams
64b72cf7e1
Clean up MCS/GNU portability hacks in header files.
2015-07-23 17:35:31 -07:00
Frederick C. Kurz
d766e82aa1
Changes for vvp/vvp_net.h
...
"# include <string>" was added so "Microsoft Visual Studio Express 2015 RC Web" could compile it without error. "static void operator delete[](void*); was preprocessed so "Microsoft Visual Studio Express 2015 RC Web" could link it without error for a function not yet implemented.
2015-07-22 18:02:52 -07:00
Frederick C. Kurz
c35f2f8334
Changes to vvp/vthread.cc
...
"child->delay_delete = 1;" was added, for when building with "Microsoft Visual Studio Express 2015 RC Web" in DEBUG mode, so that pr2909555.v would pass with -strict, otherwise it would cause memory access error will trying to access the previously deleted "child" variable.
2015-07-22 18:02:45 -07:00
Frederick C. Kurz
afd225a44d
Changes to vvp/vpi_vthr_vector.cc
...
Changed for "Microsoft Visual Studio Express 2015 RC Web" so gold files would match.
2015-07-22 18:00:59 -07:00
Frederick C. Kurz
b36a0a2c54
Changes to vvp/vpi_signal.cc
...
Changed the #ifdef structure so "Microsoft Visual Studio Express 2015 RC Web" could compile it without error.
2015-07-22 17:56:58 -07:00
Frederick C. Kurz
a3728dcf20
Changes to vvp/vpi_mcd.cc
...
Changed for"Microsoft Visual Studio Express 2015 RC Web" so vpi/pr723.v would pass.
2015-07-22 17:56:20 -07:00
Frederick C. Kurz
4cf4cdabcd
Changes to vhdlpp/expression.cc
...
Changed for "Microsoft Visual Studio Express 2015 RC Web" for runtime memory access violation for vhdl_test4.vhd.
2015-07-22 13:19:50 -07:00
Frederick C. Kurz
5f906369b5
Changes to vvp/vpi_callback.cc
...
Changed for"Microsoft Visual Studio Express 2015 RC Web" so gold files would match.
2015-07-22 10:10:32 -07:00
Frederick C. Kurz
12f4d29df3
Changes to vvp/class_type.cc
...
Changed for "Microsoft Visual Studio Express 2015 RC Web" so sv_class14.v would pass without runtime memory error.
2015-07-22 10:06:19 -07:00
Frederick C. Kurz
5e931b7e89
Changes to vpi/v2009_array.c
...
"Microsoft Visual Studio Express 2015 RC Web" cannot have a variable for the size when declaring an array, it won't compile.
2015-07-22 10:02:33 -07:00
Frederick C. Kurz
11d7cbd3e2
Changes to vpi/sys_fileio.c
...
Changed for "Microsoft Visual Studio Express 2015 RC Web" so running vvp on pr2800985a.v won't crash.
2015-07-22 09:53:42 -07:00
Frederick C. Kurz
7aff1adf99
Changes to vpi/sys_display.c
...
First and second areas were changed for "Microsoft Visual Studio Express 2015 RC Web" so that gold files would match. For the third area of change, "Microsoft Visual Studio Express 2015 RC Web" wanted to print 6 zeros after the decimals for the values of 0.0 and -0.0, and then the gold files wouldn't match.
2015-07-22 09:48:01 -07:00
Frederick C. Kurz
093e7eb2c8
Changes to netlist.h
...
Changes so "Microsoft Visual Studio Express 2015 RC Web" could build it without a bunch of runtime errors and crashes during regression testing. When declaring an bitfield variable of type enum in a struct, the enum has to have an underlying integer type for MSVC++ when compiling a C++ file, and for these cases, it had to be unsigned integer for everything to work okay during regression testing.
2015-07-22 09:39:58 -07:00
Frederick C. Kurz
82d46a5e1a
Changes to ivl_target.h
...
Changes so "Microsoft Visual Studio Express 2015 RC Web" could build it without a bunch of runtime errors and crashes during regression testing. When declaring an bitfield variable of type enum in a struct, the enum has to have an underlying integer type for MSVC++ when compiling a C++ file, and for these cases, it had to be unsigned integer for everything to work okay during regression testing.
2015-07-22 09:23:48 -07:00
Frederick C. Kurz
fc976bdb97
Changes for pform.cc
...
First area of Change for "Microsoft Visual Studio Express 2015 RC Web" was for compiling with error when NDEBUG defined. The second and third areas of change for "Microsoft Visual Studio Express 2015 RC Web", the dynamic_cast has to come first so parpkg_test.v, parpkg_test1.v, parpkg_test2.v would pass.
2015-07-22 09:22:26 -07:00
Frederick C. Kurz
9f7995f648
Changes for ivl_alloc.h
...
Changed so "Microsoft Visual Studio Express 2015 RC Web" could compile it without error.
2015-07-22 09:14:24 -07:00
Frederick C. Kurz
9bcafe39c6
Changes to elab_type.c
...
Changes for "Microsoft Visual Studio Express 2015 RC Web" to first check for a dereferencable iterator so pr1741212.v, and many others, will pass with a DEBUG build.
2015-07-22 09:09:47 -07:00
Cary R
9635f031a1
Correctly display events when dumping using the FST format
...
This patch is from Tony Bybell and fixes a segmentation fault when dumping
an event to a FST file.
2015-07-22 00:30:13 -07:00
Martin Whitaker
e6be9dec08
Improve error reporting for unnamed module ports.
...
Implicit ports may be unnamed, either because the port expression
is not a simple/escaped identifier, or because there is no port
expression. To handle these cases, error messages should report
the port position as well as the port name.
2015-07-10 23:02:27 +01:00
Martin Whitaker
97c6339241
Ensure VPI release on net connected to island returns correct value.
2015-07-01 09:00:43 +01:00
Martin Whitaker
8d2149f5aa
Further fix for GitHub issue #73 - also handle part selects.
2015-06-30 23:59:00 +01:00
Martin Whitaker
e8225bd39e
Fix for GitHub issue #73 - allow for island ports in vpi_put_value.
...
In the special case that a net is attached to an island port, values
driven onto the net via the VPI must go to the functor, not the filter,
so that they propagate through the island.
2015-06-30 21:50:13 +01:00
Stephen Williams
935ee6137d
Merge pull request #71 from orsonmmz/procedure_calls
...
Procedure calls
2015-06-30 08:27:51 -07:00
Martin Whitaker
586e415d96
Allow macro arguments to be omitted when default values are available.
...
SystemVerilog allows fewer actual arguments than formal arguments when
all remaining formal arguments have default values.
2015-06-27 19:02:02 +01:00
Martin Whitaker
637fc40dd9
Fix various bugs in vpi_put_value.
...
When putting a value onto a wire, the value needs to be sent to the
filter, not the functor (the functor may be part of the expression
that drives the wire).
Force and release weren't implemented properly (or at all in the
case of real values). They need to behave the same as the force
and release operations in vthread.cc.
2015-06-26 08:49:41 +01:00
Martin Whitaker
05a52e55e9
Create a BUFZ to drive the 0.0 value onto an undriven real wire.
...
This is needed to allow forced values to propagate correctly.
2015-06-26 00:45:00 +01:00
Martin Whitaker
59c211d20c
Fix stub target to handle real valued constants.
2015-06-26 00:41:43 +01:00
Martin Whitaker
dad223316e
Fix propagation of unforced bits when forcing a part select.
...
vvp_net_t::force_vec4 propagates all bits of the forced value passed
to it, regardless of the mask value. I can't see any way to fix this
directly, so instead make sure anything that calls force_vec4 sets
the unforced bits of the passed value to the correct value.
2015-06-25 00:13:57 +01:00
Maciej Suminski
df597e19cb
vhdlpp: Removed conversion of '*_edge(sig)' to 'always begin..end @(*edge sig)'.
2015-06-24 23:53:33 +02:00
Maciej Suminski
7597270939
vhdlpp: Fixed $ivlh_rising/falling_edge().
...
Conditions to detect rising/falling edges were incorrect.
VHDL standard specifies it has to detect the current value,
rather than compare against the previous one.
2015-06-24 23:53:33 +02:00
Maciej Suminski
5509b3c7a5
vhdlpp: Enums are based on integer type.
...
This way than can be used as output ports.
2015-06-24 23:53:33 +02:00
Maciej Suminski
49253c43ba
vhdlpp: Do not emit reg/wire prefix for enums.
2015-06-24 23:53:33 +02:00
Maciej Suminski
311ffb27f2
ivl: Enum output ports are implicit regs when based on 'logic' type.
2015-06-24 23:53:33 +02:00
Maciej Suminski
f0fd73e146
ivl: Array querying functions ($left, $low, etc.) for localparams.
2015-06-24 23:53:33 +02:00
Maciej Suminski
5858e1bbac
vhdlpp: ExpName::probe_type() checks Subprogram parameters.
2015-06-24 23:53:33 +02:00
Maciej Suminski
95044d9ac7
vhdlpp: VType::type_match() checks definitions provided by VTypeDef.
2015-06-24 23:53:33 +02:00
Maciej Suminski
c6f934964f
vhdlpp: NOT is translated to either ~(...) or !(...) depending on the argument type.
2015-06-24 23:53:32 +02:00
Maciej Suminski
6f867d6f01
vhdlpp: Changed 'char' to 'byte'.
2015-06-24 23:53:32 +02:00
Maciej Suminski
e6b57910a4
vhdlpp: ScopeBase::is_enum_name checks enums from standard libraries.
2015-06-24 23:53:32 +02:00
Maciej Suminski
cc9b182eb6
vhdlpp: Procedure calls.
2015-06-24 23:53:32 +02:00
Maciej Suminski
d39f692cfd
vhdlpp: Refactored the way of handling standard types.
2015-06-24 23:53:32 +02:00
Maciej Suminski
b666b9c0bf
vhdlpp: Fixed a few memory leaks.
2015-06-24 23:53:32 +02:00
Maciej Suminski
b3c1fa3e85
vhdlpp: Elaborate prefix & indices for ExpName.
2015-06-24 23:53:32 +02:00
Maciej Suminski
169228ad0f
vhdlpp: Refactored the way of handling standard VHDL library functions.
2015-06-24 23:53:31 +02:00
Maciej Suminski
356a09d295
vhdlpp: VTypeArray::evaluate_ranges uses range boundaries to determine the direction.
2015-06-24 23:53:31 +02:00
Maciej Suminski
47c5ce0ab6
vhdlpp: Subprogram split to SubprogramHeader and SubprogramBody.
2015-06-24 23:53:31 +02:00
Maciej Suminski
3c437874e2
vhdlpp: Allow initializers for variables.
2015-06-24 23:53:31 +02:00
Maciej Suminski
c28000c55f
vhdlpp: Support for selected assignments.
2015-06-24 23:53:31 +02:00
Maciej Suminski
5a0d967682
vhdlpp: More renaming in ExpConditional.
2015-06-24 23:53:31 +02:00
Maciej Suminski
49efe6573c
vhdlpp: Minor ExpConditional refactoring.
...
Merged cond_ and true_clause_ to else_clause_ list to make
code more generic.
2015-06-24 23:53:31 +02:00
Maciej Suminski
ea12c0fe23
vhdlp: Renamed ExpConditional::else_t to ExpConditional::option_t.
2015-06-24 23:53:31 +02:00
Martin Whitaker
44dfc41004
Detect and report excess function arguments.
...
Also enhance a couple of error messages.
2015-06-21 09:07:11 +01:00
Martin Whitaker
bdd0657140
Reject default task/function arguments when parsing traditional Verilog.
2015-06-21 09:05:39 +01:00
Martin Whitaker
1d279798d8
Fix for br982 - detect and report missing output arguments in task calls.
2015-06-20 22:39:55 +01:00
Martin Whitaker
0e66e9781a
Add support for non-constant default subroutine arguments.
...
Input ports only at the moment. Output "sorry" message for other
port types.
2015-06-20 21:39:45 +01:00
Larry Doolittle
b23faff27c
Just a few more spelling fixes
...
Includes some user-visible messages
2015-06-17 08:09:34 -07:00
Martin Whitaker
b242663cae
Support negedge flip-flops in synthesis and in vvp.
...
Also extend the support for FF asynchronous set values to vvp and
fix the dff functor in vvp to correctly model asynchronous set/clr
behaviour.
2015-06-13 16:47:57 +01:00
Martin Whitaker
d39c284055
Observe and propagate failures when synthesising lval concatenations.
2015-06-13 16:47:57 +01:00
Stephen Williams
6a73de0c43
Merge pull request #70 from orsonmmz/time
...
Time expressions for vhdlpp
2015-06-08 16:17:40 -07:00
Martin Whitaker
e0cdd71984
Minor cleanup and simplification of aset_value changes.
2015-06-08 21:20:49 +01:00
Johann Klammer
81e1735959
establish support for aset_value and reorder clauses so vlog95 doesn't fail anymore.
2015-06-08 20:34:50 +01:00
Johann Klammer
3fb65eb51a
single bit reset
2015-06-08 20:34:43 +01:00
Martin Whitaker
3080f5730d
Better implementation of assignment lval concatenation synthesis.
2015-06-08 20:27:38 +01:00
Maciej Suminski
29ddd5208f
vhdlpp: 'wait on' and 'wait until' statements.
2015-06-08 18:42:52 +02:00
Maciej Suminski
4a31f36646
vhdlpp: Minor code cleaning.
2015-06-08 18:42:52 +02:00
Maciej Suminski
1f1d47887e
vhdlpp: Visitor for Expression class.
2015-06-08 18:42:52 +02:00
Maciej Suminski
80403d2ade
ivl: Disabled reg_flag for time type in SV.
2015-06-08 18:42:52 +02:00
Maciej Suminski
cd3180d1c2
ivl: TIME_LITERAL added as a primary expression.
2015-06-08 18:42:52 +02:00
Maciej Suminski
68f8007fc4
vhdlpp: 'wait for' statement.
2015-06-08 18:42:52 +02:00
Maciej Suminski
d6ff1946f9
vhdlpp: Support for time expressions.
2015-06-08 18:42:52 +02:00
Martin Whitaker
4068c172f4
Fix overzealous detection of duplicate net/variable declarations.
...
As reported by Larry Doolittle on iverilog-devel.
2015-06-07 08:48:33 +01:00
Stephen Williams
9ac9f1c9f2
Merge branch 'master' of github.com:steveicarus/iverilog
2015-06-04 15:11:29 -07:00
Larry Doolittle
2739f83702
Spelling fixes in C and C++ comments
2015-06-04 15:00:29 -07:00
Cary R
7af3280215
Update cppcheck suppression file in VPI
2015-06-04 09:50:08 -07:00
Stephen Williams
05d591ccd6
Fix broken write to log files.
2015-06-03 14:32:04 -07:00
Stephen Williams
fbedf4ae22
Snapshot 2015-06-03
2015-06-03 11:16:07 -07:00
Stephen Williams
e6c6f6c81e
Use fwrite to write $display output, instead of fprintf
...
This change makes it safe to write non-ascii characters, which
is an issue when the %u format is used.
2015-06-03 10:00:35 -07:00
Larry Doolittle
33c651aa00
Spelling fixes in .txt files
2015-05-25 12:52:03 -07:00
Stephen Williams
358bb4d5d9
Merge branch 'master' of github.com:steveicarus/iverilog
2015-05-25 12:51:20 -07:00
Martin Whitaker
d5b41853fd
Fix for br979 part 2 - handle blank lines in macro definition continuation.
2015-05-22 18:44:25 +01:00
Martin Whitaker
0fc10e3e70
Fix for br979 part 1 - strip leading/trailing space from macro actual args.
...
Although the IEEE standard doesn't explicitly state this is required,
the examples added in the SystemVerilog standard show that this is
expected.
Also add a preprocessor lexical rule to recognise `` inside a macro
definition when it is not immediately followed by an identifier.
2015-05-22 18:11:24 +01:00
Martin Whitaker
ab688613cc
Fix for br978 - assertion involving addition of $ivlh_to_unsigned() result.
...
$ivlh_to_unsigned, unlike $signed and $signed, can cause a reduction
in width. The shared PECallFunction::cast_to_width_ method did not
support this.
2015-05-22 00:05:39 +01:00
Stephen Williams
79042e38ad
Merge branch 'master' of github.com:steveicarus/iverilog
2015-05-21 10:05:37 -07:00
Stephen Williams
ced9759c65
Merge pull request #69 from orsonmmz/fixes
...
Various fixes
2015-05-21 10:05:26 -07:00
Stephen Williams
8f22998447
Merge branch 'master' of github.com:steveicarus/iverilog
2015-05-21 09:58:36 -07:00
Maciej Suminski
51d7237d52
vhdlpp: Display error message for undefined generic values.
2015-05-21 01:25:34 +02:00
Maciej Suminski
7aab315ce5
vhdlpp: Allow assigning values to inout ports.
2015-05-20 17:30:07 +02:00
Maciej Suminski
bc83d2914a
vhdlpp: Corrected an error message for attributes.
2015-05-20 14:23:57 +02:00
Maciej Suminski
bb2e6782fa
Copy constructor for LineInfo.
2015-05-19 22:40:56 +02:00
Larry Doolittle
9231ad51a4
vhdlpp: generics without a default value are set to 1'bx.
2015-05-19 22:40:56 +02:00
Maciej Suminski
25458b8cc2
vhdlpp: inout direction for ports.
2015-05-19 22:40:56 +02:00
Maciej Suminski
515ab40ffe
vhdlpp: Special handling for string type emission.
2015-05-19 22:40:56 +02:00
Maciej Suminski
ddc204391e
vhdlpp: Add 'sub' prefix for subtypes while emitting packages.
2015-05-19 22:40:55 +02:00
Maciej Suminski
a33bbecc98
vhdlpp: VTypeRange::write_to_stream uses to/downto depending on the range boundaries.
2015-05-19 22:40:55 +02:00
Martin Whitaker
61ace52f31
Fix vlog95 target to not output data types in port declarations.
...
This avoids variable redeclaration errors.
2015-05-18 23:16:53 +01:00
Martin Whitaker
71b1546a7d
Fail gracefully when an unpacked struct is declared.
2015-05-17 21:59:05 +01:00
Martin Whitaker
578a2543f7
Fix for br975 - assertion failure due to duplicate declaration of struct var.
...
Added proper error handling for duplicate declarations of all variable
types.
2015-05-17 20:54:53 +01:00
Martin Whitaker
a479bd6b16
Fix for br977 - preprocessor macros substitute text inside token.
...
When replacing macro formal parameters, the preprocessor should not
replace matching strings that are not complete tokens. The test for
this was incorrect, and failed when a match was found at the start
of the replacement text.
2015-05-17 20:05:45 +01:00
Martin Whitaker
c75498b1d4
Add -i (interactive) option to vvp.
...
This forces <stdout> to be unbuffered. This is useful when using the
mintty terminal emulator in Windows (as used by MSYS2 and CygWin),
which identifies as a pipe, not a tty.
2015-05-16 00:39:03 +01:00
Martin Whitaker
b6304129fa
Fix for GutHub issue #64 - vvp interrupt/continue in Windows.
...
Windows implements the original UNIX semantics for signal(), which
means you have to re-establish the signal handler each time a signal
is caught.
2015-05-15 22:30:03 +01:00
Tomasz Hemperek
50180ac4a6
Add clang support for travis
2015-05-13 21:35:21 +02:00
Stephen Williams
bb444b6178
Snapshot 2015-05-13
2015-05-13 10:21:19 -07:00
Stephen Williams
7442c14689
Merge pull request #67 from orsonmmz/boolean
...
Boolean & asserts for vhdlpp
2015-05-13 09:57:18 -07:00
Stephen Williams
0082795967
Merge pull request #61 from orsonmmz/asserts
...
Asserts
2015-05-13 09:56:27 -07:00
Martin Whitaker
ac4f4cf1a0
Update man pages.
...
Removed obsolete -m32 and -ivl options from iverilog-vpi man page
and revised description of -mingw option. Also removed duplicate
descriptions of --cflags, --ldflags, and --ldlibs options. Updated
link to main iverilog web page in all man pages.
2015-05-10 13:19:51 +01:00
Martin Whitaker
676d23f973
Add extra whitespace in driver-vpi/main.c for readability.
2015-05-10 13:19:16 +01:00
Martin Whitaker
6069cbfc3c
Remove outdated instructions in mingw.txt and point to the Wiki instead.
2015-05-10 12:03:58 +01:00
Martin Whitaker
cfbc90812b
Enable use of MinGW ANSI stdio routines.
...
Defining __USE_MINGW_ANSI_STDIO=1 provides C99 compatible printf
and scanf routines, which avoids the need for workarounds for the
various failings of the Microsoft C runtime library.
2015-05-10 11:45:42 +01:00
Cary R
e530b4e642
Update fstapi.c to the latest from GTKWave
2015-05-08 16:36:12 -07:00
Martin Whitaker
6a3edc63d5
Fix printf format for size_t values when using 64-bit MinGW.
...
The Microsoft C runtime does not support the %zu and %zd formats.
Previously these were replaced with %u and %d, but for 64-bit we
need to use %llu and %lld.
2015-05-08 20:20:14 +01:00
Martin Whitaker
3069b8dd51
Simplify use of iverilog-vpi under Windows.
...
iverilog-vpi now automatically finds the IVL root directory,
eliminating the need for the -ivl option. Also, if the MinGW
root path hasn't been added to the registry, it now searches
the system path for it.
2015-05-08 20:15:54 +01:00
Maciej Suminski
7db01d8ded
vhdlpp: ScopeBase::is_enum_name() returns VTypeEnum* instead of bool.
2015-05-07 16:28:30 +02:00
Maciej Suminski
e4694cb6cb
vhdlpp: Changed emitted type from 'bool' to 'bit'.
2015-05-07 16:09:02 +02:00
Maciej Suminski
08e5aa021a
vhdlpp: Emits typedef for boolean type.
2015-05-07 16:09:02 +02:00
Larry Doolittle
4304fd503e
vhdlpp: and_reduce() and or_reduce() functions.
2015-05-06 10:03:02 +02:00
Maciej Suminski
5438464d67
vhdlpp: Support for reports & asserts.
2015-05-06 10:02:56 +02:00
Maciej Suminski
6df2979998
vhdlpp: Added missing std_logic values in ExpChar and ExpString::emit().
2015-05-06 09:55:08 +02:00
Maciej Suminski
9de4ced133
vhdlpp: Stop compilation on invalid attributes.
2015-05-06 09:55:08 +02:00
Martin Whitaker
45dc13e496
Use uintptr_t/intptr_t when casting between pointer and integer.
...
The code was using (unsigned) long, but a long is 32-bits in the
Windows 64-bit ABI.
2015-05-05 23:00:09 +01:00
Martin Whitaker
9e3f1ef1ff
Only apply linker renaming of strtod() when using 32-bit MinGW.
...
mingw-w64 doesn't need this, and the 64-bit version doesn't support it.
2015-05-05 22:55:15 +01:00
Tomasz Hemperek
914f959c67
Add .travis.yml
2015-05-05 16:39:28 +02:00
Martin Whitaker
1b3e321d35
Eliminate a few new compiler warnings.
2015-05-04 22:32:29 +01:00
Martin Whitaker
a27274aa04
Fix driver-vpi makefile to add C++ compiler flags to source code.
...
Also fix a few compiler warnings.
2015-05-04 22:10:29 +01:00
Martin Whitaker
f1be16be7c
Update PC version of iverilog-vpi to use CXXFLAGS for C++ compiles.
...
CFLAGS was being used for both C and C++ source files, but the
rcently added -Wstrict-prototypes flag is not valid for C++.
2015-05-04 18:40:53 +01:00
Martin Whitaker
9ac374501c
Updated config.guess and config.sub.
...
Sourced from the config project at http://git.savannah.gnu.org . This
version correctly identifies both 32 and 64 bit versions of mingw-w64.
2015-05-04 18:40:53 +01:00
Martin Whitaker
250b278d0e
Attempt to allow native line endings in Windows git checkouts.
...
Up to now, I've had to set git to preserve line endings when
building with MinGW. The problem seems to be gperf. Let's see
if this fixes it.
2015-05-01 22:55:19 +01:00
Cary R
52275deb0e
Fix compile build failure
2015-04-30 10:18:21 -07:00
Cary R
120ad59017
Merge branch 'master' of github.com:steveicarus/iverilog
2015-04-30 10:13:10 -07:00
Cary R
2ac8a555e1
Remove bison warning and make YACC rule match the rest
2015-04-30 10:12:57 -07:00
Cary R
8d845ae49f
Remove bison warning and make YACC rule match the rest
2015-04-27 16:25:40 -07:00
Martin Whitaker
352175d921
Fix for br973 - add support for enum declarations with no dimensions.
2015-04-26 12:46:08 +01:00
Martin Whitaker
e78205eacf
GitHub issue #60 (part 2) - warn about excessive array/vector dimensions.
2015-04-26 12:00:21 +01:00
Martin Whitaker
c6e618350d
Fix for GitHub issue #60 (part 1) - reject numeric constant with zero size.
2015-04-26 11:04:02 +01:00
Martin Whitaker
301a7e587b
Fix for GitHub issue #62 - assertion failure on too many array/vector indices.
...
Provide an error message for invalid code that contains more indices than
there are dimensions.
2015-04-25 22:57:14 +01:00
Martin Whitaker
3cee5d4567
Fix br972 - assertion failure with combinational loop on logic function.
...
Observe the warning note on nexus_log_add! The returned pointer is only
valid until the next pin is added to the nexus.
2015-04-25 19:50:00 +01:00
Martin Whitaker
e1ae5020c4
Another sorry message to catch non-constant RHS in procedural CA.
2015-04-25 11:25:33 +01:00
Martin Whitaker
22d15f9ca9
Fix handling of expression width with $ivlh_to_unsigned.
...
The first argument to $ivlh_to_unsigned should be treated as having
a self-determined width.
2015-04-25 09:20:31 +01:00
Larry Doolittle
19d966e235
Try to eliminate spurious -dirty in version_tag.h
2015-04-24 14:31:46 -07:00
Larry Doolittle
c8fe897446
vhdlpp: and_reduce() and or_reduce() functions.
2015-04-24 13:46:30 +02:00
Maciej Suminski
5101b3b64b
vhdlpp: Boolean values handled without using keywords.
2015-04-24 13:39:41 +02:00
Maciej Suminski
bed5ee4529
vhdlpp: Handle 'severity' statements without using keywords.
2015-04-24 13:39:41 +02:00
Maciej Suminski
7c0a191626
vhdlpp: Handle true/false values.
2015-04-23 11:58:40 +02:00
Maciej Suminski
cfa43c7742
vhdlpp: Support for reports & asserts.
2015-04-23 11:58:40 +02:00
Maciej Suminski
a5138e238f
vhdlpp: Added missing std_logic values in ExpChar and ExpString::emit().
2015-04-23 11:57:27 +02:00
Maciej Suminski
d352d8ead3
vhdlpp: Stop compilation on invalid attributes.
2015-04-23 11:57:27 +02:00
Cary R
02ee3874e7
Space/code cleanup and warn that vvp does not support S/R D-FF
2015-04-20 15:41:44 -07:00
Johann Klammer
f9fef5d00b
driven_mask...
2015-04-20 15:11:52 -07:00
Johann Klammer
891399185f
lhs partsel and sync scramble
2015-04-20 15:11:40 -07:00
Larry Doolittle
5dc1396eea
Spelling fixes
2015-04-13 11:35:12 -07:00
Martin Whitaker
ccf7c042c9
Fix null pointer dereference in debug output.
...
Don't display an elaborated for loop initial assignment if elaboration
has failed. Also remove duplicated message.
2015-04-13 16:31:28 +01:00
Martin Whitaker
560b9530fd
Fix for br970 - iverilog silently eats warnings when comma present in -W flag.
...
The -W option does not (currently) support comma separated lists and
silently ignores any string that doesn't match a known warning class.
Fix by outputing a warning message when the -W argument is unknown.
2015-04-13 14:53:56 +01:00
Martin Whitaker
b89c059153
Fix compiler crash on source code errors in always @* block loops.
...
The compiler was correctly detecting and reporting errors in loop
expressions and statements, but then crashing when it tried to build
the sensitivity list. Fix this by not adding a loop statement to the
netlist unless all its components have been successfully elaborated.
2015-04-13 14:39:10 +01:00
Cary R
8326fe843b
Update format string to use correct format character
2015-04-08 19:36:33 -07:00
Cary R
1cbc38100e
Update some cppcheck suppression files
2015-04-08 19:36:21 -07:00
Cary R
ba31252226
Update fstapi files to latest from GTKWave
2015-04-02 14:59:38 -07:00
Stephen Williams
008affe557
Merge pull request #57 from orsonmmz/br942
...
bugfix #942 : VHDL function bodies in arch declaration not supported
2015-04-01 08:22:03 -07:00
Maciej Suminski
0ca856d4e8
bugfix #942 : VHDL function bodies in arch declaration not supported
2015-03-31 10:46:24 +02:00
Stephen Williams
2a210dfee1
Merge pull request #56 from orsonmmz/expfunc
...
Expfunc
2015-03-27 17:44:13 -07:00
Maciej Suminski
83d721232d
ivl: $ivlh_to_unsigned() also tests its argument width.
2015-03-27 20:53:14 +01:00
Maciej Suminski
d5ffb55bfd
Corrected ambiguous copyright info.
2015-03-27 18:57:40 +01:00
Maciej Suminski
ab9a8ccbf3
vhdlpp: Added fit_type() & probe_type() for ExpFunc.
2015-03-27 18:57:40 +01:00
Maciej Suminski
e6525ec35f
vhdlpp: Added a constructor for VTypeArray that takes integers as ranges.
2015-03-27 18:57:40 +01:00
Maciej Suminski
afaedbd06d
vhdlpp: Corrected to_integer() & resize() functions.
...
to_integer() handles sign and resize() really applies size casting.
2015-03-27 14:53:43 +01:00
Maciej Suminski
d4237774a5
vhdlpp: Error message for missing types in VTypePrimitive::get_width().
2015-03-27 14:53:43 +01:00
Maciej Suminski
2f2539e557
vhdlpp: Renamed a range_t constructor parameter to be more descriptive.
2015-03-27 14:53:43 +01:00
Maciej Suminski
11a86794d9
ivl: Fixed size casting.
2015-03-27 14:53:43 +01:00
Maciej Suminski
3b14797075
vhdlpp: Prefix probe for VTypeArray.
2015-03-27 14:53:43 +01:00
Martin Whitaker
e006f9e132
Fix vvp crash when a part select of a wire is passed to $monitor.
...
When the PV expression is compiled, the parent net may not yet be
resolved, so we may not be able to get its VPI handle straight away.
2015-03-17 21:14:30 +00:00
Stephen Williams
437dc10341
Merge pull request #55 from orsonmmz/const_record
...
Const record
2015-03-12 10:30:56 -07:00
Cary R
102d2d534f
Remove extra warning code.
2015-03-09 14:35:31 -07:00
Cary R
5e437145bf
A SV queue can be signed.
2015-03-07 18:07:00 -08:00
Maciej Suminski
d1dc98b7f7
vhdlpp: Changed the workaround for accessing localparam arrays & records.
2015-03-07 20:47:20 +01:00
Cary R
50b45dac7b
Update queue push front/back code generation
2015-03-06 16:56:22 -08:00
Maciej Suminski
295e4e7dfb
vhdlpp: Fixed crash on unassociated generics.
2015-03-06 20:39:10 +01:00
Maciej Suminski
807ad8002d
vhdlpp: Check generics when searching through constants.
2015-03-06 20:39:10 +01:00
Maciej Suminski
d3229b9068
vhdlpp: 'string' type is emitted as 'string' instead of 'array <> of character'.
2015-03-06 17:58:04 +01:00
Maciej Suminski
099bb427bc
vhdlpp: ComponentBase::write_to_stream() saves generics.
2015-03-06 17:58:04 +01:00
Maciej Suminski
d406545331
vpi: $ivlh_{rising,falling}_edge functions.
2015-03-06 17:58:04 +01:00
Maciej Suminski
1de3fb1625
vhdlpp: "resize" function.
2015-03-06 17:58:04 +01:00
Maciej Suminski
e33b8b4dde
vhdlpp: VType::get_width() uses information from Scope to determine the type width.
2015-03-06 17:58:04 +01:00
Maciej Suminski
9128eb67b9
vhdlpp: Evaluates attributes if possible.
2015-03-06 17:32:25 +01:00
Maciej Suminski
afbda099fb
vhdlpp: Workaround to handle constant arrays of vectors & records.
2015-03-06 17:32:25 +01:00
Maciej Suminski
4b0d220671
vhdlpp: get_width() for VType.
2015-03-06 17:32:25 +01:00
Maciej Suminski
a42b056b24
vhdlpp: Alternative way of accessing constant arrays of vectors.
2015-03-06 17:32:25 +01:00
Maciej Suminski
1852c5ab9d
Revert "vhdlpp: Support for accessing words in constant arrays."
...
This reverts commit 9ca754b6db .
2015-03-06 17:32:25 +01:00
Cary R
24be13d825
Add support for SV strings to the scanf routines
2015-03-03 17:13:16 -08:00
Cary R
bddfcac823
The === and !== operators cannot be used with a SV string
2015-03-02 15:34:22 -08:00
Cary R
ea1c07e234
A dynamic array can have a signed type so pass that correctly
2015-03-02 14:40:38 -08:00
Cary R
8e0ae733ca
Add support for a SV string to $swrite and $sformat
2015-02-28 11:46:58 -08:00
Cary R
feb710a186
Add support for any width 2-state darray objects
2015-02-27 11:43:25 -08:00
Cary R
62abb199d7
Add support for 4-state dynamic arrays
2015-02-26 17:56:49 -08:00
Cary R
7373bf2224
Merge branch 'master' of github.com:steveicarus/iverilog
2015-02-25 19:21:00 -08:00
Cary R
ae629f8c41
Add ability to put a string value to a SV string (from plusargs)
2015-02-25 19:20:50 -08:00
Stephen Williams
03e0e96832
Merge branch 'master' of github.com:steveicarus/iverilog
2015-02-25 17:54:24 -08:00
Larry Doolittle
3c38b2972d
Add -Wstrict-prototypes to CFLAGS
...
... and patch vpi/sys_lxt.c so no new warnings are triggered.
2015-02-25 17:52:44 -08:00
Larry Doolittle
4f1fc6e302
Add -Wstrict-prototypes to CFLAGS
...
... and patch vpi/sys_lxt.c so no new warnings are triggered.
2015-02-25 17:48:38 -08:00
Cary R
f1436fbe62
Update fstapi.h to latest from GTKWave
2015-02-25 17:40:18 -08:00
Stephen Williams
a79533ddc9
Merge pull request #54 from orsonmmz/const_array
...
Update
2015-02-20 10:49:53 -08:00
Stephen Williams
d47afb588b
Merge pull request #52 from orsonmmz/unbounded_function
...
Unbounded vectors in VHDL functions.
2015-02-20 10:36:19 -08:00
Stephen Williams
386774ac19
Work towards handing packed arrayed members.
2015-02-19 20:02:15 -08:00
Maciej Suminski
9ca754b6db
vhdlpp: Support for accessing words in constant arrays.
2015-02-19 17:07:41 +01:00
Maciej Suminski
0f0bef32f2
vhdlpp: Architecture elaboration counts errors coming from expression elaboration.
2015-02-19 17:07:41 +01:00
Maciej Suminski
cd55f30a27
vhdlpp: Minor change to ScopeBase::find_constant().
2015-02-19 17:07:41 +01:00
Maciej Suminski
5884879b02
vhdlpp: to_integer() function.
2015-02-19 17:07:41 +01:00
Maciej Suminski
a1a4f47894
vhdlpp: Unnecessary comment.
2015-02-19 17:07:41 +01:00
Maciej Suminski
e569e07d4e
vhdlpp: Type 'NATURAL' is translated to 'int unsigned'.
2015-02-19 17:07:41 +01:00
Maciej Suminski
ee840391d6
vhdlpp: std_logic_vector, signed & unsigned are considered global types.
2015-02-19 17:07:41 +01:00
Maciej Suminski
0046e9eca0
vhdlpp: ActiveScope::is_vector_name() checks also for constants.
2015-02-19 17:07:41 +01:00
Maciej Suminski
f51c037432
vhdlpp: Generics from external packages are accepted (warning instead of error).
2015-02-19 17:07:37 +01:00
Maciej Suminski
763c6fe3c9
vhdlpp: Support for shift operators (SRL, SRR, SRA, SLA).
...
To be done: ROR & ROL.
2015-02-17 10:15:57 +01:00
Maciej Suminski
49b6ddf93c
vhdlpp: Signal/variable assignments can have labels.
2015-02-17 10:15:57 +01:00
Maciej Suminski
12b4914b63
vhdlpp: ExpName resolves enum values.
2015-02-17 10:15:57 +01:00
Maciej Suminski
fc0728ab6f
vhdlpp: Forward typedefs.
...
It was required to make it possible to use typedefs in port types.
Types from packages are emitted in `ifdef..`endif instead of package..endpackage.
The purest solution is to keep package..endpackage and emit appropriate prefix.
Also, it would be great to have constants emitted in the same way.
2015-02-17 10:15:57 +01:00
Maciej Suminski
46c41f9be2
ivl: Enum type can be used in port declarations.
2015-02-05 17:17:33 +01:00
Maciej Suminski
cdf18de10e
vhdlpp: Make integer expressions sized during the emission step.
2015-02-05 16:20:49 +01:00
Maciej Suminski
19ff6a434b
vhdlpp: Alternative way of dealing with unbounded vectors in fuctions (instances).
2015-02-05 12:00:25 +01:00
Maciej Suminski
5349ca9a55
vhdlpp: Added Subprogram::write_to_stream_body() method.
2015-02-05 12:00:25 +01:00
Maciej Suminski
5b7b980ead
vhdlpp: Support for multiple choices in case statements.
2015-02-05 12:00:25 +01:00
Maciej Suminski
a1c2a8e605
vhdlpp: Generic syntax errors display messages.
2015-02-05 11:25:03 +01:00
Maciej Suminski
8777cd8e7c
vhdlpp: Fixed ExpBitstring & ExpRelation write_to_stream() method.
2015-02-05 11:25:03 +01:00
Maciej Suminski
11bb7ac348
vhdlpp: Expression::write_to_stream becomes const.
2015-02-05 11:25:03 +01:00
Maciej Suminski
9de69f2f24
vhdlpp: SequentialStmts write_to_stream() methods.
2015-02-05 11:25:03 +01:00
Maciej Suminski
dae3410dcd
vhdlpp: Variable::write_to_stream().
2015-02-05 11:25:03 +01:00
Maciej Suminski
1a367c84b6
vhdlpp: Subprograms can have instances that take a different set of parameter types.
2015-02-05 11:25:03 +01:00
Maciej Suminski
8a854affa6
vhdlpp: Clone routines for Expression & VType classes.
2015-02-05 11:25:03 +01:00
Maciej Suminski
60077f4f06
vhdlpp: ExpBitstring elaborate_expr().
2015-02-05 11:25:03 +01:00
Maciej Suminski
51ce9f1a60
vhdlpp: Minor correction for casting to integer.
2015-02-05 11:25:03 +01:00
Maciej Suminski
48265ecd9b
vhdlpp: Subprograms return types have their ranges evaluated if possible.
...
Added VTypeArray::evaluate_ranges() method.
2015-02-05 11:24:59 +01:00
Maciej Suminski
abbcea64d0
vhdlpp: Array attributes can be evaluated in packages/functions.
2015-02-04 16:57:43 +01:00
Maciej Suminski
25c3798248
vhdlpp: Elaborate and emit functions work with ScopeBase instead of Architecture.
2015-02-04 16:57:43 +01:00
Maciej Suminski
90293d8e0a
vhdlpp: VTypeArray::is_variable_length() uses ScopeBase to determine if variable has constant length.
2015-02-04 16:57:43 +01:00
Maciej Suminski
621cf37339
vhdlpp: Added ScopeBase::find_param() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
6d75af86e6
vhdlpp: Added Subprogram::fix_variables() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
5d26f0e28d
vhdlpp: Added VTypeArray::is_variable_length() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
774609fbbb
vhdlpp: VTypeArray stores parent type, in case it is a subtype.
2015-02-04 16:57:43 +01:00
Maciej Suminski
9ba7694484
vhdlpp: Minor assert.
2015-02-04 16:57:43 +01:00
Maciej Suminski
870a826225
vhdlpp: Corrected VTypeDef::emit_def() to allow typedefed names in function headers.
2015-02-04 16:57:43 +01:00
Maciej Suminski
2ecfed0baa
vhdlpp: Moved part of check_unb_vector() to fix_logic_darray().
2015-02-04 16:57:43 +01:00
Maciej Suminski
56e410f386
vhdlpp: SigVarBase::peek_name_() method made public.
2015-02-04 16:57:43 +01:00
Maciej Suminski
d4dd635bf6
vhdlpp: Added ExpNew class.
2015-02-04 16:57:43 +01:00
Maciej Suminski
c287281bbe
vhdlpp: Tries to determine if function return type is fixed size.
...
Added Subprogram::fixed_return_type() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
962330f20a
vhdlpp: Functions support unbounded vectors as return type and parameters.
2015-02-04 16:57:43 +01:00
Maciej Suminski
777e7e0a3d
vhdlpp: Added ExpFunc::func_ret_type() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
839f9cd7ae
vhdlpp: Added ReturnStmt::cast_to() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
b8b2f53027
vhdlpp: Added VType::get_generic_typename() method.
2015-02-04 16:57:43 +01:00
Maciej Suminski
9b3bd039bb
vhdlpp: Added ExpCast class.
2015-02-04 16:57:42 +01:00
Maciej Suminski
51b9191021
vhdlpp: Added VType::is_unbounded() method.
2015-02-04 16:57:42 +01:00
Maciej Suminski
756c9ceccf
ivl: Functions returning a dynamic array may be casted to vector.
2015-02-04 16:02:38 +01:00
Maciej Suminski
8b3667f76e
ivl: Casting vectors to dynamic arrays.
2015-02-04 16:02:38 +01:00
Maciej Suminski
a52242745a
ivl: Casting dynamic arrays to vectors.
2015-02-04 16:02:38 +01:00
Maciej Suminski
ff5b696569
vhdlpp: Improved SequentialStmt visitor.
2015-02-04 16:02:38 +01:00
Maciej Suminski
b05a19dffc
vhdlpp: VTypeArray emits dimensions in a bit smarter way.
2015-02-04 16:02:38 +01:00
Maciej Suminski
e6b22a2bea
vhdlpp: Visitor for SequentialStmt.
2015-02-04 16:02:38 +01:00
Maciej Suminski
a02ebc3114
$ivl_darray_method$[from/to]_vec works with constants.
2015-02-04 16:02:38 +01:00
Maciej Suminski
0592ba042e
vhdlpp: For-loop emission rewritten to handle 'range in subprograms.
2015-02-04 16:02:38 +01:00
Maciej Suminski
bcca3cf395
ivl: Unpacked array typedefs are correctly recognized when used in function parameters.
2015-02-04 15:58:12 +01:00
Cary R
01ba41afd8
Only skip zero repeat expressions in a concatenation.
2015-02-02 18:15:12 -08:00
Cary R
84c592b068
Fix white space issue
2015-02-02 15:29:25 -08:00
Cary R
bb93a585b6
Generate correct vvp code for zero replication cases
2015-02-02 15:27:57 -08:00
Cary R
47688d234b
Assert if an unsupported dynamic array type is given.
2015-01-16 18:54:43 -08:00
Cary R
b3425d6cf3
Report that 4-state dynamic arrays are not currently supported in vvp
...
Also fix some error code propagation issues.
2015-01-16 18:22:16 -08:00
Cary R
40ae1051d4
Report the vvp only supports a dynamic array of size 8, 16, 32 or 64
2015-01-15 18:18:14 -08:00
Cary R
21c60b38e1
Fix space issues in the code.
2015-01-15 17:47:39 -08:00
Cary R
78c6b3cad2
More updates for sys_darray.c (fix 32-bit crash and optimize)
2015-01-15 17:44:13 -08:00
Cary R
a04104077f
Update top level cppcheck suppression file
2015-01-15 17:37:26 -08:00
Cary R
0e3a758894
Some cleanup of the calltf functions in sys_darray.c
2015-01-14 22:22:02 -08:00
Cary R
d682029240
Update compiletf routines in sys_darray to be more exact
2015-01-14 19:58:42 -08:00
Cary R
1ffcd40336
Fix a clear word to be after it has been used
2015-01-14 19:48:24 -08:00
Cary R
09439c55ab
Add new object to the vpi_get_str(vpiType, handle) code.
2015-01-14 19:08:00 -08:00
Cary R
c858dea2d5
Fix compile warning (remainder is a global)
2015-01-14 17:22:27 -08:00
Cary R
228a3f123a
For some local nets fix the local flag and file/line information
2015-01-14 16:40:30 -08:00
Cary R
074f7a7a49
Fix undefined access in for loop synthesis
2015-01-14 15:11:36 -08:00
Stephen Williams
f642313e1b
Merge pull request #50 from orsonmmz/darray
...
Unpacked arrays extension
2015-01-12 14:08:22 -08:00
Stephen Williams
dd9d96eb07
Merge branch 'master' of github.com:steveicarus/iverilog
2015-01-12 09:24:07 -08:00
Maciej Suminski
35401f0e2c
ivl: Functions may return dynamic arrays.
2015-01-12 11:08:31 +01:00
Maciej Suminski
b6e16aea6b
ivl: Typedefs may use unpacked arrays.
2015-01-12 11:08:31 +01:00
Maciej Suminski
eeaf23041b
vvp: Support for dynamic arrays of logic type.
2015-01-12 11:08:31 +01:00
Maciej Suminski
e8096eda80
ivl: Support for unpacked arrays of structures.
2015-01-12 11:08:31 +01:00
Maciej Suminski
961d6a8f3b
vpi: $left and $right functions for arrays and strings.
2015-01-12 11:08:31 +01:00
Maciej Suminski
288ebf011c
vpi: Moved $ivl_darray_method$[from/to]_vec to sys_darray.c
2015-01-12 11:08:31 +01:00
Maciej Suminski
0ae304b6a8
vpi: Added $ivl_darray_method$from_vec.
...
Converts a vector to dynamic array of vectors.
2015-01-12 11:08:31 +01:00
Maciej Suminski
5e61bb64b7
vpi: Added $ivl_darray_method$to_vec.
...
Converts a dynamic array of vectors to a single vector.
2015-01-12 11:08:31 +01:00
Cary R
3f847fd927
Fix a compile warning
2015-01-10 16:28:55 -08:00
Cary R
4a41a53b42
For valgrind clean up the class definitions at the end.
2015-01-10 16:18:59 -08:00
Martin Whitaker
a1630e1d30
Fix for br968.
...
__vpiVThrVec4Stack::vpi_get_value_int_ was always treating the thread variable
as unsigned, rather than observing the value of __vpiVThrVec4Stack::signed_flag_.
Not sure why this was done - none of the regression tests broke when I changed
this.
2015-01-10 17:24:50 +00:00
Martin Whitaker
bca84d9dbb
Added parser support for SV modport declarations.
2015-01-10 11:10:41 +00:00
Cary R
e61ed48914
Clean up vals_words when a dynamic array is accessed using the vpi
2015-01-09 17:38:39 -08:00
Cary R
d29a6d134f
Fix valgrind cleanup of dynamic and queue arrays
2015-01-09 15:05:48 -08:00
Cary R
6310b47538
Fix a memory leak when searching for an element by name
2015-01-08 16:14:20 -08:00
Cary R
9c75a4b96b
Fix a memory leak when the dump file cannot be opened
2015-01-08 16:14:08 -08:00
Cary R
c57e68292c
Fix undefined value problem in compiler (found with valgrind)
2015-01-08 10:05:32 -08:00
Stephen Williams
0fecdcbeda
Icarus Verilog snapshot 2015-01-05
2015-01-05 10:34:18 -08:00
Cary R
23ad62f317
Update cppcheck results
2014-12-28 09:27:14 -08:00
Cary R
ac20008606
Update lz4 files from GTKWave
2014-12-28 09:25:54 -08:00
Stephen Williams
96d181efed
Support vpiStrengthVal for vec4 stack objects.
2014-12-23 14:42:45 -08:00
Stephen Williams
18bfe7d497
Merge branch 'master' of github.com:steveicarus/iverilog
2014-12-23 13:52:48 -08:00
Stephen Williams
86562e60ba
Work towards nested packed struct member vectors.
2014-12-23 13:52:38 -08:00
Martin Whitaker
b400532169
Added support for interface declaration and instantiation.
...
modport and extern tf declarations are not yet supported.
2014-12-19 23:10:14 +00:00
Stephen Williams
6fd10dedb6
Add some implicit support for std and textio libraries
...
Patch submitted by Fabrizio Ferrandi.
2014-12-18 08:20:19 -08:00
Cary R
c8255952a3
Update cppcheck supprression file
2014-12-16 16:47:00 -08:00
Martin Whitaker
71c4ea36e8
Pass -v compiler option to vvp in the output file shebang line.
...
Slightly modified version of the patch contributed by Stephan
Böttcheron iverilog-devel.
2014-12-16 21:22:19 +00:00
Martin Whitaker
5df179cd5f
Implement feature request #47 .
...
This causes vvp to evaluate all the input expressions for a user
function call before assigning any of them to the function input
variables. This stops the input variables being overwritten if
the same (non-automatic) function is used in one of the input
expressions.
2014-12-14 21:46:28 +00:00
Martin Whitaker
ce5c4ca8ba
Fix for br967 - allow real value for repeat statement loop length.
2014-12-13 19:50:33 +00:00
Martin Whitaker
6aa8e49b09
Add sorry message for unsupported arrays of named events.
2014-12-13 17:46:56 +00:00
Martin Whitaker
f29f4ff4e3
Fix for br965.
...
When performing constant propagation, we need to take into account
values driven through a tran object. For now, be pessimistic, and
assume that all tran objects connect to a variable driver.
2014-12-13 12:49:13 +00:00
Cary R
3ccc59eaa3
Fix compile with valgrind hooks after vec4-stack changes
2014-12-12 14:28:07 -08:00
Martin Whitaker
0282b8450c
Fix potential memory leak when a thread is disabled.
...
A disable statement can terminate a thread whilst it still has
local variables on the stack (e.g. the loop counter for a repeat
statement). We need to clear the thread stacks when this happens.
2014-12-11 20:10:17 +00:00
Cary R
43841af2f3
Fix a cppcheck warning and fix code style a bit
2014-12-11 09:59:15 -08:00
Cary R
b2d8d41e3f
Fix some cppcheck warnings in tgt-vvp
2014-12-10 16:30:55 -08:00
Cary R
0e38843ae9
Make verinum output match for either 32-bit or 64-bit systems
2014-12-10 15:11:45 -08:00
Cary R
96472e5537
For a signed R-value we can use the full width when converting to long
...
When trying to get the value we can use the full width of a long if the
expression is signed.
2014-12-10 14:41:27 -08:00
Cary R
48b0fed29e
Use uint64_t casting of constants since UL does not work on 32-bit machines
...
Using a UL constant in a unit64_t context does not work on a 32-bit
machine since UL is 32-bits. Instead create uint64_t constants using
static casts and the appropriate bit operators.
2014-12-10 14:41:18 -08:00
Cary R
1efa220773
Fix non-blocking assignment to an array error state handling
...
If either the index or part offset expressions generate an undefined
value then the assignment is skipped. This patch reworks the code that
handles the flags used to detect this. For some simple cases a global
flag is not needed, but for other cases one is needed since there are
two expressions that can generate an error and even when there is only
a variable expression this error state needs to be preserved if there
is a variable delay. An undefined delay value defaults to zero and is
not an error.
2014-12-09 17:29:18 -08:00
Cary R
2d6622e543
vlog95: for a 32-bit width we can generate a signed undefined value
2014-12-08 21:09:36 -08:00
Cary R
edf112b900
Update all the vvp examples to work correctly
2014-12-08 20:55:19 -08:00
Cary R
f0a0ab100f
vlog95: trim binary constants to save space and emit size of undef. consts.
...
This should not change the functionality, but to save space trim any
unneeded bits from a binary constant. Also for the case of emitting
a signed undefined value when the allow signed flag is not set add
the width to the constant.
2014-12-08 13:08:30 -08:00
Cary R
c28188618b
File example vvp code so make check passes.
2014-12-08 10:43:46 -08:00
Martin Whitaker
0d7daf5862
Fix vvp memory leak for user function calls in a continuous assignment.
2014-12-07 13:47:50 +00:00
Martin Whitaker
60ab1daa1f
Restore some master branch fixes lost in the vec4-stack merge.
2014-12-07 12:10:15 +00:00
Stephen Williams
105521b547
Merge branch 'master' into vec4-stack
2014-12-06 08:24:46 -08:00
Cary R
fd3086f0a9
Fix compile warnings on RHEL5
2014-12-05 19:03:07 -08:00
Cary R
77ebfcacb9
Correctly pass if a darray element is signed or unsigned.
2014-12-05 18:23:02 -08:00
Cary R
d62a307c34
Fix 32-bit issue in vector4_to_value()
2014-12-05 18:00:08 -08:00
Stephen Williams
011519cb5b
Merge branch 'master' into vec4-stack
2014-12-05 13:55:51 -08:00
Stephen Williams
8a0b9acadc
Snapshot 2014-12-05
2014-12-05 12:36:34 -08:00
Stephen Williams
77d1671d8f
Merge branch 'master' into vec4-stack
2014-12-05 10:44:49 -08:00
Stephen Williams
561564065d
deal with mixed nested index directions.
2014-12-05 10:43:39 -08:00
Stephen Williams
409f8c5823
Add the vec4 %subi instruction
2014-12-05 09:45:29 -08:00
Stephen Williams
03198356a5
vec4-stack stack manipulation improvements.
2014-12-04 17:15:27 -08:00
Stephen Williams
b1d2393789
Optimize the %sub instruction by integrating it with vvp_vector4_t class
2014-12-04 17:01:16 -08:00
Stephen Williams
0f740289e9
Optimize %mul instructions by integrating with vvp_vector4_t class.
2014-12-04 16:00:57 -08:00
Stephen Williams
46ce236cfb
Optimize the %add and %addi instructions
...
Tightly integrate with the vvp_vector4_t class to get much
better add performance.
2014-12-04 12:38:08 -08:00
Stephen Williams
86139c855d
Optimize the vec4-stack %cmp/s and %cmpi/s instructions.
...
Magnitude compare is called a LOT, so it is worth putting some
special effort into it.
2014-12-04 10:42:48 -08:00
Stephen Williams
eb070b061b
Optimize the vec4_to_index, which implements %ix/vec4 instructions.
2014-12-03 17:53:45 -08:00
Stephen Williams
2b1393e7b9
Reduce some vector copies in %load/vec4 and %concat/vec4 instructions.
...
By clever stack manipulations, we can eliminate some vector copies,
which can improve performance.
2014-12-03 13:12:06 -08:00
Stephen Williams
85c7b07a9b
Implement %cmp/ne and %cmpi/ne
...
These pull in the inversion of the output flags so that they more
efficiently implement != and !==, without %flag_inv instructions.
2014-12-03 11:06:11 -08:00
Stephen Williams
0c5ed2b60f
Merge branch 'master' into vec4-stack
2014-12-03 08:36:38 -08:00
Stephen Williams
8fd1ead082
Revert "ivl: Allow to initialize variables with other variables (since Verilog-2001)."
...
This reverts commit 610ca95cbe .
It turns out that the new feature is actually a bug.
2014-12-03 08:27:01 -08:00
Stephen Williams
3bd307db85
Expression cast handles size if need be.
2014-12-02 16:54:32 -08:00
Stephen Williams
35db02d35d
elaborate dump cast operators.
2014-12-02 16:50:42 -08:00
Stephen Williams
f287546f49
Fix a %vpi_call call syntax.
2014-12-02 15:28:22 -08:00
Stephen Williams
1645e682f4
Generate more efficient vec4-stack code for real le compare.
2014-12-02 14:53:01 -08:00
Stephen Williams
a57e0a1e3f
vvp implementation of copy from vec4 to vec2 can use subarray method.
2014-12-02 14:52:37 -08:00
Stephen Williams
b83144c552
The __vpiArray::set_word method should take a reference.
...
Seem to have missed a case where a vvp_vector4_t can be passed by
const reference instead of by value.
2014-12-02 13:02:46 -08:00
Stephen Williams
58fb80aec4
Implement and put to use the %muli instruction.
2014-12-02 12:46:17 -08:00
Stephen Williams
38f277d81b
Merge branch 'master' into vec4-stack
...
Conflicts:
vvp/array.cc
vvp/vthread.cc
2014-12-02 11:21:58 -08:00
Stephen Williams
f3ba335493
Merge pull request #49 from orsonmmz/darray_vpi
...
Support for dynamic arrays in the VPI
2014-12-01 17:12:57 -08:00
Stephen Williams
fb5ae48b18
Merge branch 'master' into vec4-stack
2014-12-01 17:00:35 -08:00
Cary R
68258f244e
Update cppcheck suppression file for latest lz4.c file
2014-11-29 07:36:51 -08:00
Cary R
ee34ccec70
Update lz4 files from GTKWave
2014-11-29 07:36:44 -08:00
Maciej Suminski
1834d470cb
vvp: Refactored __vpiArrayVthrA & __vpiArrayVthrAPV.
2014-11-28 14:14:42 +01:00
Maciej Suminski
9bc463aac0
vvp: Moved array_word_change(), array_attach_word(), array_alias_word() to __vpiArray.
2014-11-28 14:14:42 +01:00
Maciej Suminski
7c77097f71
vvp: array_[set/get]_word changed to __vpiArray::[set/get]_word.
2014-11-28 14:14:42 +01:00
Maciej Suminski
cc4c5f4998
vvp: Changed get_array_word_size(vvp_array_t) to __vpiArray::get_word_size().
2014-11-28 14:14:42 +01:00
Maciej Suminski
230c435ae7
vvp: Added missing functions for __vpiDarray.
2014-11-28 14:14:42 +01:00
Maciej Suminski
4ddef32631
vvp: __vpiArray::get_word_value handles StrVal variants.
2014-11-28 14:14:42 +01:00
Maciej Suminski
a236c274f3
vvp: Minor changes.
2014-11-28 14:14:42 +01:00
Maciej Suminski
21a8cb71ee
vvp: Handles for dynamic array ranges.
2014-11-28 14:14:42 +01:00
Maciej Suminski
b4ccaa1b0c
vvp: Fixed iterators for dynamic arrays.
2014-11-28 14:14:42 +01:00
Maciej Suminski
a8d43fa743
vvp: Stop simulation in case of errors in $ivl_string_method$to_vec.
2014-11-28 14:14:42 +01:00
Maciej Suminski
ca2ef5c956
vvp: Cleaning.
2014-11-28 14:14:39 +01:00
Maciej Suminski
6015aceda2
vvp: vpiArrayIterator::vpi_index core moved to vpiArrayBase::get_iter_index.
2014-11-28 14:14:37 +01:00
Maciej Suminski
9538501b54
vvp: Moved __vpiArrayBase::vpi_iterate to __vpiArayBase::vpi_array_base_iterate.
2014-11-28 14:12:49 +01:00
Maciej Suminski
ea7fa24f9e
vvp: Further extraction of common code pieces from ArrayBase.
2014-11-28 14:12:46 +01:00
Maciej Suminski
48d3701c02
vvp: get_word_index() & get_word_parent() moved to __vpiArrayWord.
2014-11-28 14:12:43 +01:00
Maciej Suminski
c1164dcc33
vvp: Initial work on support for dynamic arrays in VPI.
...
Added array_common.[ch] to store shared code.
2014-11-28 14:12:37 +01:00
Maciej Suminski
1166cd932a
vpi: Handle new formats in vpi_get_value() for unpacked arrays.
...
It is possible to use vpiIntVal, vpiVectorVal, vpiRealVal,
vpiStringVal and vpiObjTypeVal to retrieve data from unpacked
array cells.
2014-11-27 17:36:23 +01:00
Maciej Suminski
c3a318f14e
ivl: Casting vectors to strings.
2014-11-27 17:36:23 +01:00
Maciej Suminski
b2deae7ba9
ivl: More meaningful errors messages. Minor code formatting.
2014-11-27 17:36:23 +01:00
Maciej Suminski
675dd91403
ivl: Added sign checking & casting between integers of different size.
2014-11-27 17:36:23 +01:00
Maciej Suminski
b12e00d875
ivl: String to vector casting.
2014-11-27 17:36:23 +01:00
Maciej Suminski
103828577b
ivl: Fixed indentations.
2014-11-27 17:36:23 +01:00
Maciej Suminski
21c8b8ca5a
vpi: Added $ivl_string_method$to_vec for strings to vectors conversion.
2014-11-27 17:36:23 +01:00
Maciej Suminski
25c588252f
ivl: Added vpiSysFuncVoid to the system function types.
2014-11-27 17:36:23 +01:00
Maciej Suminski
89d1125979
ivl: Bit selection using variables in strings.
2014-11-27 17:36:23 +01:00
Maciej Suminski
43c6a0bacd
ivl: Casting to int.
2014-11-27 17:36:23 +01:00
Maciej Suminski
610ca95cbe
ivl: Allow to initialize variables with other variables (since Verilog-2001).
2014-11-27 17:36:23 +01:00
Maciej Suminski
daa59a95ad
ivl: Parsing rules for type casting.
2014-11-27 17:36:23 +01:00
Maciej Suminski
13f861a963
ivl: Added PECastType to handle type casting.
2014-11-27 17:36:23 +01:00
Stephen Williams
82ca4cf641
Add a warning if an expression pads itself to a crazy width.
2014-11-25 14:49:04 -08:00
Cary R
ac2e8dd6cd
Report that packed arrays can not currently be elaborated in all cases
2014-11-24 19:11:08 -08:00
Cary R
cd992b4d5a
Add file/line information for parray data type.
2014-11-24 18:37:40 -08:00
Stephen Williams
679021a1b5
Optimize special cases of immediate value extraction.
2014-11-22 10:38:16 -08:00
Stephen Williams
f3392561ed
Optimize the vvp pad implementation.
2014-11-22 09:59:02 -08:00
Stephen Williams
7a9a022744
Remove some dead code.
2014-11-21 17:36:22 -08:00
Stephen Williams
c222b3b6a4
Minor improvements to the %split/vec4 instruction.
2014-11-21 16:51:59 -08:00
Stephen Williams
663c79d4af
Add the %cmp/e instructions, and put them to use.
...
When testing for == and ===, there is no need to also calculate <,
so it makes sense to have a special instruction for these cases.
2014-11-21 16:45:27 -08:00
Stephen Williams
bea03db25d
Minor vec4 stack manipulation optimizations.
2014-11-21 14:41:31 -08:00
Stephen Williams
b96f04ccce
Implement the %parti/X instructions
...
This allows part select with constant base to be handled optimally.
Also update some more instructions to more optimally work with
the vec4 stack.
2014-11-20 18:43:24 -08:00
Stephen Williams
a9db765f98
Generate better code for condition expressions.
2014-11-20 14:47:44 -08:00
Stephen Williams
c71ab5869a
vvp code generator try to generate condition flags directly.
...
When generating code for a condition expression, i.e. directly
before a %jmp/X statement, try to generate the result into the
flag bit without passing through the vec4 stack. For example, the
%cmpX/X instructions generate results into the flag bits, so it
makes no sense to push these bits into the vec4 stack then pop
them back into the flag bit. So try to handle this case.
2014-11-19 18:32:19 -08:00
Stephen Williams
04bdfbccee
Add %cmpi/s and %cmpi/u instructions for performance
...
These bypass the vec4 stack in some common cases, saving instructions
and vec4 manipulations.
Also, minor improvement to the %flag/set/vec4 statement.
Kill a few warnings.
2014-11-19 16:38:43 -08:00
Stephen Williams
2acc9fbdee
Remove dead instructsion %set/qb and %set/qf / Kill some warnings.
2014-11-19 09:15:01 -08:00
Stephen Williams
725ed869ba
Remove dead %load/vp0 instructions and related infrastructure
...
Also remove some &A<> and &PV<> symbols that use this now dead
infrastructure.
2014-11-19 09:02:21 -08:00
Stephen Williams
301edf69d3
Add and use %concati/vec4 and %addi instructions.
...
Also, clean up some warnings, and optimize some existing opcodes.
2014-11-18 12:27:55 -08:00
Stephen Williams
1612c6d638
Instruction %concat/vec4, %pad/u and %shiftl manipulate stack in place
2014-11-17 16:32:18 -08:00
Stephen Williams
aadd67cd3b
Some instructions can do stack manipultations in place.
...
By doing some stack manipulations in place, certain instructions
can eliminate, or optimize, vector copies.
2014-11-14 18:38:15 -08:00
Stephen Williams
c2ca9c3b73
Optimize draw_number_vec4 to use %pushi/vec4 zero-padding.
2014-11-14 18:37:10 -08:00
Stephen Williams
0601b4e43b
Optimizations for %pushi/vec4 and %load/vec4
...
- Have %pushi/vec4 handle some special cases optimally.
- Eliminate some duplicated method calls in %load/vec4.
- Optimize the vvp_vector4_t::copy_from_ method by inlining
some parts.
2014-11-14 14:41:04 -08:00
Stephen Williams
8aca66b109
Performance tweaks
...
Better performance for %cmp/s and the vvp_fun_part_sa node.
2014-11-14 11:48:36 -08:00
Stephen Williams
2aeb3871ed
Merge branch 'master' into vec4-stack
...
This was a challenging merge...
Conflicts:
elab_scope.cc
synth2.cc
tgt-vvp/eval_expr.c
vvp/vthread.cc
2014-11-13 16:26:15 -08:00
Stephen Williams
ea21fb856e
Mux with default, handle possible large selector.
2014-11-09 16:49:21 -08:00
Martin Whitaker
754899c99e
Make asynchronous case statement synthesis more robust.
...
Added various error/warning messages for behaviour not supported
in synthesis. Also give correct behaviour when multiple case item
expressions evaluate to the same constant value.
2014-11-09 20:20:03 +00:00
Cary R
4e94b81a4b
On a 32 bit system you can print a 32 bit value as a long (verinum)
2014-11-05 14:43:58 -08:00
Cary R
6948c27c2d
Enumerations are compatible if their type definitions match.
2014-11-04 15:05:49 -08:00
Cary R
2e9c4cde55
More refined check for enumeration width and constant width
2014-11-04 12:10:38 -08:00
Cary R
2e8c4e3dbc
Basic patch from github #44
2014-11-04 11:39:01 -08:00
Cary R
cc9fcfd13d
Only a literal constant size has to match the enumeration width.
2014-11-03 19:46:10 -08:00
Cary R
4660e0bf2f
Another tweak to the enumeration elaboration code
2014-11-02 20:26:36 -08:00
Cary R
1e7509a021
Update enumeration elaboration checks
2014-11-02 11:45:19 -08:00
Martin Whitaker
c2e53f0d63
Fix for br963 - vvp qpop instructions need to call thr_check_addr.
2014-11-02 15:36:52 +00:00
Martin Whitaker
f171161822
Fix for br962 - pop from dynamic array is not padded to correct width.
...
When the expression width is greater than the dynamic array width,
we need to generate code to pad the popped value to the correct
width.
2014-11-02 15:26:15 +00:00
Martin Whitaker
0237297e93
Added pruning of case statement expressions.
...
When unsized literals are used in case item expressions, it is likely
that the calculated expression width will be larger than necessary to
unambiguously select the correct case item (particularly when using
"strict" expression elaboration). This patch adds an optimisation
step that prunes the expressions to the minimum necessary width.
2014-11-02 13:02:57 +00:00
Martin Whitaker
e38b5d9fb7
Eliminate unnecessary rerun of test_width in case statement elaboration.
...
Also fix a typo in a comment.
2014-11-02 13:02:57 +00:00
Stephen Williams
d5123011b3
Merge branch 'master' into vec4-stack
...
Conflicts:
elab_scope.cc
2014-11-01 14:57:05 -07:00
Cary R
9a471bd81c
Don't crash if there are problems elaborating an enumeration.
2014-10-31 20:08:05 -07:00
Cary R
632e15a55c
Catch enumerations with the same name.
2014-10-31 20:06:28 -07:00
Cary R
d4313dad75
Merge branch 'master' of github.com:steveicarus/iverilog
2014-10-31 18:09:29 -07:00
Cary R
c25538d750
Pass the integer type for enumerations to the IVL target stage
2014-10-31 18:09:19 -07:00
Martin Whitaker
871d447ff7
Reinstate error recovery for range expressions.
...
If an error is found whilst elaborating a range expression in a signal
declaration, create a dummy range and continue elaboration. This stops
the compiler reporting an error every time that signal is referenced.
2014-10-31 21:42:23 +00:00
Martin Whitaker
b286b76134
Fix null pointer dereference in pform debug output.
2014-10-31 18:40:51 +00:00
Cary R
4f62a0d1f2
Check enum trimmed bits for values with undefined bits
...
If an enumeration constant has undefined bits then we need to verify that
the bits that are trimmed match the MSB of the remaining bits.
2014-10-30 19:54:38 -07:00
Cary R
e7df9774aa
When comparing that an enumeration is in range cast the value to 2-state
...
When checking that an enumeration value is in range we need to cast it to
a 2-state value so that when we compare it we get a true or false value
instead of an undefined value. Undefined bits in the comparison return
undefined which is not logically false.
2014-10-30 18:23:47 -07:00
Cary R
08afbde08d
Update cppcheck suppression file for tgt-vlog.
2014-10-30 18:23:39 -07:00
Martin Whitaker
7ab0824adf
Fix for br961 - function return type elaborated in wrong scope.
...
The return type of a function should be elaborated in the context of
the enclosing scope, not in the context of the function itself.
2014-10-30 21:09:17 +00:00
Martin Whitaker
7fad4779c5
Add error recovery when elaboration of a type range fails.
...
If elaboration of the msb or lsb expression in the range of a vector
type specification failed (due to an error in the Verilog code being
compiled), an assertion failure was being triggered when the compiler
attempted to evaluate the expressions. Bypassing the evaluation (and
using a default value) should allow us to recover from the error.
2014-10-30 20:42:12 +00:00
Stephen Williams
8ac06fb63f
Support vpiObjTypeVal for vec4Stack values.
...
Also allow vpi_get_value outside of scope. (Return 'x)
2014-10-25 20:38:39 -07:00
Stephen Williams
4e727adc25
Merge branch 'master' into vec4-stack
2014-10-25 09:49:39 -07:00
Stephen Williams
3e9c14060f
lexor handles arbitrary length defines in the precompiled_defiles file.
2014-10-25 09:48:11 -07:00
Stephen Williams
702a8c3a05
Merge branch 'master' into vec4-stack
2014-10-24 15:17:31 -07:00
Stephen Williams
48d3972299
Remove a bunch of dead vvp opcodes.
2014-10-24 15:13:28 -07:00
Stephen Williams
62fce50f8c
Remove dead code for allocate_vec handling.
2014-10-24 13:07:53 -07:00
Stephen Williams
e4b862f3d1
Clean up vector handling dead code.
2014-10-24 11:17:36 -07:00
Stephen Williams
09d3a5de59
Port %pushv/str to vec4-stack style.
2014-10-24 10:16:35 -07:00
Stephen Williams
97bde47c31
Remove dead %set/dar and %set/dar/obj instructions.
2014-10-24 10:03:22 -07:00
Stephen Williams
1c80c6e37a
Remove dead stuff_ok_flags from draw_eval_vec4 functions.
2014-10-24 09:32:32 -07:00
Stephen Williams
4588f7c615
vec4 stack versions of queue pop methods.
2014-10-24 09:03:20 -07:00
Cary R
006aef93d0
Fix a reference to an undefined element.
2014-10-23 16:56:13 -07:00
Stephen Williams
24b8752475
More cases where %store/prop/v takes a width.
2014-10-22 16:15:10 -07:00
Stephen Williams
3ddcf03764
Kill some eval_vec4.c warnings.
2014-10-22 13:01:25 -07:00
Stephen Williams
35f5d51028
Support testing nul for property that is an object.
2014-10-22 12:58:50 -07:00
Stephen Williams
87c019c65c
Merge branch 'master' into vec4-stack
2014-10-21 12:19:40 -07:00
Stephen Williams
69a1fecd2e
Handle arrays of object is comparison with null.
2014-10-21 11:47:22 -07:00
Stephen Williams
9964d67e5e
Implicit crop of vectors assigned to vector properties.
...
The %store/prop/v takes a width so that it is guaranteed that
all assignments to a vector property will get the size right.
2014-10-21 11:46:59 -07:00
Stephen Williams
a98f21aa65
Merge branch 'master' into vec4-stack
...
Conflicts:
elab_lval.cc
netmisc.cc
tgt-vvp/eval_object.c
tgt-vvp/vvp_process.c
vvp/codes.h
vvp/compile.cc
vvp/opcodes.txt
vvp/vpi_tasks.cc
vvp/vpi_vthr_vector.cc
vvp/vthread.cc
2014-10-21 09:12:02 -07:00
Cary R
a63ca15735
Add support for putting a single delay from the VPI
2014-10-18 18:27:39 -07:00
Stephen Williams
d139142c29
Merge pull request #47 from orsonmmz/concat
...
Expression concatenation in VHDL
2014-10-18 15:13:50 -07:00
Cary R
af85d44d9f
Add support for putting three and six delays from the VPI
2014-10-17 20:06:01 -07:00
Cary R
c5e0507941
Fix the modpath edge and vpi_put_delay() code
...
The code to get the correct modpath delay for a given edge had the X and Z
entries swapped.
When putting a delay from the VPI the 2 delay to twelve delay mapping was
incorrect and the to/from X delays were also not being calculated correctly.
2014-10-17 19:42:55 -07:00
Maciej Suminski
c55a013162
vhdlpp: Support for integer() function.
...
Note: I could not find any info about the integer() function, but it is
used in the VHDL standard packages (e.g. math_real, see:
http://www.csee.umbc.edu/portal/help/VHDL/packages/mathpack.vhd )
Real numbers are rounded, this is compatible with ModelSim behavior.
2014-10-17 14:53:59 +02:00
Maciej Suminski
dfbca0b186
vhdlpp: Emit use_types in Architecture.
2014-10-17 14:13:06 +02:00
Maciej Suminski
4a779f43bd
vhdlpp: Fix error message for 'right attribute.
2014-10-17 14:13:06 +02:00
Maciej Suminski
97df6183a9
vhdlpp: Emit '-' std_logic value as 'x'.
...
Note: It is not a direct ("don't care" vs "unknown"), but I could not
find anything that suits better.
2014-10-17 14:13:06 +02:00
Maciej Suminski
95faed8e9d
vhdlpp: Added basic support for concatenated expressions.
2014-10-15 10:51:21 +02:00
Maciej Suminski
76aab15798
vhdlpp: Minor code cleaning.
2014-10-15 10:51:21 +02:00
Cary R
e896f0c8e6
Remove some compile warnings in the vhdlpp code
2014-10-14 09:03:42 -07:00
Cary R
f36bebf0e1
Remove some compile warnings.
2014-10-13 16:31:53 -07:00
Cary R
3fd622e4eb
vlog95: Add support for emitting global tasks and functions
2014-10-13 09:51:55 -07:00
Cary R
da4200c5bd
Update lz4 files to the latest from GTKWave
2014-10-13 09:44:57 -07:00
Stephen Williams
712f394224
Elaborate classes in packages.
2014-10-10 18:53:53 -07:00
Stephen Williams
d6685f40a1
Merge pull request #46 from orsonmmz/range
...
VHDL attributes: 'range, 'reverse_range, 'left & 'right
2014-10-10 17:23:59 -07:00
Maciej Suminski
9ff9cbf4aa
vhdlpp: Smarter determining the direction in for loops.
2014-10-10 18:39:14 +02:00
Maciej Suminski
a992f3ce7c
vhdlpp: Evaluation for 'left and 'right attributes.
2014-10-10 18:35:17 +02:00
Maciej Suminski
1a4edcac48
vvp: Accepts continuous assignment for 2-state nets.
2014-10-10 16:16:46 +02:00
Maciej Suminski
8cac72192f
vhdlpp: Fix array typedefs in packages.
2014-10-09 10:37:33 +02:00
Maciej Suminski
7f6100be2a
vhdlpp: Emit VHDL 'integer' as SystemVerilog 'int'.
2014-10-09 10:29:14 +02:00
Maciej Suminski
4b60d2737e
vhdlpp: Skip signed & unsigned in types dump in packages.
2014-10-09 10:28:35 +02:00
Maciej Suminski
c7beef907d
vhdlpp: Support for 'range and 'reverse_range attributes.
2014-10-08 11:18:06 +02:00
Maciej Suminski
44da7de651
vhdlpp: prange_t may have the direction determined automatically.
2014-10-08 10:26:37 +02:00
Maciej Suminski
6887c82540
vhdlpp: Added ExpAttribute::write_to_stream().
2014-10-08 10:21:03 +02:00
Maciej Suminski
1333bc54a2
vhdlpp: Support for 'left & 'right attributes.
2014-10-08 10:05:04 +02:00
Maciej Suminski
fddb3ec129
vhdlpp: ForLoopStatement emits range boundaries expressions instead of evaluating them.
...
Unfortunately without evaluation it is not possible to warn against
degenerated loops, so it had to be removed.
2014-10-07 14:25:00 +02:00
Stephen Williams
bfafd175fa
Fix parse.y bad handling of file names in some situations.
...
The YYLLOC_DEFAULT() macro needs to get the .text value even
when the rules are empty.
2014-10-02 19:42:48 -07:00
Stephen Williams
23238aa7ac
Handle functions in $root scope.
2014-10-02 15:04:14 -07:00
Stephen Williams
2397aa1587
Merge pull request #45 from orsonmmz/subprogram
...
Subprograms
2014-10-02 14:14:52 -07:00
Stephen Williams
b4119de9b1
Merge branch 'master' of github.com:steveicarus/iverilog
2014-10-02 14:10:10 -07:00
Stephen Williams
338a0eb11a
Get $root scope tasks/fuctions down to the ivl_target API.
2014-10-02 14:09:27 -07:00
Maciej Suminski
fde6525acb
vhdlpp: Libraries are searched for subprograms during the ExpFunc elaboration.
2014-10-01 14:56:32 +02:00
Stephen Williams
c5fee8bdb9
Elaborate root tasks/functions.
2014-09-30 16:06:32 -07:00
Maciej Suminski
194a950f8d
vhdlpp: Elaboration of ExpFunc parameters fallbacks to the types given in the Subprogram header.
2014-09-30 15:59:46 +02:00
Maciej Suminski
9951521212
vhdlpp: Subprogram parameters are taken into account when distinguishing between function calls and vector elements.
2014-09-30 15:59:46 +02:00
Maciej Suminski
9e856810b9
vhdlpp: Workaround to avoid translation of variables to wires in functions.
2014-09-30 15:59:45 +02:00
Maciej Suminski
675b7d8efa
vhdlpp: Support for std_logic_vector return type in functions.
...
VHDL does not allow to specify the size of returned std_logic_vector,
whereas Verilog requires the size to be known in advance. The size of
the vector is determined by checking the type of expression used in the
return statement.
2014-09-30 15:58:26 +02:00
Maciej Suminski
e352bea476
vhdlpp: Support for variable declarations in subprograms.
...
Fixes sorrymsg: "variable_declaration not supported."
2014-09-30 15:58:13 +02:00
Maciej Suminski
747e656a0e
vhdlpp: Added ScopeBase::transfer_from() method.
2014-09-30 15:00:55 +02:00
Maciej Suminski
7b5470c8a7
vhdlpp: Subprogram class inherits from ScopeBase.
2014-09-30 15:00:55 +02:00
Cary R
985a3eb206
Update lz4 files to the latest from GTKWave
2014-09-26 15:04:55 -07:00
Stephen Williams
e1ec27e18c
Merge pull request #43 from orsonmmz/record_elab
...
Elaboration & emit functions for aggregate expressions used as record initializers.
2014-09-18 12:59:28 -07:00
Stephen Williams
d13e488f4c
Merge pull request #42 from orsonmmz/const_package
...
Enable constant initializers that require elaboration in packages.
2014-09-18 12:58:19 -07:00
Maciej Suminski
f5dd2ac87e
vhdlpp: Aggregate expressions for records can be specified in any order.
2014-09-17 16:32:56 +02:00
Maciej Suminski
94abef195a
vhdlpp: Commented out named assignment for records.
2014-09-17 16:30:44 +02:00
Maciej Suminski
54696e0127
vhdlpp: Elaboration & emit support for aggregate initializer expressions in records.
2014-09-17 11:24:16 +02:00
Cary R
d85096c56a
Add support for implict this in class methods
2014-09-16 17:08:57 -07:00
Cary R
d16a9dcfc6
Add support for calling a class function method using this/super
...
Also standardize the parser code that uses this/super.
2014-09-16 12:25:14 -07:00
Maciej Suminski
9842035d89
vhdlpp: Simplified the initalization for signals/variables.
2014-09-16 16:31:18 +02:00
Stephen Williams
480668fee6
Add support for classes defined in $root scope.
2014-09-15 17:37:30 -07:00
Stephen Williams
fa21527e9f
Classes in $root scope up to elaboration.
2014-09-15 17:37:30 -07:00
Stephen Williams
98799ff7fa
Allow class properties to be arrayed.
...
This adds the runtime support for class properties that are classes
to be arrayed. Add a means to define the dimensions of a property
in the vvp format, and add functions for setting/extracting elements
of a property.
2014-09-15 17:37:30 -07:00
Stephen Williams
ea4b000be6
Get arrayed property expressions down to the ivl_target API.
2014-09-15 17:37:30 -07:00
Maciej Suminski
e330a0bd6e
vhdlpp: Corrected VTypeArray::write_to_stream().
...
Now it outputs "typedef(range)" instead of "array (range) of type".
2014-09-15 12:10:05 +02:00
Maciej Suminski
cb03802a17
vhdlpp: Added VTypeArray::basic_type() to cope with
...
arrays based on typedefs.
2014-09-15 12:10:05 +02:00
Maciej Suminski
22d18cb28d
vhdlpp: Typedefs in packages are emitted before constants.
2014-09-15 12:10:04 +02:00
Maciej Suminski
c98c3e5d14
vhdlpp: Inlined a few functions.
2014-09-15 12:10:04 +02:00
Maciej Suminski
a63289c2fc
vhdlpp: VTypeArray::range_t handles direction (to/downto).
2014-09-15 12:10:04 +02:00
Maciej Suminski
251b75003f
vhdlpp: Skip writing '=>' for ExpAggregates if there are no fields specified.
2014-09-15 12:10:04 +02:00
Maciej Suminski
01b4d49d4a
vhdlpp: Do not emit constants from packages.
...
They are elaborated and emitted by architectures that make use of packages.
2014-09-15 12:10:04 +02:00
Maciej Suminski
f851fc6981
vhdlpp: Fixed ExpAggregate::write_to_stream().
2014-09-15 12:10:04 +02:00
Maciej Suminski
a25cde3bc7
vhdlpp: Added ExpString::write_to_stream().
2014-09-15 12:10:04 +02:00
Maciej Suminski
51b121ae7a
vhdlpp: Added ExpBitString::write_to_stream().
2014-09-15 12:10:04 +02:00
Maciej Suminski
94caa4881e
vhdlpp: Added VTypeEnum::write_to_stream().
2014-09-15 12:10:04 +02:00
Maciej Suminski
ef7ac5ed03
vhdlpp: Elaborate all types of initializing expressions.
2014-09-15 12:10:04 +02:00
Cary R
acce9fc2a0
Report that external class methods/constructors are not supported
2014-09-11 16:35:24 -07:00
Cary R
1cfbd2db63
Fix some cppcheck warnings.
2014-09-10 18:54:01 -07:00
Stephen Williams
853512868b
Merge branch 'x-mil15'
2014-09-08 21:10:14 -07:00
Cary R
9b1de4b038
Call IEEE 1800 SystemVerilog
2014-09-08 20:49:40 -07:00
Cary R
ec2793c9b0
Warn that classes defined in the compilation unit scope are not supported
2014-09-08 16:59:18 -07:00
Stephen Williams
697701a26e
Sorry messages for property arrays.
2014-09-07 17:48:19 -07:00
Stephen Williams
facc982af4
Ability to compare arbitrary class-valued expression to nil.
2014-09-07 16:22:49 -07:00
Stephen Williams
8bb1d3dabe
Emit class definitions after ALL scopes are scanned.
2014-09-06 17:39:52 -07:00
Stephen Williams
88e951418b
Handle elaboration of class properties referenced within sub-scopes.
2014-09-06 16:26:08 -07:00
Cary R
1572dcd3fd
Add a couple missing va_end() calls
2014-09-05 15:40:23 -07:00
Cary R
96d793ed6b
vlog95: switch to C99 real number classification routines
2014-09-05 15:18:13 -07:00
Stephen Williams
15ccd8f4c9
Handle foreach array name as class property.
2014-09-04 20:52:51 -07:00
Stephen Williams
d1a35d5152
Handle nil queue as a was to delete a queue.
...
Treat this like assigning null to a dynamic array. This deletes the
queue and thus has the effect of clearing it.
2014-09-02 12:19:58 -07:00
Stephen Williams
3b0dfaadba
Some support for unpacked arrays in class properties.
2014-09-02 09:23:54 -07:00
Stephen Williams
1465fd1570
Class definitions may reference class types in containing scopes.
...
We need the scope where the class is defined so that it can find
types in that containing scope. Note that most definitions cannot
escape into the the lexical scope of the class, but some can.
2014-09-02 09:22:41 -07:00
Stephen Williams
886b6cd349
Debug messages.
2014-08-30 10:18:57 -07:00
Stephen Williams
0dc28c0fc3
Fix the %qpop/f instruction detection.
2014-08-30 10:18:57 -07:00
Stephen Williams
dec4cd5071
Handle arrays of class objects.
...
This goes all the way down to the vvp level, where we create support
for arrays of objects, generate the new code in the -tvvp code
generator, and elaborate the arrays in the first place.
2014-08-30 10:18:57 -07:00
Stephen Williams
0cd6fbaf41
foreach loops around static arrays
...
Arrays with static dimensions can be handled specially.
This also allows for arbitrary numbers of dimensions.
2014-08-30 10:18:57 -07:00
Stephen Williams
9fa764285a
foreach multiple indices through the pform.
2014-08-30 10:18:57 -07:00
Stephen Williams
fe8e7a6261
Merge pull request #39 from orsonmmz/testenum_fix
...
Fixed enum typedefs.
2014-08-29 21:06:20 -07:00
Cary R
a0ea7e17cf
Packages can contain enum definitions so emit them in the pform.
2014-08-28 17:01:30 -07:00
Cary R
8c3f7d78b9
Partial fix for br956 (various enumeration bugs)
...
This patch fixes the following enumeration bugs:
When looking for an enumeration look in the current scope and then
recursively in any parent scope.
Add enumeration definitions to a package scope.
2014-08-28 13:02:42 -07:00
Maciej Suminski
684c2fe19e
Fixed enum typedefs.
2014-08-28 11:04:25 +02:00
Maciej Suminski
a67f18f8ef
ivl: Do not delete range objects right after setting range for a net.
2014-08-28 10:02:56 +02:00
Cary R
931039761a
Don't try to print the vector size if it is empty (a single bit)
2014-08-27 17:54:46 -07:00
Stephen Williams
3852545f21
Merge pull request #38 from orsonmmz/unbounded_array
...
Support for VHDL unbounded arrays.
2014-08-27 09:15:28 -07:00
Cary R
b4d0c43a96
Remove some compile warnings.
2014-08-25 18:24:58 -07:00
Cary R
c24c26725e
A method call needs to ignore a single NULL argument from the parser
...
The parser always passes a single NULL argument for system tasks. For a
method call which will add a signal to call the method on we need to
ignore this NULL argument.
2014-08-25 18:06:08 -07:00
Cary R
1269c12054
vlog95: Handle a system task with a NULL last argument
2014-08-25 18:06:01 -07:00
Cary R
4fb91ec7c7
vlog95: Add SV queue specific error message and code generation.
2014-08-25 16:41:08 -07:00
Martin Whitaker
e5f49baaac
Fix for GitHub issue #37 - bug in expression width pruning.
...
If an expression contains a division, remainder, or right shift operation,
set the expression min_width to UINT_MAX to flag that the expression width
cannot be pruned. Using UINT_MAX ensures that the min_width won't change
as we continue to elaborate the expression.
2014-08-25 20:27:22 +01:00
Maciej Suminski
0f728b9150
vhdlpp: Minor cleaning, fixed copyright notices.
2014-08-25 17:29:35 +02:00
Maciej Suminski
b0c79d5d1c
vhdlpp: Added VType::emit_name() that skips emission of a name if it is empty (otherwise '\' is outputted).
2014-08-25 17:05:15 +02:00
Maciej Suminski
150fe088a6
vhdlpp: VTypeRecord is marked as acceptable in packed arrays. VTypeDef is accepted depending on the base type.
2014-08-25 16:56:46 +02:00
Maciej Suminski
bb66ed8b9d
vhdlpp: "integer" is emitted as "bool[31:0" but is marked as accepted to be used in packed arrays.
2014-08-25 16:51:35 +02:00
Cary R
447e402d16
Require a space between the synthesis and translate_* key words
2014-08-22 16:55:47 +02:00
Martin Whitaker
86bb269d47
Fix for GitHub issue #33 - Problem with multi-dimensional arrays.
...
normalize_variable_unpacked() was not correctly calculating the
minimum expression width required to calculate the canonical
index.
2014-08-22 16:55:47 +02:00
Stephen Williams
486dc7abeb
Do a better job with synthesis translate pragmas.
2014-08-22 16:55:47 +02:00
Cary R
6765e32ab9
Add message that L-value concatenation is not supported in synthesis
2014-08-22 16:55:47 +02:00
Maciej Suminski
b1d15436fd
Removed ExpReal::evaluate().Its signature does not match the one meant to be overridden.
2014-08-22 16:55:47 +02:00
Maciej Suminski
c846b2cf3f
vhdlpp: 'integer' is emitted as 'integer' instead of 'bool [31:0]'.
2014-08-22 16:45:17 +02:00
Maciej Suminski
10446df80e
vhdlpp: Invert range in ExpAggregate when necessary.
2014-08-22 16:23:22 +02:00
Maciej Suminski
0a2100c87f
vhdlpp: Turn on the reg_flag for types that cannot be packed.
2014-08-22 16:22:59 +02:00
Maciej Suminski
27730395ca
vhdlpp: Type of an array is selected depending on the element type.
2014-08-22 10:49:55 +02:00
Maciej Suminski
8e9c25a23e
vhdlpp: Added 'packed' property for VTypes.
...
It detetermines if a type can be used as the base type of a packed array.
2014-08-22 10:45:02 +02:00
Maciej Suminski
feccae56bf
libmisc: Added empty_perm_string.
2014-08-22 10:42:51 +02:00
Stephen Williams
5de83906f7
Sorry message for multi-dimension foreach loop indices.
2014-08-21 20:34:55 -07:00
Stephen Williams
8b969202c0
Clean up some bugs introduced by recent patches.
2014-08-21 20:21:23 -07:00
Stephen Williams
ea5789e4d9
Implement $low() for certain types.
2014-08-21 16:44:46 -07:00
Stephen Williams
f602ae84ab
Elaborate foreach loops as synthetic for loops.
...
Create an implicit scope to hold the index variable, and
generate a for loop to perform the functionality of the
foreach.
2014-08-21 16:44:46 -07:00
Stephen Williams
335db49282
Add vvp implementations for pop_back and pop_front methods.
2014-08-21 16:44:46 -07:00
Stephen Williams
8c2d51142b
Elaborate pop_back/pop_front methods on dynamic arrays.
2014-08-21 16:44:46 -07:00
Stephen Williams
5ee253b03b
Fix mis-spelled vpiStatisARray in sv_vpi_user.h header file
2014-08-21 16:44:46 -07:00
Stephen Williams
c9ff48bd4e
Add support for dynamic array/queue "last" index ($)
...
Internally, treat the "$" as a special expression type that takes
as an argument the signal that is being indexed. In the vvp target,
use the $last system function to implement this.
2014-08-21 16:44:45 -07:00
Stephen Williams
9b4681918b
Array access to queue variables.
2014-08-21 16:44:45 -07:00
Stephen Williams
0894bc6409
Non-synthesis version of the devel-stub.sh by default.
2014-08-21 16:44:45 -07:00
Stephen Williams
da63ef02d4
Implement the size method for queues.
...
This works by translating it to a $size() system function call.
The $size function is already implemented for dynamic queues and
it is easy enough to expand it for queues.
2014-08-21 16:44:45 -07:00
Stephen Williams
a730572e37
Elaborate size method of darray/queue objects.
2014-08-21 16:44:45 -07:00
Stephen Williams
d891285326
vvp code generation for push_back/push_front for queue objects.
2014-08-21 16:44:45 -07:00
Stephen Williams
e8b8fcba57
Support declaring queue variables all the way to vvp.
...
Nothing actually useful happens here, but the declarations
are functional.
2014-08-21 16:44:45 -07:00
Stephen Williams
6d052d4ff7
Handle queue types and expressions at pform level.
2014-08-21 16:44:45 -07:00
Maciej Suminski
72ff9ac00b
vhdlpp: Aggregate expression are elaborated if
...
they are used for Signal/Variable initalization.
2014-08-20 14:18:16 +02:00
Maciej Suminski
c92dea77fc
vhdlpp: Basic support for unbounded array types.
...
Once a signal/variable of unbounded array type becomes limited in its size, it
is emitted as a packed array. Therefore currently it works only for
bit/logic/reg/wire types.
2014-08-15 10:21:45 +02:00
Cary R
4ea512c4fd
Require a space between the synthesis and translate_* key words
2014-08-11 15:05:03 -07:00
Martin Whitaker
89f1344288
Fix for GitHub issue #33 - Problem with multi-dimensional arrays.
...
normalize_variable_unpacked() was not correctly calculating the
minimum expression width required to calculate the canonical
index.
2014-08-11 20:23:29 +01:00
Stephen Williams
96414af721
Merge branch 'master' of github.com:steveicarus/iverilog
2014-08-09 08:04:46 -07:00
Stephen Williams
2d2a720ea8
Do a better job with synthesis translate pragmas.
2014-08-09 08:04:25 -07:00
Maciej Suminski
9031f392ba
Convert string to bitstring in SigVarBase
...
constructor if applicable (vhdlpp).
2014-08-08 11:20:07 +02:00
Maciej Suminski
4786f80b0b
Add the string terminator for binary bitstrings.
2014-08-08 09:52:57 +02:00
Cary R
0f294cb607
Merge branch 'master' of github.com:steveicarus/iverilog
2014-08-07 16:26:26 -07:00
Cary R
f4c88b4a01
Add message that L-value concatenation is not supported in synthesis
2014-08-07 16:26:08 -07:00
Stephen Williams
374948ce1b
Merge pull request #35 from orsonmmz/real
...
Removed ExpReal::evaluate().
2014-08-07 08:47:27 -07:00
Maciej Suminski
6a2b579fb0
Removed ExpReal::evaluate().Its signature does not match the one meant to be overridden.
2014-08-07 09:48:35 +02:00
Maciej Suminski
d2ad7a4d28
Increase the output precision for floating point types.
2014-08-06 17:04:52 +02:00
Maciej Suminski
5830ecd67e
Avoid freeing the primitive types classes.
2014-08-06 15:01:59 +02:00
Maciej Suminski
69b145e216
Minor cleaning for valgrind output.
2014-08-06 15:01:28 +02:00
Maciej Suminski
5ed60a151f
Added support for real type in vhdlpp.
2014-08-06 15:00:35 +02:00
Stephen Williams
c7a36722e3
Merge branch 'master' of github.com:steveicarus/iverilog
2014-08-04 20:38:33 -07:00
Maciej Suminski
66d31b02be
Fixed vhdlpp segfault if it processes an entity without any ports declared.
2014-08-04 20:27:21 -07:00
Cary R
0a6d75f1db
Fix some cppcheck warnings (format string vs argument mismatches)
2014-08-01 18:55:44 -07:00
Stephen Williams
6a2956c672
Prepare snapshot 20140801
2014-08-01 14:07:30 -07:00
Stephen Williams
cdb1ea6264
Don't bother with cpp-precomp flag on OS/X.
2014-08-01 11:18:51 -07:00
Cary R
df1d0a7b47
Enable signed compare warning in the C code since it is now clean.
2014-07-31 12:26:15 -07:00
Cary R
8d9ac35202
Update lz4 files to latest from GTKWave
2014-07-28 14:04:05 -07:00
Cary R
945584c310
Fix memory leak in VAMS $simparam$str call.
2014-07-28 10:46:23 -07:00
Cary R
d6b6b76015
Update header files to use a more standard name to prevent rereading
...
This is from github report #16 . There are likely a few more issues
that need to be addressed though this takes care of the major ones.
2014-07-23 13:42:56 -07:00
Cary R
0cbd6d99af
SV: Add support for var decls in unnamed fork/join* blocks.
...
SystemVerilog allows variables to be declared in unnamed fork/join*
blocks. This patch adds support for this functionality.
2014-07-23 09:54:19 -07:00
Cary R
8e7e3c7493
Remove space issue
2014-07-22 18:59:58 -07:00
Cary R
588409389e
SV: Add support for var decls in unnamed begin/end blocks.
...
SystemVerilog allows variables to be declared in unnamed begin/end
blocks. This patch adds support for this functionality.
2014-07-22 18:58:23 -07:00
Stephen Williams
cc9d5f90e0
Merge branch 'master' of github.com:steveicarus/iverilog
2014-07-19 17:29:21 -07:00
Stephen Williams
714795709c
Handle casez without default case.
...
casez statements without default cases can get their input from
the context. This handles that situation properly.
2014-07-19 17:22:33 -07:00
Stephen Williams
7b10570e11
Synthesis handle blocks of FF with unique CE
...
Like this:
... if (ce0) foo <= foo_in;
... if (ce1) bar <= bar_in;
Note that this is within a block, and represents multiple FF nodes
with different clock enables.
2014-07-19 15:17:53 -07:00
Stephen Williams
cb381b3ee3
More robust Nexus::name() method.
...
This version handles some error conditions.
2014-07-18 20:16:17 -07:00
Cary R
f5e01081d1
vlog95: Report that substitute LPMS are not translated
2014-07-17 17:35:09 -07:00
Cary R
9c5113194d
Update LXT2 and FST files to latest from GTKWave
2014-07-17 16:17:22 -07:00
Stephen Williams
6bc3f98e0a
Sizer target should ignore IVL_LPM_SUBSTITUTE devices.
2014-07-17 09:21:40 -07:00
Stephen Williams
b99b4b0223
Trivial fix to main getopt string.
2014-07-17 08:17:55 -07:00
Stephen Williams
fa38a8e08d
Merge branch 'x-sizer6'
2014-07-17 08:17:05 -07:00
Stephen Williams
14f597acdd
Add support for synthesis translate meta-comments.
2014-07-15 18:03:40 -07:00
Stephen Williams
b991a991a7
Implement vpi_handle(vpiLeft/RightRange, ...) for signals.
...
This returns a constant object that can be treated like an
expression, so following the letter of the LRM.
2014-07-14 17:15:16 -07:00
Stephen Williams
515137c8c7
Imlement vpi_handle(vpiScope, 0) for NULL handles
...
This is not part of the standard, but it convenient, and may be
used by the libveriuser to implement some bits of PLI1.
2014-07-14 17:15:16 -07:00
Stephen Williams
d26a081cbc
Only get the vpiSysTfCall in getsimtime.c when needed.
2014-07-14 17:15:16 -07:00
Stephen Williams
dff9953bc2
Implement the ivl_do_not_elide property
2014-07-14 17:15:16 -07:00
Stephen Williams
d8f10e7aa2
Improbe vvp support for wide mux devices.
2014-07-14 16:46:58 -07:00
Stephen Williams
d5fb0f4344
Handle some tricky conditions assignments to parts.
...
When for example assigning to foo[<x>] within a contitional, and
doing synthesis, we need to create a NetSubstitute device to manage
the l-value bit selects.
2014-07-14 16:46:58 -07:00
Stephen Williams
c1e533d484
Add some debug convenience functions.
2014-07-14 16:46:57 -07:00
Cary R
58ec35a6af
All the unused warnings are fixed so stop blocking that warning
2014-07-10 19:12:07 -07:00
Larry Doolittle
ae6743cf69
Easy changes for -Wmissing-prototypes
2014-07-10 14:07:30 -07:00
Larry Doolittle
850d8c3ee9
Eliminate a few more easy warnings
...
Testing with 32-bit clang 3.3, with additional compiler flags
-Wsign-compare -Wundef
this patch eliminates the following warnings:
config.h:100:6: warning: 'UINT64_T_AND_ULONG_SAME' is not defined, evaluates to 0 [-Wundef]
vcd_priv2.cc:233:12: warning: duplicate 'extern' declaration specifier [-Wduplicate-decl-specifier]
parse.cc:6496:9: warning: comparison of 0 <= unsigned expression is always true [-Wtautological-compare]
parse.cc:6499:13: warning: comparison of 0 <= unsigned expression is always true [-Wtautological-compare]
parse.cc:6502:9: warning: comparison of 0 <= unsigned expression is always true [-Wtautological-compare]
parse.cc:6510:53: warning: comparison of integers of different signs: 'const unsigned int' and 'int' [-Wsign-compare]
Changing the vlltype elements from unsigned to int reconciles their
type with the native bison YYLTYPE structure.
2014-07-10 12:30:08 -07:00
Cary R
467e8afc41
Another update of fstapi.c from GTKWave to fix compile warnings.
2014-07-09 16:46:01 -07:00
Cary R
f17690ebde
Update fst and lxt files to latest from GTKWave also update cppcheck file
2014-07-09 16:13:26 -07:00
Cary R
774d173d69
Remove missing parameter warnings
2014-07-09 14:16:57 -07:00
Cary R
9d99a64bf0
Remove warnings and -Wno-type-limits option since it is not always supported.
2014-07-09 11:04:43 -07:00
Larry Doolittle
00a9c69348
Fully initialize a couple structures
...
Caused missing-field-initializers warnings from clang, but
surprisingly not from gcc.
2014-07-09 10:28:30 -07:00
Cary R
8f7277a5ab
Remove the unused parameter warnings in tgt-vlog
2014-07-09 09:34:44 -07:00
Larry Doolittle
e221a8ced9
Rearrange compiler warning flags
...
Before this patch, WARNING_FLAGS applied to both C and C++,
and WARNING_FLAGS_CXX applied to C++ only.
This patch adds a WARNING_FLAGS_CC that applies to C only.
That change should be generally useful; in particular the C
code is almost ready for -Wstrict-prototypes, which does not
apply to C++.
-Wextra (or -W) used to only apply to C++ via WARNING_FLAGS_CXX.
This patch moves it to WARNING_FLAGS, to apply to both C and C++.
Unfortunately, that triggers a ton of warnings.
For now, cover most of the new warnings up by adding
-Wno-unused -Wno-sign-compare -Wno-type-limits
to WARNING_FLAGS_CC. In the long run, I want to change the C coding
style, and take off these disable-warning flags. But those changes
can dribble in as separate commits; this patch is big enough already.
Actually fix a couple missing-field-initializers in libveriuser/veriusertfs.c.
2014-07-09 09:04:17 -07:00
Larry Doolittle
a575eeb29d
More fussing with C function prototypes
...
Six more -Wstrict-prototypes updates that I missed on the first pass.
The remaining warnings of this type originate in the lz4 code base.
2014-07-08 16:38:25 -07:00
Cary R
0dc12676f0
Update LXT2 files from GTKWave
2014-07-08 14:14:39 -07:00
Larry Doolittle
6ebb57195b
Fuss with C function prototypes
...
119 formal void parameters added to keep -Wstrict-prototypes happy.
Process found one real missing prototype in vpi/vcd_priv.h:
EXTERN void vcd_names_delete(struct vcd_names_list_s*tab);
8 such warnings left, all in Tony's code
2014-07-08 13:44:11 -07:00
Cary R
78cb0a7876
Add support for power operator in eval_const()
2014-07-07 18:17:45 -07:00
Cary R
47ddb18d54
vlog95: Note that casex (==?) and casez (synthesis) operators are not supported
2014-07-06 17:16:05 -07:00
Cary R
0611135758
Some more cppcheck cleanup/updates
2014-06-29 20:39:40 -07:00
Cary R
0ffd61a835
Remove some cppcheck warnings
2014-06-28 16:56:09 -07:00
Cary R
0728690df2
Fix a few cppcheck warnings.
2014-06-27 18:40:34 -07:00
Martin Whitaker
e82bafcb84
Fix for GitHub issue #30 : failed assertion in eval_tree.cc
...
The root cause was the constant propagation done during elaboration
of a multiply operation, which didn't check for mixed real/logic
expressions.
2014-06-20 20:52:15 +01:00
Cary R
54f4c1147b
C99 is now required for C files.
2014-06-17 12:59:57 -07:00
Larry Doolittle
642acb4082
Clean up some more sign-compare issues
...
The only known problems left are in files imported from gtkwave,
if not for them you could turn on -Wsign-compare.
Assumes c99 for c code, so the scope of for-loop indexes can be made sane.
2014-06-17 12:57:26 -07:00
Cary R
6101044bff
Fix gcc compile warning
2014-06-17 10:47:25 -07:00
Stephen Williams
c6e44f2da1
Fix argument ordering for synthesized casez compare.
2014-06-16 09:45:03 -07:00
Stephen Williams
3c0a982ab3
More flexible synthesis of DFF with asynchronous set/reset.
2014-06-15 19:10:09 -07:00
Stephen Williams
0f85bf0b9a
Basic DFF asynchronous set/reset synthesis support.
2014-06-15 18:22:02 -07:00
Stephen Williams
ccce9d9271
Merge branch 'master' into x-sizer5
2014-06-14 19:13:42 -07:00
Cary R
9c79e321ae
Spell, etc. fixes
2014-06-14 14:19:46 -07:00
Stephen Williams
6d2fa6e579
case/x/z synthesis with constant case expression.
...
If the case expression is constant, then the guards probably are
not, and the synthesis should be handled differently.
2014-06-13 18:22:24 -07:00
Stephen Williams
f8dc430fe5
Add synthesis support for casez statements.
...
This generates an EQZ LPM device that carries the case-z-ness to
the code generator.
Also add to the vvp code generator support for the EQZ device so
that the synthesis results can be simulated.
Account for the wildcard devices in the sizer.
2014-06-13 18:01:41 -07:00
Stephen Williams
26f71f2d94
Handle special case of missing condit inputs.
...
It shouldn't be possible, but sometimes is, that a NetCondit is
missing input nets during async synthesis. Handle this by generating
a place-holder net and printing a warning.
2014-06-12 17:50:44 -07:00
Cary R
7cd3bdb0d0
Add support for a single argument $urandom_range() call
2014-06-12 09:20:45 -07:00
Cary R
81947edaa5
A bit select is not the same as selecting part of a packed array
...
When adding the ability to select part of a multi-dimensional packed
array the sign and size information for a true bit select was broken.
2014-06-12 09:20:31 -07:00
Cary R
684e46a6c1
Update fstapi.c to latest from GTKWavE (remove some compile warnings)
2014-06-11 17:03:15 -07:00
Cary R
2bc9cb90dd
Update fstapi files to latest ones from GTKWave
2014-06-11 08:39:04 -07:00
Larry Doolittle
1e18d43107
Tie up simple loose ends for need_result_buf()
...
vvp/ is now free of -Wcast-align errors
2014-06-10 12:08:01 -07:00
Larry Doolittle
6a45a0d570
Don't lie to the c++ about some pointer alignment
...
Second try cleaning up cast-alignment problems surrounding need_result_buf().
Clang gave a bunch of warnings like
vvp/vpi_const.cc:196:34: warning: cast from 'char *' to 'p_vpi_vecval' (aka 't_vpi_vecval *') increases required alignment from 1 to 4 [-Wcast-align]
This version is verbose and changes the prototype for need_result_buf().
But it is semantically (c++) correct, and makes need_result_buf() feel like malloc().
2014-06-10 09:27:49 -07:00
Martin Whitaker
529e029abd
Fix for GitHub issue #28 - Insufficient string escaping in vvp script.
...
" characters in strings must be escaped when the compiler writes a
quoted string to a vvp script. This patch fixes up a few places where
this wasn't being done.
2014-06-09 22:40:26 +01:00
Larry Doolittle
855bf9cfe8
Pick some low-hanging const fruit
...
Makes more of the code const-correct; there are still plenty of difficult-to-fix const problems left.
No behavior change expected.
2014-06-09 10:47:28 -07:00
Larry Doolittle
35a8485a44
Fix some weird lint found by clang
...
Small stuff, no behavior change expected.
2014-06-09 10:44:48 -07:00
Cary R
12379ed26a
Fix spacing issue.
2014-06-07 18:22:42 -07:00
Cary R
6323e6a0a5
Update files from GTKWave to the latest from SVN.
2014-06-07 18:22:32 -07:00
Stephen Williams
41ff18206a
NetCase::synth_async gets a better handle on partly used inputs
...
Better handle the case where the output for some pins comes from
an earlier assignment. This allows for multiple ways to specify
default outputs for some cases: the default: case and pre-assignment.
2014-06-07 10:53:40 -07:00
Stephen Williams
f104ffc133
Merge branch 'master' into x-sizer5
2014-06-02 17:07:02 -07:00
Stephen Williams
ded1bd4949
Sanity check to prevent bad code getting through synth2 blending
...
When conditional ports are blending (by allowing NetPartSelects be
connected together to the outputs) make sure there isn't an accidental
overlap of drivers that invalidates the process.
2014-06-02 15:42:02 -07:00
Stephen Williams
579b59b8eb
Sizer recognizes more LPM types.
2014-05-25 19:38:12 -07:00
Stephen Williams
ef79f538d5
When making NetCondit objects, handle output part select.
...
When a mux (NetCondit) is only writing to a part of the output
vector (and using only a part of the inputs) then blend the mux
output with the previous statement output.
2014-05-25 18:33:26 -07:00
Stephen Williams
76883fa18c
NetCondit synthesis accounts for smaller l-values
...
If both conditions of a NetCondit device assign to the same subset
of l-value bits, then generate a smaller NetMux device that only
switches the affected bits.
2014-05-24 20:08:48 -07:00
Martin Whitaker
d05abf5ca4
Fix for GitHub issue 26 - compiler crash when module port has no internal net.
...
The compiler correctly reports an error when a module port has no
associated internal net/reg, but could crash when the module was
instantiated.
2014-05-23 22:36:28 +01:00
Martin Whitaker
ff72782ec6
Merge branch 'master' of git://github.com/steveicarus/iverilog
2014-05-23 21:59:01 +01:00
Martin Whitaker
d96e8872c1
Fix for GitHub issue 25 - compiler crash when function declared outside module.
...
This is an error in traditional Verilog and a unsupported feature in
SystemVerilog. Fail gracefully with a suitable error/sorry message.
Do the same for task declarations.
2014-05-23 21:55:46 +01:00
Cary R
6547fdee3d
vlog95: for cppcheck the target functions are used by the compiler.
2014-05-21 09:04:49 -07:00
Martin Whitaker
b7b77b2e75
Correct fix for GitHub issue 19.
2014-05-20 00:08:03 +01:00
Stephen Williams
f16c67d45a
synth2 NetForLoop synthesis works a lot like begin/end blocks.
...
Using the synth_async_block_substatement_ makes the for-loop
synthesis properly handle the chance that there are default
inputs.
2014-05-17 16:58:36 -07:00
Stephen Williams
020e280a98
nodangle functor accounts for NexusSet links
...
In a design, there may be lingering NexusSet objects, or the
nodangle may itself use NexusSet objects. This creates links,
and this should not confuse the functor.
While we are at it, clean up some handling of events structures.
2014-05-08 15:05:09 -07:00
Stephen Williams
109c5d895d
Synthesis of assignment that is part of larger block.
...
It is possible for an assignment statement to be part of a
grander complex that has lots of outputs, not all handled
by this particular assignment. In that case, the assignment
may need to figure out which output it is supposed to bind to.
2014-05-08 15:05:08 -07:00
Stephen Williams
ce864fc634
Synthesis of NetForLoop step that ahs compressed assignment operators.
2014-05-08 15:05:08 -07:00
Stephen Williams
be0c61051d
Add synthesis of for-loops
...
This required keeping for-loops as actual things through the
netlist form so that the synthesizer can get at and understand
the parts of the for-loop. This may improve vvp code generation
in the future, but for now continue to present to the vvp code
generation the block-while form.
2014-05-08 15:05:08 -07:00
Stephen Williams
ec0c66ff25
Fix internal error elaborating types used in different scopes
...
Some types, i.e. vector types with parameterized dimensions,
may have different elaboration results in different scopes.
Handle those cases in the elaboration caches.
2014-05-08 15:05:08 -07:00
Stephen Williams
5893d13ea3
Don't connect NetFF CE pin if it is not needed
...
When the clock enable is not generated, don't try to hook it
up then detach it. That will make a mess that needs clean up.
Instead, leave unused ce pins (Enable) unconnected.
2014-05-08 15:05:08 -07:00
Stephen Williams
8d9f3a0920
Fix crashes scanning links.
...
Signals are collected in a link map that uses the Link class so that
it doesn't need to save Nexus objects. But naked uses of Link don't
set the node_ and pin_zero_ members. So initialize them to zero so
that Nexus scanners can skip these naked Links.
2014-05-08 15:05:08 -07:00
Stephen Williams
17be8e8c7c
Handle special case of if inside of block.
...
If statements within blocks can confuse the synthesizer when there
are outputs that are assigned ahead of the if statement. This patch
handles that case.
2014-05-08 15:05:08 -07:00
Martin Whitaker
c32610d135
Further fix for GitHub issue 19 : incorrect handling of large shift values.
...
Apply the same fix to vvp as was applied to the compiler. See commit
065c48527c for details.
2014-05-04 20:39:05 +01:00
Cary R
be8df11217
Update fstapi.c to latest from GTKWave
2014-04-29 14:23:41 -07:00
Cary R
650cedb516
More SDF memory cleanup fixes
2014-04-27 17:57:43 -07:00
Cary R
a1d65336d2
Add SDF warning message and release COND and CONDELSE memory
2014-04-27 17:27:10 -07:00
Cary R
d6405f86d4
Fix space issue
2014-04-26 20:58:57 -07:00
Cary R
8c80193fc5
Ignore SDF COND and CONDELSE delay definitions.
2014-04-26 20:57:25 -07:00
Cary R
e4476d544f
Improve SDF warnings to separate name and scope
...
Some of the SDF warnings were mixing some of the scope path with the
instance name. These are now separated into just scope and instance name.
There was also a place where vpi_get_str() was being called twice in a
single print statement. This is illegal since vpi_get_str() uses a single
buffer and multiple calls will overwrite the buffer.
2014-04-25 13:56:01 -07:00
Cary R
c6cbaf3076
Merge branch 'master' of github.com:steveicarus/iverilog
2014-04-17 16:27:22 -07:00
Cary R
b687cc5f21
Remove cppcheck warnings in tgt-vvp
2014-04-17 16:26:51 -07:00
Stephen Williams
4d29df17b8
Merge branch 'master' of github.com:steveicarus/iverilog
2014-04-13 16:29:44 -07:00
Stephen Williams
fdcb073c14
Fix a variety of bugs in vpi_handle_by_name.
...
This function was apparently not well tested, because any use of
acc_handle_object() triggered a use of vpi_handle_by_name that was
buggy.
The implementation was awkwardly written, to parts of it were redone.
2014-04-13 16:25:30 -07:00
Cary R
734d56ce25
Remove space issue.
2014-04-10 14:37:07 -07:00
Cary R
a5423ce5ce
Update FST and related files to match the latest from GTKWave
2014-04-10 14:34:39 -07:00
Cary R
e336eca00f
vlog95: Report that array ports are not supported.
2014-04-10 14:20:22 -07:00
Stephen Williams
3a77537ed8
Handle scaled time is acc functions for non-scope objects
...
The tf_igetlongtime function may pass in any kind of object, so the
scale() function may need to convert an object handle to the handle
for the objects parent scope.
2014-04-08 11:11:49 -07:00
Stephen Williams
c8b20da4be
Merge pull request #21 from toddstrader/master
...
package imports in module headers
2014-04-07 14:09:50 -07:00
Stephen Williams
97e1151388
Merge branch 'x-mil13'
2014-04-07 11:06:54 -07:00
Stephen Williams
e6b394f825
Fix declaration of acc_fetch_paramtype
2014-04-07 09:24:30 -07:00
Stephen Williams
f752007e9c
Add some minor VPI/ACC fixes and updates
...
These were submitted.
2014-04-06 15:54:05 -07:00
Stephen Williams
40b36337e2
Fix some bugs with packed array dimensions.
...
The netparray_t::slice_dimensions bug was the most insidious and
caused all manner of confusion. Also fix some other packed array
and unpacked array (and mixed) indexing calculations.
2014-04-06 08:40:10 -07:00
Stephen Williams
df4889ba3d
Handle SEL_IDX_UP is some situations.
2014-04-06 08:40:09 -07:00
Stephen Williams
2e2317b7c7
Generalize the hname_t to handle n-dimensional scope arrays.
...
... Not that they actually exist yet. But this fixes some symbol
search issues and makes room for this support in the future.
2014-04-06 08:40:09 -07:00
Stephen Williams
e2bad56a5c
Fix overflow calculating packed offset in certain cases.
2014-04-06 08:40:09 -07:00
Stephen Williams
0accab6ec4
Handle non-overlapping assignments to unpacked arrays.
2014-04-06 08:40:09 -07:00
Stephen Williams
e55e832ea0
Handle unpacked arrays as output ports.
2014-04-06 08:40:09 -07:00
Stephen Williams
fc1f9ac6a5
Handle unpacked arrays as module input ports.
2014-04-06 08:40:09 -07:00
Stephen Williams
6caa41cc93
First pass at support for continuous assign of unpacked net arrays.
2014-04-06 08:40:09 -07:00
Stephen Williams
751f19cc46
Symbolic printout of PortType enumeration values.
2014-04-06 08:40:09 -07:00
Stephen Williams
f8e33b12cd
Clean up pform_module_define_port in preparation for new tricks.
...
Get rid of the data_type, signed_flag, and range arguments to the
pform_module_define_port because they add no value within the
parse.y parser. Cleaning these out will hopefully ease the addition
of new functionality.
2014-04-06 08:40:09 -07:00
Stephen Williams
aaee9989c2
Handle for_variable_declaration
...
This can be handled entirely in the parser, where we rewrite the
syntax to me a begin/end block that contains the index variable
declaration and the for loop.
2014-04-06 08:40:08 -07:00
Stephen Williams
a849249a86
Allow typedefs to override inherited type names.
2014-04-06 08:40:08 -07:00
Todd Strader ([email protected] )
849ba64cf7
package imports in module headers
...
See IEEE 1800-2012 A.1.2 module_nonansi_header and module_ansi_header
2014-04-03 20:11:57 -04:00
Cary R
bb182cf3ce
Update cppcheck suppression file.
2014-03-20 18:27:22 -07:00
Martin Whitaker
bc9382eea3
Fix for GitHub issue 20 : confused about signed/unsigned in strange ?: example.
...
The root cause was that NetESignal::dup_exr() was not copying the calculated
type (signed/unsigned) of the expression.
In passing, found and fixed a similar issue when calculating a blended value
for a constant ternary expression.
2014-03-06 19:35:25 +00:00
Stephen Williams
88e4938074
Merge branch 'master' into vec4-stack
2014-03-04 19:08:56 -08:00
Stephen Williams
e932c7a637
Support get of vpiIntVal from vec4 stack.
2014-03-04 19:02:21 -08:00
Stephen Williams
b5e0099f28
Fix support for enum literals with undefined values.
2014-03-01 17:45:13 -08:00
Stephen Williams
1afe7476e3
Handle nested l-values in vec4-stack code generator.
2014-03-01 16:49:15 -08:00
Stephen Williams
4068570f43
Fix %pow and %pow/s to properly account for 'x operands.
2014-03-01 16:11:47 -08:00
Martin Whitaker
3e41a93f3e
Fix for br948 : user-func call may return incorrect value in a CA context.
...
%exec_ufunc assumed that because a function can never block, a call to
vthread_run() on the function code would only return when the final %end
instruction had been executed. This is not true if the function contains
a named block, which will be executed via a %fork instruction, allowing
the main function thread to suspend after a %join instruction. The fix
is to break %exec_ufunc into two instructions, the first setting the
function inputs and executing the function code, the second collecting
the function result. This provides the opportunity for the parent thread
to suspend after the %exec_ufunc instruction until all its children have
completed.
2014-03-01 23:38:23 +00:00
Stephen Williams
7ceb18fb37
Merge branch 'master' into vec4-stack
...
Conflicts:
netmisc.cc
tgt-vvp/eval_expr.c
vvp/vthread.cc
2014-03-01 09:02:14 -08:00
Stephen Williams
d2ff77d56c
More standard handling of unsized numbers as system task arguments.
2014-03-01 08:38:23 -08:00
Stephen Williams
3c660d04f3
Merge pull request #10 from kiteflyingmonkey/patch-1
...
Fixed homepage link
2014-02-28 19:50:09 -08:00
Cary R
d0d421ebe2
Remove compile warning
2014-02-28 17:29:55 -08:00
Cary R
13c1925045
Fix space issue
2014-02-28 17:19:35 -08:00
Martin Whitaker
c61d2151c1
Fix invalid optimisations in tgt-vvp.
...
The vvp code generator was optimising away adds and subtracts where one
operand was a constant zero. This is not valid for 4-state arithmetic.
It was also optimising away multiplies by a constant zero - but in this
case getting it wrong and effectively multiplying by 1.
2014-02-28 23:29:15 +00:00
Martin Whitaker
065c48527c
Fix for GitHub issue 19 : incorrect handling of large shift values.
...
For shift operations evaluated at compile time, the compiler was converting
the right operand to a native unsigned long value. If the operand exceeded
the size of an unsigned long, excess bits were discarded, which could lead
to an incorrect result.
The fix I've chosen is to add an as_unsigned() function to the verinum class
which returns the maximum unsigned value if the internal verinum value is
wider than the native unsigned type. This then naturally gives the correct
result for shifts, as the verinum bit width is also an unsigned value.
I've changed the as_ulong() and as_ulong64() functions to do likewise, as
this is more likely to either give the correct behaviour or to give some
indication that an overflow has occurred where these functions are used.
2014-02-28 20:39:14 +00:00
Martin Whitaker
ed2e339dd6
Fix for GitHub issue #18 : undef propagation of const multiplies is incorrect.
...
When an expression is elaborated, the compiler converts multiplies with
one constamt zero operand into a constant zero value. This is only valid
if the other operand is not a 4-state variable.
2014-02-27 19:30:28 +00:00
Martin Whitaker
5dcd2e8957
Added width cap for unsized expressions.
...
Unsized expressions can expand to extremely large widths. Usually this
is actually a mistake in the source code, but it can lead to the compiler
temporarily using extremely large amounts of memory, or in the worst
case, crashing. This adds a cap on the width of unsized expressions (by
default 65536 bits, but overridable by the user), and causes a warning
message to be output when the cap is reached.
2014-02-27 19:20:20 +00:00
Martin Whitaker
1f81d4c081
Fix for br947.
...
When performing the initial assignment for a procedural continuous
assignment, any previous continuous assignment to the destination
signal must be unlinked first, otherwise the initial value for the
assignment will propagate to any other nets that are driven by the
original source signal.
2014-02-26 08:39:33 +00:00
Martin Whitaker
a3450bf856
Fixes for GitHub issues 13 and 15.
...
The verinum arithmetic operators now observe the standard Verilog
rules for calculating the result width if all operands are sized.
If any operand is unsized, the result is lossless, as before.
They also now all observe the standard rules for handling partially
undefined operands (if any operand bit is 'x', the entire result is
'x').
I've also added the unary '-' operator, and renamed v_not() to be
the unary '~' operator. This has allowed some simplification in
other parts of the compiler.
2014-02-25 20:39:21 +00:00
Stephen Williams
91b7c6ab55
Merge branch 'master' into vec4-stack
...
Conflicts:
vvp/vthread.cc
2014-02-21 18:04:16 -08:00
Stephen Williams
ebed793dec
Merge branch 'master' into vec4-stack
...
Conflicts:
vvp/vthread.cc
Signed-off-by: Stephen Williams <[email protected] >
2014-02-21 17:34:59 -08:00
Martin Whitaker
320f6d008c
Output sorry message for missing procedural assign/force functionality.
...
A procedural continuous assignment is supposed to be updated any time
a variable on the RHS changes. Currently this only happens if the RHS
is a simple signal.
2014-02-21 23:02:05 +00:00
Martin Whitaker
a76be3571d
Fix for br946 - procedural continuous assignment causes vvp internal error.
...
In the case that the RHS of a procedural continuous assignment is a simple
vector that is wider than the LHS, changes to the RHS vector cause the
entire vector to be sent to port 1 of the LHS vvp_fun_signal object. This
vector needs to be coerced to the size of the LHS. Note that this is a
stopgap fix until vvp handles arbitrary expressions on the RHS of a
procedural continuous assignment.
2014-02-21 22:48:50 +00:00
Martin Whitaker
345c9cf21c
Implement correct behaviour for signed vector power operations in vvp.
...
Signed vector power operations were being implemented using the double
pow() function. This gave inaccurate results when the operands or
result were not exactly representable by a 64-bit floating point number.
2014-02-19 20:11:57 +00:00
Martin Whitaker
5a06602af2
Fix for GitHub issue 14 : Bug in processing 1'b1 >= |1'bx.
...
During expression evaluation, the compiler attempts to optimise away
relational operations when one side is constant and all possible values
of the other side would result in the relation being true. This is not
a valid optimisation if the other side is a 4-state variable, as an
'x' or 'z' will result in the relation being unknown.
2014-02-18 21:22:19 +00:00
Stephen Williams
830083d99b
Merge branch 'x-sizer3'
2014-02-16 17:05:53 -08:00
Stephen Williams
6902bf44e3
Improved error handling in parser around typedefs.
2014-02-16 17:04:52 -08:00
Stephen Williams
8f849a9944
Sorry message for unpacked array module ports.
2014-02-16 15:56:32 -08:00
Stephen Williams
b1ef0997ed
Merge branch 'x-sizer3'
2014-02-15 15:19:55 -08:00
Martin Whitaker
ecce1d25bc
Fix for GitHub issue 12 : Ternary lval-rval width mismatch.
...
A simple typing error that caused the expression to be incorrectly
evaluated as a real constant.
2014-02-15 23:05:41 +00:00
Stephen Williams
f43080fbcb
Detect proper support for missing else_ without latches (synthesis)
2014-02-15 14:54:58 -08:00
Stephen Williams
463407572f
Sizer pay attention to ivl_synthesis_off attribute.
2014-02-15 14:44:55 -08:00
Stephen Williams
6b6574dd8a
sizer support for simple LPM MUX devices.
2014-02-15 14:44:15 -08:00
Stephen Williams
4e81939eda
Handle asynchronous if-without-else synthesis.
2014-02-15 14:16:22 -08:00
Martin Whitaker
66bdbb77ec
Fix for GitHub issue 9 part 2 : Efficiency of the verinum pow() function.
...
This changes the verinum pow() function to use the more efficient algorithm
used in the vvp runtime. It will still be slow if the left operand is unsized
and the right operand is large, as it will expand the result vector to avoid
overflow.
2014-02-15 22:06:31 +00:00
Martin Whitaker
5853f7d867
Fix for GitHub issue 9 part 1 : Efficiency of vvp_vector2_t::pow() function.
...
The vvp_vector2_t::pow() function is recursive, and performs a multiplication
operation on each step. The multiplication operator was expanding the result
vector to accomodate the maximum possible result value for the given operand
vectors, thus causing the execution time of the power operation to be
exponentially proportional to the exponent value. Both in this case and
in general, it is unnecessary for the multiplication result vector to be
expanded, as the compiler has already determined the required vector width
during elaboration, and sizes the operand vectors to match.
2014-02-15 21:40:55 +00:00
Martin Whitaker
68f8de28af
Fix for GitHub issue 7 : Undef propagation in power operator.
...
The vvp_vector2_t constructor that takes a vvp_vector4_t value was
documented as creating a NaN value if the supplied vector contained
any X or Z bits, but instead used the standard Verilog 4-state to
2-state conversion semantics (X or Z translate to 0). I've added an
optional second parameter to the constructor to allow the user to
choose which semantics they want, as both are needed.
2014-02-15 13:14:45 +00:00
Martin Whitaker
ac3aee0172
Fix for GitHub issue 8 : Signedness of constant binary bitwise operations.
...
When doing constant evaluation of binary bitwise operations, the result
value must be signed if the expression type is signed.
2014-02-15 11:39:05 +00:00
Martin Whitaker
8135f369a5
Fix for GitHub issue 11 : Syntax error on operator attributes.
...
Attributes are allowed to be attached to unary, binary, and ternary
operators in expressions. For now just accept and discard them.
2014-02-14 23:29:22 +00:00
Stephen Williams
be5bfeb172
Elaborate widths of parameters correctly for unsigned values
...
If there is no size in the parameter type declaration or on the
value itself, then give the parameter value a minimum width of
integer bits.
2014-02-11 18:24:12 -08:00
Stephen Williams
801e795112
Better job of matching adder operand sizes for vec4 code generator.
2014-02-10 18:06:56 -08:00
Stephen Williams
e66fc7e5cc
Port UWIRE assignments to vec4 branch.
2014-02-10 17:19:52 -08:00
Stephen Williams
1d63875e5d
Merge branch 'master' into vec4-stack
...
Conflicts:
elab_lval.cc
2014-02-10 16:26:22 -08:00
Stephen Williams
be1130ddbf
More robust case statement synthesis
...
Handle the cases that the case statement carries complet sub-
statements. This is just a generalization of what is already
there.
2014-02-09 17:30:30 -08:00
Stephen Williams
9f2b7d6553
Rearrange counters to me more realistic
...
Instead of counting gate types, convert to gate count estimates
and some other interesting statistics. Also handling the descent
into child scopes.
2014-02-09 08:59:51 -08:00
Stephen Williams
f5041e6c09
Collect some actual sizer statistics.
2014-02-08 18:53:42 -08:00
Stephen Williams
959ac3229e
Start a sizer backend.
2014-02-08 10:16:11 -08:00
Stephen Williams
554fb7ebdd
Various internal vec4 size mismatches fixed.
2014-02-07 17:50:13 -08:00
Stephen Williams
c9e8392dc7
Fix dangling vec4 stack when force assignment is suppressed.
...
Also improve the %debug/thr instruction.
2014-02-07 16:10:28 -08:00
Stephen Williams
60d37e1f53
More vec4 support for various things.
2014-02-07 11:24:41 -08:00
Colin
e0ac4893f0
Fixed homepage link
...
The link was pointing to a page that said:
This page has been moved to http://iverilog.icarus.com , you will be forwarded there automatically in 3 seconds.
Please update your links.
So now it's updated
2014-02-07 12:22:53 +00:00
Stephen Williams
401fccdf6e
vec4 handling of DARRAY of vec4 vectors.
2014-02-06 15:05:26 -08:00
Stephen Williams
f5564a195f
vec4 versions of compressed assignment statements.
2014-02-06 09:55:25 -08:00
Stephen Williams
c7e61f3aa4
Merge branch 'master' into vec4-stack
2014-02-05 15:18:25 -08:00
Stephen Williams
a012406ca4
Fix broken search where member names accidentally match variables.
2014-02-03 20:04:24 -08:00
Stephen Williams
52a9fdde8a
Handle packed structs as module outputs.
2014-02-03 19:22:59 -08:00
Stephen Williams
4f1c43b690
Account for force l-values that are uwires.
2014-02-02 17:05:42 -08:00
Stephen Williams
7f59c51ca2
Handle proceedural writes to UWIRE objects.
...
The elaborator allows this only if it determines that the bits
that are procedural written are not also continuously written.
2014-02-02 16:43:48 -08:00
Stephen Williams
0be577cc44
Allow some behavioral assignments to unresolved wires.
...
If the l-value is an unresolved wire, then elaboration can allow
the assignment as long as it is to bits that are not otherwise
driven. Handle this in some simple cases.
2014-02-02 11:08:43 -08:00
Stephen Williams
49cf5556a2
Fix primitive table lexical analysis.
...
Sequences of digits in the table of a primitive may be matched
as decimal numbers instead of digits, and this breaks some
primitives.
2014-02-02 10:57:53 -08:00
Stephen Williams
1805598eae
Fix some vec4 handling of putc, len, and other string methods.
2014-01-31 19:01:28 -08:00
Stephen Williams
0eca210722
Merge branch 'master' into vec4-stack
2014-01-30 17:07:54 -08:00
Larry Doolittle
3e95966d70
More spelling fixes
...
Mostly comments
Changs "initilzers" in a string visible with debug_elaborate.
Includes a few British->American changes in the root directory only.
2014-01-30 16:43:17 -08:00
Stephen Williams
fdc9e8590d
Merge branch 'master' into vec4-stack
2014-01-30 15:59:51 -08:00
Larry Doolittle
f76d56beb8
Remove lint detected by clang
...
With this change, iverilog builds and runs with no extra warnings when using clang 3.0
2014-01-30 15:39:55 -08:00
Larry Doolittle
be17bfc0e9
Spelling fixes
...
Mostly comments.
One user-visible string ("Evalutated to ") changed in the debug_eval_tree case.
2014-01-30 15:34:20 -08:00
Larry Doolittle
77a01f65d0
Remove fixable unused-parameter warnings
...
I see other warnings within vhdlpp/lexor.cc caused by a flex bug
(see http://sourceforge.net/p/flex/bugs/115/ ), which I won't try to work around.
2014-01-30 15:34:08 -08:00
Stephen Williams
e497f63e29
Implement string compares for vec4 support.
2014-01-28 17:11:21 -08:00
Stephen Williams
75233a9bca
vec4 implementation of auto-increment/decrement.
2014-01-28 16:24:26 -08:00
Stephen Williams
11197baf86
The vec4 %cvt/vr requires a <wid>
2014-01-28 15:51:29 -08:00
Stephen Williams
23ba0bc019
various vec4 fixes.
2014-01-25 19:25:21 -08:00
Stephen Williams
9cfb15a302
Implement assign/vec4/off/e
2014-01-23 18:39:29 -08:00
Stephen Williams
607b63a758
Merge pull request #5 from cliffordwolf/master
...
Added missing support for binary ^~ in eval_tree.cc
2014-01-23 17:12:05 -08:00
Stephen Williams
8bebe59e20
Fix vec4 abs() generating duplicat labels.
2014-01-22 17:15:26 -08:00
Stephen Williams
20d415463a
vec4 non-blocking assign to array swapped delay and part offset!
2014-01-21 20:58:48 -08:00
Stephen Williams
9c1dcad994
vec4 vvp support for non-blocking assign with delay and part offset.
2014-01-21 19:37:05 -08:00
Stephen Williams
0e13726e83
fix broken call-out of real-valued system functions.
2014-01-21 13:31:49 -08:00
Stephen Williams
54346d7095
vec4 implementations of real ternary and vec4 to real casts.
2014-01-21 12:02:59 -08:00
Stephen Williams
0121fbc88c
Remove useless assert.
2014-01-21 11:05:32 -08:00
Stephen Williams
f1855eed0e
Fix system function call in net types to get proper vector width.
...
This means using some of the new vec4 infrastructure to get at the
data, instead of using the old thread bit pointers. In the process,
remove the vbit and vwid members that pointed to thread bits. Those
bits no longer exist.
2014-01-20 19:07:11 -08:00
Stephen Williams
0f9828f179
Fix vec4 overflow of times when they are >32bits.
2014-01-19 14:28:39 -08:00
Stephen Williams
d2c2d6d8dc
vec4 versions of %cassign/vec4/off and %force/vec4/off send flags[4].
2014-01-18 17:08:36 -08:00
Stephen Williams
f94a655121
Yet again, try to fix vec4 calculation of n-dimensional array index.
2014-01-18 16:04:25 -08:00
Stephen Williams
078a3fd409
Was a little too aggressive with the lossless elab_and_eval
...
The index expressions ARE self-sized context, we just need to
force the EXPAND flag to make this work.
2014-01-17 18:22:11 -08:00
Stephen Williams
dfaed128c0
Fix %store/vec4 overlap of vectors written with extreme indices.
2014-01-15 16:30:34 -08:00
Stephen Williams
1fc4093191
Fix possible overflow in calculation of canonical indices.
2014-01-15 14:26:53 -08:00
Stephen Williams
ae1f8be277
Wrap up vpi access to vec4 stack items.
2014-01-14 17:10:03 -08:00
Stephen Williams
d8533104b0
Cleanup vec4 handling of suppressed store/assign due to bad offset/index math.
2014-01-14 12:00:39 -08:00
Stephen Williams
c6c697bdb7
WRap up vec4 support for system function calls.
2014-01-14 09:22:23 -08:00
Stephen Williams
660d59a7a9
vec4 versions of the %force instructions.
2014-01-13 18:57:03 -08:00
Stephen Williams
92a5e6a698
vec4 based calls to simple real system functions.
2014-01-13 17:46:39 -08:00
Stephen Williams
aaa054a932
Fix botched implementations of vec4 based shift.
2014-01-13 17:46:14 -08:00
Stephen Williams
079065ea73
Remove some dead code in tgt-vvp.
2014-01-13 17:45:44 -08:00
Stephen Williams
1905264061
vec4 support for part select of memory word to VPI function.
2014-01-13 16:12:56 -08:00
Stephen Williams
b0a9430e98
Wrap up vecc4 support for left/right shift expressions.
2014-01-13 16:11:47 -08:00
Stephen Williams
f906384423
Elaborate r-vlaue packed struct members pads as needed.
2014-01-11 19:19:15 -08:00
Stephen Williams
fc42f40770
Fix problem with enum types in re-used modules
...
When a module is instantiated multiple times, the enum
types contained within would cause trouble. This fixes
that by elaborating in proper scope context.
2014-01-11 19:19:15 -08:00
Stephen Williams
6ec31517a9
Implement $bits(type) to get the size of a type
...
In the process, I implemented a means to get at
previously elaborated types from the pform type
pointer.
2014-01-11 19:19:15 -08:00
Stephen Williams
8a4d769b3d
Type name expressions down to elaboration.
2014-01-11 19:19:15 -08:00
Stephen Williams
a3b29dd70b
Handle enumeration literals that are in $root.
2014-01-11 19:19:14 -08:00
Stephen Williams
b0491b9c54
Handle typedefs in $root scope.
2014-01-11 19:19:14 -08:00
Stephen Williams
6a93b6a7e4
Fix some subtle code generator bugs with wide literals and large r-values.
2014-01-07 18:46:35 -08:00
Stephen Williams
ec6009dd8f
Compile out the T<...> format in vvp.
...
This ifdef's the code out. Leave it in place for a little longer
for reference.
2014-01-06 20:36:26 -08:00
Stephen Williams
4820d46353
Implement some vpi_get_value formats for vec4 stack values.
2014-01-06 20:27:14 -08:00
Stephen Williams
a2845cee70
Update %pow instructions to use vec4 stack.
2014-01-06 10:34:07 -08:00
Stephen Williams
c897ca017c
Update %div instruction to vec4 version.
2014-01-06 10:14:49 -08:00
Stephen Williams
aee540d8bb
Fix sort of %event command in vvp compile list.
...
The sort is important, the names must be sorted because the table is
searched using binary search.
2014-01-06 09:12:42 -08:00
Stephen Williams
19402aeef2
get vpiStringVal from vec4 stack positions.
2014-01-06 08:35:49 -08:00
Stephen Williams
fcc0a6a203
vec4 string literal expressions
2014-01-06 08:35:23 -08:00
Clifford Wolf
2165905613
Merge branch 'master' of https://github.com/steveicarus/iverilog
2014-01-05 23:32:49 +01:00
Stephen Williams
e5eb754150
vec4 versions of a bunch of unary operators.
2014-01-05 14:12:27 -08:00
Martin Whitaker
d1c9dd554b
Fix for github issue #6 .
...
When creating a constant zero for implementing a unary minus operation
using a binary subtraction operator, the constant needs to be to exactly
the expression width.
2014-01-05 20:53:58 +00:00
Stephen Williams
063c6d6065
Add the %event instruction, remove %ix/get and %ix/get/s.
2014-01-05 12:39:52 -08:00
Stephen Williams
2fc8ce8a16
Implement vec4 basec %assign delay and event / vpiTimeVal for functions.
2014-01-05 12:04:16 -08:00
Stephen Williams
1a3adbe9cd
Vec4 store to memories.
...
This also reworks the working of the %store/vec4 instruction to
take a part offset, and eliminate the %store/vec4/off instruction.
2014-01-05 10:30:59 -08:00
Stephen Williams
63fa44fa4a
vec4 support for ufuncs and ligical AND.
2014-01-05 17:15:30 +00:00
Stephen Williams
f89dbd48c8
Add vec4 support for bitwise or/nor/nand/xor/xnor.
2014-01-04 23:48:16 +00:00
Stephen Williams
9fc3e84e93
vec4 cassign to part selects.
2014-01-04 22:58:58 +00:00
Stephen Williams
e708a5b59d
Handle vec4 part selects / vec4 cassign / repeat statements
...
These features need to be adapted to the vec4 stack.
2014-01-04 22:11:07 +00:00
Stephen Williams
d55e4c0552
Redesign support for system functions that return vec4
...
Redsign the handling of the return value, including a rework of
the %vpi_func syntax to carry the needed information.
Add a few more arithmetic operator instructions.
2014-01-04 22:06:58 +00:00
Clifford Wolf
ef06bf7589
Added missing support for binary ^~ in eval_tree.cc
2013-12-30 11:53:44 +01:00
Stephen Williams
54926840e6
Handle vec4 stack version of concatenation.
2013-12-28 07:50:37 +02:00
Stephen Williams
5ef077fdf6
Start work on converting vec4 expressions to use stack.
...
Instead of using a bit4 space to hold thread vectors, create a
vec4 stack--much like the real, string, and object stacks--to
hold intermediate values.
2013-12-27 17:04:42 +02:00
Cary R
336b29955d
vlog95: a zero width expression is special and is not a self determined context
2013-12-19 20:41:43 -08:00
Cary R
7fa2a4ccf3
vlog95: add support for emitting nested class L-values
2013-12-19 20:40:07 -08:00
Cary R
e4fc5806c4
vlog95: spelling fixes
2013-12-19 20:39:58 -08:00
Cary R
4def0110b5
Fix compile warning.
2013-12-19 09:22:16 -08:00
Cary R
503a1bf6d7
Add support for the array querying function in a constant context
...
This patchs adds support for the $dimensions() and $unpacked_dimensions()
array functions. Since the argument is only used to get the type information
these functions can always be evaluated at compile time.
For the following functions if the dimension argument is constant or omitted
and the first argument is not dynamic (a string or dynamic array) they will
return the specified information.
$left(), $right(), $high(), $low(), $increment() and $size()
Dynamic information and a variable second argument will be implement in a
future patch.
2013-12-18 19:04:22 -08:00
Cary R
92e4ca3a92
Report that vpi_handle_by_index() is not supported for a vpiNet
2013-12-12 17:10:26 -08:00
Martin Whitaker
9e25884f12
Fix for br942 - allow function declaration in VHDL architecture.
2013-12-11 23:00:58 +00:00
Stephen Williams
819770a6c4
Handle enumerations as packed struct/union members.
...
There were also some subtleties related to using enumerations
from typedefs and using them in multiple places. Fix various
bugs related to those issues.
2013-12-07 12:20:28 -08:00
Stephen Williams
7669a42cfb
Handle some assertion syntax in the parser.
...
Implement some yacc rules for assertion syntax.
Add the -gassertions/-gno-assertions command-line flags to
enable or disable assertions.
2013-12-07 12:20:28 -08:00
Stephen Williams
0495d75fcb
More relaxed handling of types of packed struct members as l-values.
2013-12-07 12:20:28 -08:00
Stephen Williams
0d6c15e45a
Handle packed unions properly during elaboration.
...
This also gets r-value use of packed unions correct.
2013-12-07 12:20:28 -08:00
Stephen Williams
49756a8e7a
Unions through pform.
2013-12-07 12:20:28 -08:00
Stephen Williams
0b4056817a
Generalize struct member type
2013-12-07 12:20:28 -08:00
Stephen Williams
aced587461
Macros with formal arguments can have default text for those arguments.
2013-12-07 12:20:28 -08:00
Cary R
077bd5b7ef
Do not return a handle to a port when searching by name
...
The standard explicitly states that only object with a full name
can be searched for by name. A port does not have a full name and
hence should be skipped so that a different object (the signal,
etc.) can be returned. This patch adds code to skip ports when
searching for an object handle by name.
2013-12-06 18:28:02 -08:00
Cary R
bf9781e8fd
In tgt-blif the code must be linked with the C++ compiler
2013-12-06 15:09:56 -08:00
Cary R
40840368bb
Fix two compile warnings under RHEL-5 with gcc 4.1.2-54
2013-12-04 16:45:43 -08:00
Cary R
5946fa46a6
Fix memory leak in %putc/str/v opcode.
2013-12-04 16:30:36 -08:00
Cary R
196df151aa
Correctly cleanup class and string object when using valgrind
2013-12-04 16:28:28 -08:00
Stephen Williams
c1566bc02b
Merge branch 'master' of github.com:steveicarus/iverilog
2013-12-04 16:22:11 -08:00
Stephen Williams
f349197df3
Describe the %putc/str/v vvp opcode.
2013-12-04 16:22:01 -08:00
Cary R
7e55babb62
Fix leaks in the object stack
...
This patch fixes some leaks in the object stack when getting various
class properties. With this fix an assert can be added to verify that
the object stack is clean when a thread is exiting.
2013-12-03 17:24:42 -08:00
Cary R
5a0f9f4604
Fix CXX variable in tgt-blif/Makefile.in
2013-12-03 10:12:08 -08:00
Cary R
ae90da9951
Improve the classs cleanup code when using valgrind
2013-12-03 09:16:24 -08:00
Cary R
9544cb516d
Fix some compile warnings
2013-11-24 14:35:44 -08:00
Stephen Williams
fa8d35ae9c
Support nested l-value objects
...
This allows for syntax like a.b.c where a is a class with member
b, which is a class with member c, and so on. The handling is mostly
for the support of compound objects like classes.
2013-11-22 19:54:42 -08:00
Stephen Williams
37ac1ed474
Clean up dead code in ivl_lval_t handling.
2013-11-22 12:02:03 -08:00
Stephen Williams
483d0534ae
Merge branch 'master' of github.com:steveicarus/iverilog
2013-11-22 10:40:06 -08:00
Stephen Williams
be7d763352
Sorry message for union declarations.
2013-11-22 10:39:48 -08:00
Cary R
04bab6b197
Fix a problem with reaping a thread with detached children
...
When a thread that has detached children is reaped the detached children
need to be fully detached so they can be reaped correctly. If they are not
fully detached then they may reference a parent that has already been
reaped (memory freed). Found with valgrind.
2013-11-20 18:01:35 -08:00
Cary R
f47af361cd
For default function arguments do not access an out of range real argument.
...
The code should only look at the real argument that exist any missing
arguments default to not being defined and hence needs to use the
default expression. Found with valgrind.
2013-11-20 16:52:17 -08:00
Cary R
676786a399
Remove compile warning
2013-11-20 11:29:59 -08:00
Stephen Williams
0692cd54e7
Support some simple class initialization assignments.
2013-11-16 17:04:14 -08:00
Stephen Williams
68d83383ff
Elaborate nested l-values.
...
This gets nested l-values to (but just short of) the ivl_target API.
Now the elaborator can process nested l-values, but I haven't figured
out how to present that at the ivl_target.h API.
2013-11-16 16:27:05 -08:00
Stephen Williams
9bd9c8f301
Implement class extends arguments.
...
This implements constructor arguments right after the base class
name in the class extends syntax.
2013-11-10 18:03:19 -08:00
Stephen Williams
f16fd03dab
Elaborate PChainConstructor calls.
...
It is better to leave the handling of PChainConstructor calls to
the elaboration, instead of stripping them out early. This allows
for handling the arguments of the chain constructor in the correct
scope.
2013-11-10 18:03:19 -08:00
Stephen Williams
a7d8c983ba
Blend initializer statements into any explicit constructor.
...
If there is an explicit constructor, then blend all the statements
of the implicit constructor into it so that there is only one
constructor function.
2013-11-10 18:03:19 -08:00
Stephen Williams
d192f545ac
Chain class instance constructors with arguments.
2013-11-10 18:03:19 -08:00
Stephen Williams
0157a156fb
Elaborate implicit chaining of constructors in class new.
2013-11-10 18:03:19 -08:00
Stephen Williams
9f83882bcc
Parse/elaborate class derivation
...
This gets us down to working classes, but does not yet implement
calls to the parent constructor, implicitly or explicitly.
2013-11-10 18:03:19 -08:00
Martin Whitaker
bfb14fbbc6
Fix memory leak in NetBlock::nex_input().
2013-10-28 23:08:52 +00:00
Martin Whitaker
be2595085f
Reorder calls to test_width() on binary operands for efficiency.
...
It is more common to find an unsized number on the right hand side
of a binary operator than on the left hand side, particularly for
comparison operations (e.g. x < 10 rather than 10 > x), so testing
the width of the right operand first is less likely to result in
the width needing to be retested. Counting the number of times an
operand width is retested when running the test suite confirms this;
before this change an operand width was retested 4869 times, after
the change an operand width was retested 99 times.
2013-10-28 22:55:10 +00:00
Martin Whitaker
4625e7e2b6
Improvements to strict-expr-width mode.
...
Enable error reporting when an unsized number is used in a concatenation
operand. Allow greater pruning of expressions containing unsized numbers.
2013-10-28 22:07:09 +00:00
Martin Whitaker
bb39d09d5e
Eliminate spurious error message for array word lval in always @* block.
2013-10-26 23:49:43 +01:00
Martin Whitaker
36c91491cc
Make tgt-vvp insert a BUFT for pulldown devices.
...
A BUFT is needed to allow a force to override the pull value. This had
already been done for pullup devices, so factor out the common code and
use for both pullup and pulldown.
2013-10-26 23:49:43 +01:00
Martin Whitaker
d291e2b23d
Fix errors in constant propagation.
...
Ensure undriven, multiply-driven, and forced nets are correctly handled
by the constant propagation optimisation pass.
2013-10-26 23:49:43 +01:00
Martin Whitaker
1814c24a90
Fix pullup/pulldown behaviour for tri1/tri0 nets.
...
Currently vvp only applies the pullup/pulldown for tri1/tri0 nets when
the net is not driven. The correct behaviour is to treat the pullup/
pulldown as an extra driver (with pull strength).
2013-10-26 23:49:43 +01:00
Cary R
92e08fdcd8
Only calculate the output set for a begin/end block when needed.
...
For synthesis we remove the output set of signals from the input set to
remove temporaries from the final sensitivity set. The @* construct also
uses the input sensitivity list, but because it can include statements
that cannot be synthesized we should not calculate the output set for this
case. Not find the output set is also a speed enhancement since the output
set was already being ignored later in the code for this case.
2013-10-26 15:34:07 -07:00
Cary R
7875880aa1
Add scope file/line information to the dump file
2013-10-25 15:10:44 -07:00
Cary R
383708fde8
Update FST files to latest from GTKWave
2013-10-25 15:07:00 -07:00
Cary R
4047ed7976
Add support for SV wait fork to the run time.
2013-10-22 16:00:29 -07:00
Cary R
3c7d7a7856
vlog95: Warn that array patterns cannot be converted.
2013-10-22 14:27:26 -07:00
Cary R
d7c2118d10
Fix space issue
2013-10-22 09:47:49 -07:00
Cary R
97d06b107f
Add support for wait fork to the compiler and code generators
2013-10-22 09:41:03 -07:00
Stephen Williams
61fbfb562e
Merge branch 'x-mil11'
2013-10-21 08:55:13 -07:00
Martin Whitaker
7e82a37fa3
Extend -gstrict-expr-width to cover unsized numbers.
...
To be strictly compliant with the standard and compatible with other
EDA tools, unsized numbers should be treated as having a fixed size
(the same size as an integer). The -gstrict-expr-width option is
extended to allow the user to enable this behaviour.
2013-10-20 23:16:11 +01:00
Martin Whitaker
141a23690e
Improved error message.
2013-10-20 23:01:26 +01:00
Martin Whitaker
a024efb615
Add -compatible command line option to vvp.
...
This option is intended to make it easier to compare results from
Icarus with results from other simulators. For now, the only effect
it has is to change the default format for displaying real numbers
when no format string is supplied.
2013-10-20 22:59:53 +01:00
Stephen Williams
e60804cf41
Handle initialized darray of strings
...
This includes adding support for returning strings from functions,
adding initializing new darray with array_pattern strings, and
assigning an array_pattern of strings to a preallocated darray.
Also fix up support for initializing array with simple string
expression.
2013-10-19 15:34:15 -07:00
Stephen Williams
d5a0f2fc07
Add support for simple expression in darray new initializer.
2013-10-19 15:34:15 -07:00
Stephen Williams
2464582587
Handle number literals as real-valued r-values.
2013-10-19 15:34:15 -07:00
Stephen Williams
82ebf6372c
Generate code to implement new element initializers.
2013-10-19 15:34:15 -07:00
Stephen Williams
3945b9df45
Elaborate darray new element initializer to ivl_target API
2013-10-19 15:34:15 -07:00
Stephen Williams
96813f76c1
Generate code to implement array_pattern assignment to darray
...
This implements the feature in the VVP code generator.
2013-10-19 15:34:14 -07:00
Stephen Williams
2030e06988
Parse/elaborate some array-patterns down to the ivl_target API.
2013-10-19 15:34:14 -07:00
Stephen Williams
cd85a42acc
Elaborate the null darray literal as a null expression.
...
This leads to the correct code being generated in the vvp
code generator.
2013-10-19 15:34:14 -07:00
Stephen Williams
18c338ad09
Handle array assignment patters through pform.
...
This gets us to elaboration. In the process also fix up ivl_type_t
type comparisons to do deep type comparison.
2013-10-19 15:34:14 -07:00
Stephen Williams
2355e1ed8e
Clean up some NetNet variable type handling.
2013-10-19 15:34:14 -07:00
Stephen Williams
5494c9ae09
Support DARRAY objects as port arguments.
2013-10-19 15:34:14 -07:00
Martin Whitaker
20ad1ff261
Fix zero/sign extension of parameter values in expressions.
...
For sized parameters, the choice of zero or sign extension should
be based on the expression type, not the parameter type.
2013-10-19 13:14:39 +01:00
Cary R
589bb59268
Implement %disable/fork in run time.
2013-10-18 17:22:10 -07:00
Cary R
e12d2b2f36
Explicitly instantiate coerce_to_width() for vvp_vector4_t
2013-10-18 14:38:38 -07:00
Cary R
c64b8900ca
Add support for disable fork to the compiler.
2013-10-17 19:34:57 -07:00
Cary R
1cd72d375c
Fix the label count for the join_any and join_none cases
2013-10-17 15:43:01 -07:00
Cary R
aa9a7435dd
Start of support for %disable/fork opcode.
2013-10-17 15:10:58 -07:00
Cary R
12c588fc35
Mostly fix a portability problem in $rtoi (run time)
2013-10-11 17:32:58 -07:00
Cary R
8f0687adb7
Fix white space issue.
2013-10-11 11:27:46 -07:00
Cary R
281556e93d
Fix another real to vpiIntVal conversion in the run time
2013-10-11 11:26:17 -07:00
Cary R
a196af8e15
Rework constant system function code and add $rtoi and $itor
2013-10-11 10:52:02 -07:00
Cary R
7b07fca285
Fix $rtoi to correctly convert NaN and +/- infinity
2013-10-11 10:49:45 -07:00
Cary R
095cedb305
Fix real to vpiIntVal conversion in run time
2013-10-11 10:49:28 -07:00
Cary R
d5823b3e55
update a copyright and fix the define order.
2013-10-07 16:51:48 -07:00
Jared Casper
51ca2d1243
Fix using array elements in expressions with an array element lval.
...
When you have an expression like this (extreme example):
a[idx[1]][idx[2]*4 +: 4] <= #(idx[3]) 4'ha;
where a is a reg array and idx is a reg or net array. The retrieval
of idx[2] was clobbering index register 3, which was set before
evaluating the part offset expression, then used in the %set/av of the
array value. (likewise for idx[1] and idx[3]])
To avoid this issue, this patch adds and uses a new instruction
%ix/mov which simply copies one indexed register to another. When
necessary, expressions are first evaluated into temporary registers to
avoid clobbering, then moved in to place before the %*/av instruction.
2013-10-07 16:47:50 -07:00
Jared Casper
ec8081f983
Handle ", \", and ` in macro definitions.
...
Implements page 644 of IEEE 1800-2012.
`` is now overloaded with the Icarus-specific "stringify" expansions.
It is now used as indicated in 1800-2012 when appearing inside a macro
definition, and the Icarus way when not. To do so, it uses the fact
that istack->file is NULL iff we are processing expanded macro text,
which is a bit of hack but works as is.
`" and `\`" on the other hand are treated the same inside and outside
of macro definitions.
2013-10-07 16:16:00 -07:00
Martin Whitaker
34643d9628
Fix for br937.
...
When writing a string value, vpi_put_value cannot assume the target vector
is a multiple of 8 bits wide.
2013-09-28 17:17:38 +01:00
Cary R
68db6c5a65
The seed passed to $random() should not change the implicit seed.
2013-09-23 17:44:13 -07:00
Cary R
d564e054e5
vlog95: translate most do/while loops
2013-09-23 17:31:39 -07:00
Cary R
8616e3d6fa
Fix space/tab problem.
2013-09-23 10:32:54 -07:00
Cary R
2c2ab24c8f
Fix problem when compiling with valgrind support
2013-09-23 10:29:45 -07:00
Stephen Williams
d025c8aa93
Non-method tasks/functions support default arguments.
2013-09-20 20:44:57 -07:00
Stephen Williams
7534abe325
Allow void functions to be called in functions.
2013-09-20 20:44:57 -07:00
Stephen Williams
7bc94d7810
Support functions that return void.
2013-09-20 20:44:57 -07:00
Stephen Williams
a9a1c50268
Support "this" for calling task methods.
2013-09-20 20:44:57 -07:00
Stephen Williams
5084a23417
Sorry messages for calls to superclass constructor.
2013-09-20 20:44:57 -07:00
Stephen Williams
46f551073e
Handle default expressions anywhere in port expression list.
2013-09-20 20:44:57 -07:00
Stephen Williams
d9e1bcf3d0
Handle task arguments with default expressions.
2013-09-20 20:44:57 -07:00
Stephen Williams
13bb927d8a
Handle strings as arguments to automatic functions.
2013-09-20 20:44:56 -07:00
Stephen Williams
16414f921f
Handle default arguments in class new functions.
2013-09-20 20:44:56 -07:00
Stephen Williams
9a116498a2
Handle task/function default expressions in parsing/pform.
...
This gets it to (but not through) the elaborator.
2013-09-20 20:44:56 -07:00
Cary R
d8f945be23
Add support for SV do/while
2013-09-16 20:02:09 -07:00
Stephen Williams
8412d0d55f
Automatic scope are OK in detached threads
...
...assuming certain conditions that should by definition be
true. So this patch amounts to improving an assert condition.
2013-09-09 19:47:22 -07:00
Cary R
07cc18284c
Fix print token/argument mismatches and other cppcheck fixes
2013-09-09 13:34:38 -07:00
Stephen Williams
7d6d93e4e2
Handle synthesis l-values that are part selects.
2013-09-08 18:18:31 -07:00
Stephen Williams
64b2345cf2
eval_as_long takes in const NetExpr arguments.
...
It is not the same as eval_tree, in particular it doesn't
rewrite the expression tree. So the NetExpr argument can
be constant.
2013-08-31 18:48:32 -07:00
Stephen Williams
9b3987bf3c
blif target supports wide LPM_PART_VP devices.
2013-08-31 16:43:37 -07:00
Stephen Williams
15cda5fef2
Fix subtle issues related to fork/join of tasks.
...
When a fork/join contains a task, the task completion may become
confused with the completion of another thread if any of the
threads are embedded in the main thread. So always create threads
for all the fork paths, and joins to match.
2013-08-29 20:31:26 -07:00
Stephen Williams
a10e07908e
Precompile vhdlpp/lexor_keyword.gperf in autoconf.sh
2013-08-28 14:53:29 -07:00