Commit Graph

699 Commits

Author SHA1 Message Date
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 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
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 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 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 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 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 befc91340c Parse and elaborate unique and priority case statements
The unique, unique0, and priority keywords can decorate case statements
to tell the run time (or synthesis) to do extra tests (or make extra
assumptions). These tests are not implemented in the vvp run time, but
now the decorations make it to the code generators.
2019-10-05 16:23:04 -07:00
Martin Whitaker f69eccf903 Merge remote-tracking branch 'origin/master' into package-imports-rework 2019-10-01 09:06:15 +01:00
Cary R ba82ef463e Fix some always_* issues 2019-09-29 16:59:59 -07:00
Martin Whitaker 55219773fd Allow nested scopes to use their parent's imports. 2019-09-27 22:19:30 +01: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 932241ee87 Check system/user tasks for always_comb/ff/latch synth. 2017-12-27 23:08:32 -08:00
Cary R 2bbd077dc9 Add some synthesis checks for the always_comb/ff/latch blocks 2017-12-27 14:51:17 -08:00
Cary R f17992bcd0 Report the lines that have delay or event control in an always_comb/ff/latch process 2017-12-06 00:22:43 -08:00
Cary R cb0ffd734e Check to see that always_comb/ff/latch do not have delays/events 2017-12-05 22:10:43 -08:00
Cary R 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 3fc9ad2db0 Add support for the wild compare operators ==? and !=? 2017-11-17 19:32: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 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
Cary R 7d78f5b2ea A few updates based on cppcheck results 2017-10-23 00:22:01 -07: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
Michele Castellana 9ad46044b4 Cleanup 2016-06-30 17:47:34 +02:00
Larry Doolittle 89edf62206 Capitalize Verilog in a few places 2016-04-01 11:02:24 -07:00
Martin Whitaker 635adfc01e Fully support variable initialization in tasks/functions/named blocks. 2016-03-19 13:04:38 +00: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
Johann Klammer c92b630728 NetLatch class 2016-03-11 23:11:54 +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 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 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
Martin Whitaker f3cf7ca546 Updated comments for synthesis. 2016-02-21 22:39:52 +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
Christian Taedcke 6d5aabd4f0 Make a few constructors explicit.
This removes cppcheck warnings.
2015-10-22 12:33:33 +02:00
Stephen Williams 64b72cf7e1 Clean up MCS/GNU portability hacks in header files. 2015-07-23 17:35:31 -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
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
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
Larry Doolittle 2739f83702 Spelling fixes in C and C++ comments 2015-06-04 15:00:29 -07: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 35db02d35d elaborate dump cast operators. 2014-12-02 16:50:42 -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
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
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
Stephen Williams 712f394224 Elaborate classes in packages. 2014-10-10 18:53:53 -07:00