Commit Graph

6718 Commits

Author SHA1 Message Date
Stephen Williams a5458828cd Some vhdl parser error handling. 2012-05-22 17:31:26 -07:00
Stephen Williams 021d944a30 Probe type of ExpName with a record prefix. 2012-05-22 17:31:25 -07:00
Stephen Williams 7eb89c5548 Parse name prefix syntax for record member reference.
When signals/variables are records, they are often referenced by
their members, using a prefix.name syntax. Parse that syntax and
generate "sorry" messages in elaboration.
2012-05-22 17:31:25 -07:00
Stephen Williams 5e7f61ea42 VHDL process sensitivities go to the end of each iteration 2012-05-22 17:31:25 -07:00
Stephen Williams 78b0b49a4e Support struct members that are packed arrays. 2012-05-22 17:31:25 -07:00
Stephen Williams 9b816f6478 Add support for nested when/else expressions. 2012-05-22 17:31:25 -07:00
Stephen Williams 1249b5dd32 Initial support for if_generate syntax. 2012-05-22 17:31:25 -07:00
Stephen Williams 0775e36a67 Properly elaborate argument types for binary relation expressions.
The argument types of binary relation expressions are decoupled
from the return type for the expression itself.
2012-05-22 17:31:25 -07:00
Stephen Williams ed3da959f3 Support types in packages.
Types declared in packages should be written into the package library.
2012-05-22 17:31:25 -07:00
Stephen Williams 79435924f2 Move some VType::show methods to ::write_to_stream methods. 2012-05-22 17:31:25 -07:00
Stephen Williams 9ed56a6354 Parse record types, and some new aggregate types. 2012-05-22 17:31:25 -07:00
Martin Whitaker f7ba954ef7 Fix for pr3527022.
This patch adds support for an explicit range or type in a parameter
declaration that is part of a module parameter port list.
2012-05-18 13:30:28 -07:00
Stephen Williams 2d0c786bfb Remove excess evaluate_parameters method calls. 2012-05-18 08:07:27 -07:00
Larry Doolittle 84f14dbc81 Spelling fixes to vhdlpp tree
Mostly comments as usual, but one error message is changed.
2012-05-17 16:42:03 -07:00
Martin Whitaker 509ec1dcb1 Simplify parameter handling in the elaborated netlist.
A NetScope object currently has two lists of parameters, 'parameters'
and 'localparams'. However, user-declared localparams are stored in
the 'parameters' list, and 'localparams' is only used for adding
genvar values to the parameter list. There seems no good reason to
maintain separate lists, as the lists are merged before being passed
to the target DLL. This is most likely a hang-over from older code.
2012-05-17 16:29:06 -07:00
Martin Whitaker 5cbdac2a46 Add missing semi-colons in main compiler parse.y
This fixes some warnings from Bison.
2012-05-17 16:25:28 -07:00
Martin Whitaker 44c5a37ab8 Allow specparam declarations outside specify blocks.
This patch extends the compiler to support all specparam declarations
allowed by the 1364-2005 standard. For compatibility with other
simulators, it allows specparam values to be used in any constant
expression, but outputs a warning message and disables run-time
annotation of a specparam if it is used in an expression that must
be evaluated at compile time.
2012-05-17 16:18:38 -07:00
Stephen Williams e5f84002b1 Merge branch 'master' of github.com:steveicarus/iverilog 2012-05-13 18:32:55 -07:00
Stephen Williams 5d05d97eb0 Repair handling of attributes attached to variables. 2012-05-09 10:56:52 -07:00
Stephen Williams c3f25c3c6c Prepare for 2012-05-01 snapshot 2012-05-01 08:50:07 -07:00
Stephen Williams 2013addd22 Fix check for SV continuous assign to variable.
SystemVerilog allows a variable to be used as a variable OR
as an unresolved wire. The detection of this case was checking
the references to the affected value, instead of the l-value
references.
(cherry picked from commit cceeaa30f27260cd444015cb39b04353cb858768)
2012-04-30 17:04:45 -07:00
Martin Whitaker 75b12151a4 Disable width minimisation of literal numbers passed to system tasks.
The final step of expression elaboration is to reduce the width of
lossless/unsized constant expressions to the minimum needed to hold
the resulting constant value. This leads to unexpected results if
the user supplies a literal number with redundant digits that gets
passed to a system task that is sensitive to the width (e.g. $display).
This patch prevents width reduction occurring in this case.
2012-04-30 16:39:30 -07:00
Stephen Williams fb3969b5b8 Add command line control over anachronism warnings. 2012-04-30 16:30:24 -07:00
Stephen Williams 69c10c4722 Handle case generate under a conditional generate that is unnamed.
When a conditional statement is unnamed, it doesn't create a scope
and we get into "direct" generate scheme elaboration. This direct
elaboration needs to handle case generate schemes.
2012-04-30 16:00:25 -07:00
Stephen Williams 8ea1e49768 Improve net bit select calculations. 2012-04-30 11:48:33 -07:00
Stephen Williams abf8274e4b Fixup parse of attributes attached to statements. 2012-04-27 18:22:25 -07:00
Gordon McGregor ae901f3285 adding vpi_mode_flag controls around callbacks in vpiNextSimTime 2012-04-27 17:24:13 -07:00
Martin Whitaker 39ee49b252 Improved behaviour of tranif when control is 'x' or 'z'.
The IEEE standard does not specify the behaviour of a tranif primitive
when its control input is an 'x' or 'z'. vvp currently treats these as
if the tran was turned off, but it would be better to propagate the
uncertainty to the tran bi-directional ports. For compatibility with
other simulators, we adopt the behaviour specified for MOS primitives.
2012-04-27 17:08:38 -07:00
Stephen Williams f926cbcc59 Merge branch 'master' of github.com:steveicarus/iverilog 2012-04-26 09:03:20 -07:00
Cary R 568db8c06e Merge branch 'master' of github.com:steveicarus/iverilog 2012-04-11 09:13:36 -07:00
Cary R 761a38d0a8 Spelling fix 2012-04-11 09:13:14 -07:00
Stephen Williams e55af496e5 Merge branch 'master' of github.com:steveicarus/iverilog 2012-04-10 15:31:32 -07:00
Stephen Williams 13348ba7ac Ranges are ranges, not expression lists.
This is a cleanup in preparation for better support of range lists.
(cherry picked from commit 8f7cf3255acad55841f8b3725e3786ef49daad68)

Conflicts:

	PTask.h
	elab_scope.cc
	elab_sig.cc
	parse.y
	pform.cc
	pform.h
	pform_types.h

Signed-off-by: Stephen Williams <steve@icarus.com>
2012-04-10 14:29:28 -07:00
Larry Doolittle bb1036b55c Spelling refresh 2012-04-09 16:19:02 -07:00
Cary R 2b5c82d141 SystemVerilog unbased literals cannot take a size.
The SystemVerilog unbased literals (e.g. '0, '1, etc.) are expected to be
used standalone and cannot take a size. This patch modifies the parsing
code to give a good error message when this is done.
2012-04-09 16:01:25 -07:00
Stephen Williams cf0b45702f Merge branch 'master' of github.com:steveicarus/iverilog 2012-04-03 07:57:02 -07:00
Cary R 42239a8498 Add code to test the width of individual structure elements.
This patch adds code to correctly set the type and width of individual
structure elements. Note the sign information is not currently available.
2012-04-02 19:53:47 -07:00
Stephen Williams 09493a198f Merge branch 'master' of github.com:steveicarus/iverilog 2012-04-02 19:22:40 -07:00
Stephen Williams 3657b15428 Merge branch 'x-ms1' 2012-04-02 19:22:31 -07:00
Cary R c222169608 Update vecval size calculation in vvp and vpi code.
The standard specifies that the size of a vecval should be calculated as
(size - 1)/32 + 1. When size is a PLI_INT32 this is needed to prevent an
overflow, but when the size is unsigned this can be simplified to
(size + 31)/32 since the size must fit into an integer, but we have an
extra significant bit in an unsigned so no overflow can happen.

This patch changes the code to use the correct version of the equation
depending on the context.

The previous patch does this in vvp/vpi_priv.cc
2012-04-02 08:18:46 -07:00
Cary R b85e7efca8 For a delayed vpi_put_value() copy any pointer data members.
When vpi_put_value() is asked to delay the assignment any pointer data
needs to be duplicated so that the caller can clean up the locally
allocated memory without causing memory access problems.

Also update word calculation to match the next patch.
2012-04-02 08:18:32 -07:00
Martin Whitaker 327194cd40 Fix for pr3499807.
If a tranif gate has a delay, the vvp code generator needs to generate
a unique label for the island port used for the tranif enable, to
prevent a name collision if the undelayed signal is also connected
to the island.

Also add an assertion in vvp to catch bugs like this.
2012-03-12 09:03:53 -07:00
Stephen Williams 5dbe688296 Allow variable initialization in any scope.
This is a SystemVerilog feature, so only allow it when
compiling SystemVerilog files.
2012-03-11 15:08:42 -07:00
Stephen Williams b0d61813b2 Get the scope of class methods right
Class methods belong in a class scope, not the containing module.
So create a lexical scope that carries tasks and functions and
create a PClass to represent classes.
2012-03-11 13:18:24 -07:00
Stephen Williams b80afdf1f1 SystemVerilog randomize method syntax. 2012-03-10 10:27:02 -08:00
Stephen Williams dbc6f0cff2 Parse SystemVerilog syntax for task calls.
Tasks call arguments may be dropped in favor of default values.
Allow for that in the syntax. This requires a little handling
of the non-SystemVerilog case during elaboration.
2012-03-10 09:50:41 -08:00
Stephen Williams da743c3b2c Bunches more SystemVerilog syntax. 2012-03-09 18:54:05 -08:00
Stephen Williams 8c2e4a0892 Support tasks with no behavioral statements (System Verilog) 2012-03-04 20:04:07 -08:00
Stephen Williams 0e01dcf2b9 Miscellaneous SystemVerilog syntax.
... and sorry messages.
2012-03-04 19:33:16 -08:00
Stephen Williams 31d4aa9a77 Handle complexities of class name pre-declarations
Class names can be declared early, before definitions, so that the
name can be used as a type name. This thus allows class definitions
to be separate from the declaration. This creates some complexity in
the parser, since the lexor knows about the class names.
2012-03-02 21:16:53 -08:00