Commit Graph

6240 Commits

Author SHA1 Message Date
Stephen Williams e5f52320e6 Fix handling of bool(bit) vectors with odd widths. 2011-04-02 15:50:49 -07:00
Stephen Williams 5188fa4a69 Merge branch 'master' into work5 2011-04-02 10:37:24 -07:00
Pawel Szostek 9bdc040520 Add missing ``sorry'' messages in VHDL parsing 2011-04-02 09:30:36 -07:00
Pawel Szostek cef37e0a4b Add component specification parsing
A class for component specification has been added
2011-04-02 09:29:42 -07:00
Pawel Szostek 830b7cf122 Add basic instantiation list handling in VHDL
A class for representing instantiation list has
been added.
2011-04-02 09:27:58 -07:00
Pawel Szostek 2af35040cc Fix constructs sequence in bison file for VHDL 2011-04-02 09:24:34 -07:00
Pawel Szostek 26e6865bef Add entity aspects to VHDL parsing
Entity aspects are now recognized and parsed
into corresponding objects. A new class (entity_aspect)
has been added.
2011-04-01 17:03:45 -07:00
Stephen Williams 9fbcc895a8 Basic elaboration of vhdl component instantiations.
This gets us as far as emiting a component instantiation. Very little
error checking/elaboration is done, so there is room for improvement,
but this is a working stub.
2011-03-31 19:11:48 -07:00
Stephen Williams abb03632dd Basic elaboration of vhdl component instantiations.
This gets us as far as emiting a component instantiation. Very little
error checking/elaboration is done, so there is room for improvement,
but this is a working stub.
2011-03-31 19:07:43 -07:00
Pawel Szostek 37d6de344d Add use clause parsing
Up till now only "global" use clauses were parsed
and as a result libraries were loaded.

Since use clauses can appear not only in global context,
parsing of non-global clauses has been introduced and
selected names are now handled (like name1.name2.name3).
2011-03-31 18:57:25 -07:00
Stephen Williams f61428dc82 Basic elaboration of vhdl component instantiations.
This gets us as far as emiting a component instantiation. Very little
error checking/elaboration is done, so there is room for improvement,
but this is a working stub.
2011-03-31 18:50:48 -07:00
Stephen Williams 1688828b4d Merge branch 'master' into work5
Conflicts:
	vhdlpp/parse.y
2011-03-29 09:37:28 -07:00
Larry Doolittle 8a568055f6 Spelling fixes
All are in comments and .txt files except for one in the Architecture::Statement dump message.
2011-03-29 08:56:10 -07:00
Stephen Williams 162b26c101 Add more complete support for vhdl local signals.
These signals are declared in the architecture and are local to
the module. The Architecture already parsed and stored these signal
declarations, but this patch adds the ability to actually emit these
signals in the generated code.

In the process of doing this, I had to regularize the elaboration
and emit of VTypes, so that it can be used in multiple places, not
just in entity headers (for ports).

I also added support for bit selects of signals. This effected a couple
places in the parser, and expressions in general.
2011-03-28 14:34:02 -07:00
Pawel Szostek f057ce0859 Basic VHDL configuration parsing
The bison grammar has been extended in order
to parse configuration statements. Parsing
remains very primitive but principal constructs
can be now recognized.
2011-03-28 14:29:06 -07:00
Martin Whitaker 8c7365fb36 Fix for over-enthusiastic pruning of expressions.
The minimum width for expressions containing a literal number was
being incorrectly calculated, leading to loss of information in
some circumstances.
2011-03-28 14:26:00 -07:00
Jared Casper b6ff4039b1 SystemVerilog 'N bit vectors.
Adds a is_single_ flag to the verinum class to indicate it came from a
'N bit vector and needs to be handled accordingly.
2011-03-28 14:08:14 -07:00
Jared Casper 97d2389cb0 Allow SystemVerilog [size] dimension for unpacked arrays.
IEEE 1800-2005/9 says "each fixed-size dimension shall be represented by
an address range, such as [1:1024], or a single positive number to
specify the size of a fixed-size unpacked array, as in C. In other
words, [size] becomes the same as [0:size-1]."

This patch implements that translation in the parser.  It issues a
warning when doing so when the generation flag is less than 2005-sv.
2011-03-28 13:58:14 -07:00
Stephen Williams 799864eabf Add more complete support for vhdl local signals.
These signals are declared in the architecture and are local to
the module. The Architecture already parsed and stored these signal
declarations, but this patch adds the ability to actually emit these
signals in the generated code.

In the process of doing this, I had to regularize the elaboration
and emit of VTypes, so that it can be used in multiple places, not
just in entity headers (for ports).

I also added support for bit selects of signals. This effected a couple
places in the parser, and expressions in general.
2011-03-27 12:01:58 -07:00
Pawel Szostek ce5c263b4a Simplify entity parsing (removed the duplicate code) 2011-03-23 11:59:02 -07:00
Cary R 087f4794af vlog95: Print double values correctly and clean up string emitting.
This patch adds code to make sure a double (Verilog real) constant
is printed correctly. It also adds code to trim any leading escaped
NULLs from an expression string.
2011-03-23 11:56:45 -07:00
Cary R 085a5c8d02 Update the FST dumper to include the vpiDefName if it's unique.
This patch adds the vpiDefName for a module if it is different than
the vpiName. This will be used in a future version of GTKWave.
2011-03-23 11:55:34 -07:00
Pawel Szostek 13519ab5c7 Soft treating of multiple architectures in VHDL
In VHDL it is allowed to have multiple architectures
per one entity. The proper architecture should be then
chosen in a configuration block. Now, if many architectures
will be found, then there will be a warning message printed.
FIXME notes are added in order not to forget about changes to
be done
2011-03-23 11:45:33 -07:00
Cary R 48dc977630 vlog95: Add code to emit logicals that are the base of a CA as a CA.
This patch uses the new function (ivl_logic_is_cassign) to determine
if a logical was really the base of a continuous assignment. This
allows creating code that more closely matches the original.
2011-03-23 11:43:43 -07:00
Cary R eb0df40a73 Add a routine to say if a logical came from a CA and some other fixes.
This patch adds code that allows the targets to determine if a logical
gate came from a continuous assignment. This helps some of the targets
generate code that more closely matches the input.

It also reworks/simplifies the synthesis of && and || since the
compiler has already converted the two operands to single bit form
and fixes a mismatched delete from a previous patch.
2011-03-23 11:39:38 -07:00
Cary R ceaa79e95d vlog95: Add support for most unconnected ports and more signed support.
This patch adds support for correctly handling most unconnected ports.
Most important is top level ports that are the root of the conversion.

This patch also adds support for emitting more signed constructs when
they are requested. $signed() and $unsigned() are still not supported
or recognized as an error when not emitting signed constructs.
2011-03-23 11:38:05 -07:00
Cary R 042f405707 Change elaboration to better support top level and unconnected ports.
This patch changes the module elaboration slightly to allow passing
the appropriate information for unconnected and top level ports. This
allows the vlog95 generator to get the basic structure correct.
2011-03-23 11:36:38 -07:00
Jared Casper 5ba1814e64 Wildcard named port connections.
Implements Section 23.3.2.4 of IEEE 1800-2009.
2011-03-23 11:29:00 -07:00
Cary R ab265c6373 Make the >>> error message depend on the allow signed flag.
The >>> operator is also part of the allow signed extensions.
2011-03-23 11:26:37 -07:00
Stephen Williams 8580ceea4d Parse component declarations / parse signal declarations.
These go into the architecture/block of their scope and will be
used by component instantiations to make sure the bindings are
correct and complete.

Also handle signal declarations. The elaborator will use these
to generate module local variables that are used by the architecture.
2011-03-22 09:18:20 -07:00
Stephen Williams 89aa08e1aa Add parser support for architecture declaratives and component instantiations
Also include support for "sorry" messages so that we have a place
to hang unsupported but properly parsed constructs.

In the process of doing this, I also encountered and add parser support
for indexed names. And matching "sorry" messages.
2011-03-22 09:18:01 -07:00
Stephen Williams 2b7323f2c2 Support vhdl identifier lists in interface elements.
syntax like this is ok:

  name1, name1, name3 : in bit;
  name4 : out bit;

and so on.
2011-03-22 09:17:40 -07:00
Cary R cb3eb49584 Remove the last version.h references 2011-03-17 11:51:50 -07:00
Cary R a6267281d9 vlog95: Add a flag to allow signed.
This patch adds a flag -pallowsigned=1 to the vlog95 converter that
tells it to allow signed signals. There is currently no code to check
for and warn/emit the $signed() and $unsigned() system functions. I
need to determine if >>> emitting should also be controlled by the
allow signed flag.
2011-03-16 10:53:51 -07:00
Cary R c298939a88 Add #! support for MinGW since newer shells support this. 2011-03-15 18:56:10 -07:00
Stephen Williams 9330b58a3a Merge branch 'master' into work4
Conflicts:
	vhdlpp/lexor.lex
	vhdlpp/parse.y
	vhdlpp/vhdlint.cc
2011-03-14 17:34:57 -07:00
Cary R e375b26f78 vlog95: Add support for escaped ids and most module ports
This patch adds support for emitting escaped identifiers and adds
code to correctly emit most module port expressions/definitions.
There are some minor code optimizations/cleanup included as well.
2011-03-14 16:53:59 -07:00
Cary R 1fbe777c81 For an input report the expression is pruned vs padded.
There was a single message when the expression width was larger
than the port width. This patch makes it a bit more clear by
saying that the expression was pruned.
2011-03-14 16:48:49 -07:00
Cary R 2e0accf812 A '$' is also allowed in identifier names (dumpers)
Update the dumper escaped identifier check to allow a '$'
character after the first character in a normal identifier.
2011-03-14 16:47:22 -07:00
Martin Whitaker e01358babb Fix for pr3194155.
Currently the compiler coerces input ports to inout ports whenever
there is an internal driver connected to the internal port net.
This generates an error if the port is externally connected to
something other than a structural net. This patch modifies the
compiler to ensure port coercion only occurs in valid cases.
2011-03-14 16:42:45 -07:00
Martin Whitaker 2176212e2b Miscellaneous improvements and fixes to shift elaboration.
This patch ensures that the result of a shift is an undefined value
if the right operand is an undefined value. It also improves the
code generated for right shifts where the right operand is constant
and optimises away shifts where the right operand is a constant 0.
It also fixes a few places where the expression type (signed/unsigned)
was not being set correctly.
2011-03-14 16:37:40 -07:00
Cary R e80404a85f Fix 64 bit warning when using pointer as unsigned counter
The logic_lpm.c file uses the nexus private data pointer as an
unsigned counter. This patch makes the value unsigned long to
avoid a compilation warning on 64 bit systems.
2011-03-14 16:34:36 -07:00
Larry Doolittle e9fda22ad9 Spelling fixes
Mostly then/than confusion.  All comments or README files,
except for one user-visible change in a tgt-vlog95 error message.
2011-03-14 16:28:36 -07:00
Cary R 98f5ed2f85 Fix remaining space issues. 2011-03-14 16:26:31 -07:00
Cary R f13fabab71 vlog95: Add partial support for CA selects, emit for loop and other fixes.
This patch adds support for emitting fixed CA selects (zero based
variable bit and array selects also work), emitting a for statement
as a single statement and fixes for numerous little bugs. It also
adds the start of emitting module port information.
2011-03-08 19:20:23 -08:00
Cary R 1e3af45335 Pass some module port information and fix a few bugs.
This patch adds some preliminary module port information to the ivl
interface. This may change as I investigate exactly what is needed.
It also fixes a few minor bugs (a missed local variable and spacing)
2011-03-08 19:15:28 -08:00
Nick Gasson 7b82bd26f5 tgt-vhdl: Fix shift2 test regression
Caused by translate_select emitting a logical instead of arithmetic
shift for signed arguments.
2011-03-08 19:08:59 -08:00
Cary R 78f985af0e Add trace command to interactive prompt to control statement tracing.
This patch adds a trace command to the interactive prompt that can be
used to control statement tracing when the code is instrumented (has
%file_line opcodes).
2011-03-04 10:36:26 -08:00
Cary R b019c21f46 OpenSolaris portability/bug fixes.
A valarray of an enum does not initialize to 0 so explicitly specify the
value to fill the array with. This was causing the compiler to incorrectly
report that fixed width elements in a concatenation had no size.

The following was done to remove compiler warning when using the native
compiler on OpenSolaris.

Remove the anonymous unions in tgt-vlog95/stmt.c and tgt-vvp/vvp_process.c.

Use UINT_MAX for the maximum unsigned unsigned instead of -1 in
tgt-vvp/draw_net_input.c.

Even though lex defines yywrap() to have no arguments when %option
noyywrp is used it generates a define that takes an argument that is not
used. The compiler warned about this so remove the option and add a
dummy yywrap function.
2011-03-04 10:31:47 -08:00
Cary R 2a0d33608f Fix spacing problems.
This patch fixes spacing problems in the source code, space/tab at
the end of line and space before tab.
2011-03-03 11:21:31 -08:00