Commit Graph

6240 Commits

Author SHA1 Message Date
Cary R 68b1273d2d The SDF timing spec list can have zero or more elements.
The SDF file format supports zero or more timing specs. Previously
the parser was one or more. Things like tie high/low cells do not
have any delay information so zero or more is needed and matches
the standard.
2010-03-30 11:20:08 -07:00
Cary R cbce1ddc04 Fix line number error with to end of line comments.
The single line comment "//" was getting double counted.
2010-03-30 11:19:56 -07:00
Cary R 74c20eccf6 Make sure the modpath source has the same scope as the modpath.
When building a modpath the source for the modpath must have the
same scope as the modpath. This is required to make the back
annotation work correctly (have the correct names).
2010-03-30 11:12:32 -07:00
Cary R 99eac44ad1 Use WIN32 instead of CYGWIN in tgt-null 2010-03-25 12:38:54 -07:00
Cary R c7e6de6fa4 vlog95 - Add output file code and basic header. 2010-03-25 12:32:02 -07:00
Cary R 96dab230f6 Start adding vlog95 (1364-1995) back end.
This is the initial commit in an effort to build a 1364-1995
back end for Icarus Verilog. It is expected that this back end
will allow the user to write 1364-2005 RTL and then using this
back end (converter) generate functionally equivalent 1364-1995
compatible code. This can be used to support older tools in a
work flow. The primary focus will be simulation equivalence,
though I expect to verify logical equivalence as well.
2010-03-25 12:31:51 -07:00
Cary R 8e69764834 Perform bit <-> real conversions for module inputs.
This patch makes the compiler perform either bit to real or
real to bit conversion when needed on module input signals.
2010-03-25 12:26:24 -07:00
Cary R bc7a5a9725 vpi_get_value should return an appropriate value during compiletf.
The vpi_get_value() function should not crash when called during
the compiletf phase. This patch fixes this by returning 'bx for
any vectors in thread space. It also fixes some other minor things
that my test code uncovered. Most of the other objects work as
expected.
2010-03-23 16:34:38 -07:00
Cary R 9a94d55738 Ignore zero replication constants.
This patch enhances elaboration to drop/ignore zero replication
count constants. Not doing this was causing problems later in
the compiler. We still pass non-constant expressions since
both user and system functions must be run for their possible
side effects. Constants can never have a side effect so just
dropping them is acceptable.
2010-03-22 18:02:28 -07:00
Cary R 6a7675c812 Add support to $sdf_annotate for RECREM and optional rtriple values
This patch adds support to $sdf_annotate to ignore RECREM constructs
in the SDF file. It also adds the ability to not specify all the
values in a rtriple (e.g. 1.1::1.6).
2010-03-22 17:58:08 -07:00
Cary R 47f1286819 Add support to select min/typ/max delays from the SDF file.
This patch adds support to select either the min, typ or max
delay depending on what was used by the compiler.
2010-03-22 17:54:09 -07:00
Cary R 1a915005c4 Fix memory leak in vvp delay selection code.
The min/typ/max delay selection code had a memory leak.
2010-03-17 17:40:01 -07:00
Cary R 2a463f00b3 Fix space issues. 2010-03-17 17:37:49 -07:00
Cary R 440cbba1d6 Add scope information for named blocks (begin/fork).
This patch adds the appropriate scope changes to get the scope
information correct for named blocks.
2010-03-17 17:30:31 -07:00
Cary R 8872bbf9b3 Fix optimization dependent bug. 2010-03-17 17:28:32 -07:00
Cary R 07bedc4e35 Add support for passing the delay selection to the VPI interface.
This patch adds support for passing the delay selection to the
VPI interface. It adds a new property to both the vpi_get and
vpi_get_str calls to return the current delay selection. It also
defines three constants for minimum, typical and maximum
delay selections.
2010-03-16 15:43:14 -07:00
Cary R e241586bcf Add support for passing the delay selection to vvp.
This patch adds support for passing the delay selection to vvp.
It adds a new header :ivl_delay_selection "<value>"; that has
the values TYPICAL, MINIMUM or MAXIMUM depending on the -T
flag to iverilog. This information is needed by $sdf_annotate
to select that appropriate value for a triplet when
"TOOL_CONTROL" is specified (default).
2010-03-16 15:43:06 -07:00
Cary R 9cbb9251b4 Fix trailing garbage in previous patch . 2010-03-16 15:40:02 -07:00
Cary R d5c10af4f4 NB-assign needs to convert reals at the l-value width.
This patch mimics what was done for normal assignments to get the
width correct for nonblocking assignments when converting a real
r-value to a l-value vector.
2010-03-16 15:39:57 -07:00
Cary R 15a657c83b Clean up the $fatal compiletf and calltf routines
Some cleanup of the compiletf routine for $fatal and the same
for the calltf routine that is used by $fatal, $error,
$warning and $info.
2010-03-16 15:35:55 -07:00
Cary R 4af24b6b9e Make taking an edge of a named event an error.
A named event does not have an edge so taking a posedge or negedge
is illegal. This patch adds an error message for this. Before the
edge was being ignored for named events, but this is incompatible
with other tools.
2010-03-16 15:27:46 -07:00
Stephen Williams 79f8b8fcfd Remove Link::strength_t and PGate::strength_t types.
These types are useless repetition of the ivl_drive_t type.
This is also another chapter in the series to push ivl_target
generation further upstream.
2010-03-16 15:16:53 -07:00
Stephen Williams 261cfd1dae Implement recv_vec8_pv method in island ports.
Islands are vec8 devices, so we certainly need the recv_vec8_pv
method implemented in island_port classes.
2010-03-16 14:26:44 -07:00
Stephen Williams bf4e7454eb Account for output drive of LPM mux devices.
LPM devices, and LPM MUX devices in particular, need to
have their drive strength accounted for.
2010-03-16 14:25:00 -07:00
Stephen Williams 47e68e21b1 Detect generate regions within generate schemes.
Generate schemes may nest freely, but generate regions
(an anachronistic concept from 1364-2001) cannot nest,
not within schemes or other regions. Have the parser detect
the nesting and print an error message.
2010-03-11 16:06:02 -08:00
Stephen Williams 70fc742c9d Add support for primitive types of ports.
The infrastructure is already there, all that's missing is the
syntax in the parser.
2010-03-11 12:22:41 -08:00
Stephen Williams fe5c8f5e82 Merge branch 'master' of ssh://icarus.com/~steve-icarus/git/verilog 2010-03-10 20:37:16 -08:00
Stephen Williams babfd72074 Fix anyedge to not trigger on time-0 input of 'bx.
This assumes that an input is initially 'bx, so a time-0 input
of X need not trigger events.
2010-03-09 18:22:31 -08:00
Jared Casper 3a4fac7b43 Move $fatal argument value check from compiletf to calltf.
Move check of the value $fatal is called with from the compiletf to
the calltf routine, since the value may not be known at compiletf
time.  If the value is invalid, it just prints a warning that $fatal
was called with a bad finish_number, and resets it to the default 1.

Changes the compile time check for a numeric argument to a warning.

Also, fixes bug where $fatal called without an argument causes problems.
2010-03-09 17:21:21 -08:00
Cary R 316006b98b Fix Cygwin/MinGW compilation
This patch adds the missing ivl_expr_sized call to ivl.def which is
needed to compile under either Cuygwin or MinGW.
2010-03-08 14:59:47 -08:00
Stephen Williams dcc759d417 Merge branch 'master' of ssh://icarus.com/~steve-icarus/git/verilog 2010-03-06 16:21:29 -08:00
Stephen Williams 3927917133 Handle selects unsized literal values accounting for bit extension.
When selecting bits from unsized literals, we do not put a limit
on the size of the literal, so there is no top above which we
stop getting literal bits.
2010-03-06 16:21:10 -08:00
Stephen Williams 72b4332b02 Fix negative shift of signed right shift.
Negative shift amounts can happen for right shifts in
certain specialized cases, and that needs to be handled.
2010-03-06 16:06:03 -08:00
Stephen Williams 33e52c50c0 Handle special case bit selects if unsized 0/-1.
Unsized constant 0 and -1 are pretty special, and part selects
of these values can be handled very specially.
2010-03-05 19:36:54 -08:00
Cary R 08d0337e50 Add missing strtoul argument
The previous patch missed this some how. I don't know how it compiled
correctly before!
2010-03-05 16:35:14 -08:00
Cary R df7d65f4d6 Ignore bit selects in SDF INTERCONNECT lines.
Icarus does not support interconnect delays so INTERCONNECT is
currently ignored. The SDF parser does not currently support a
bit select as a port_instance. Since we are already ignoring
the INTERCONNECT I added support for bit selects there. This
is probably the most common place to find them.
2010-03-05 16:35:08 -08:00
Jared Casper be67199177 Allow connecting module instance using implicit named port connections.
This is part of the 1800-2009 standard (Section 23.3.2.3) and allows
ports of module instances to be declared like:

modname instance(.foo, .bar);

instead of

modname instead(.foo(foo), .bar(bar));

The only tricky part about this is the implicit port connection shall
not create an implicit net declaration.  To make this happen, the path
of least resistance was to add a bool to PEIdent indicating that it
should not implicitely create a net.

This does not rely on the generation flag to be 2009, following the
trend that new port naming convention (like ANSI style ports) work
regardless of the generation.
2010-03-05 16:29:55 -08:00
Jared Casper 12ddc34277 Implement severity system tasks $fatal, $error, $warning, and $info. 2010-03-05 16:20:51 -08:00
Jared Casper 248fb32b9a Adding ability for generation to be 2009.
Added generation flag -g2009 which enables support for 1800-2009
constructs.  Added related support such as "1800-2009" in the
`begin_keywords directive.

Keeps 2005 as the default generation for now.

Removed the -gsytem-verilog flag and folded the 1800-2005 stuff into
1800-2009.  The rationale behind this is we have so little of
1800-2005 actually implemented that it does not make sense to
distinguish between 1800-2005 and 1800-2009 SystemVerilog extensions,
so we just count them all as the new 1800-2009 Verilog language.
2010-03-05 16:09:04 -08:00
Stephen Williams b48b833dab Minor fixes to README.txt file. 2010-03-04 18:08:45 -08:00
Martin Whitaker 4818db887e Fix for LXT/LXT2 output using MinGW.
When using MinGW, routines registered via atexit() inside a
DLL are only called when the DLL is detached. If not detached
manually, DLLs are automatically detached *after* all remaining
open files are closed. This meant that by the time the LXT or
LXT2 close_dumpfile routine was called, the dump file handle
was no longer valid, so any remaining output was lost. This
patch fixes the problem by manually detaching the VPI modules.
2010-02-08 21:07:45 -08:00
Stephen Williams fad5e362ce Add yet more key characters to the gperf command.
The last patch to add key charasters apparently wasn't enough
for gperf 2.7.
2010-02-05 23:09:39 -08:00
Cary R 09a7c63692 Fix autoconf.sh gperf key flags
When I added the SV/Verilog-AMS keywords I forgot to update the
gperf keys in autoconf.sh. This patch makes them match the Makefile.
2010-02-05 22:35:08 -08:00
Stephen Williams 8d65d0735a Fix broken $() substitution in command files. 2010-02-04 16:07:27 -08:00
Cary R b1dc84ccd1 Fix release of variables.
This patch fixes the release of varaibles to work correctly.
2010-02-01 11:51:51 -08:00
Cary R fefc195540 Fix MinGW compile warnings.
This patch fixes a few compile warnings found with the latest
MinGW compiler.
2010-02-01 11:45:32 -08:00
Cary R 7866e92761 Fix an obscure memory leak and fix formatting.
This patch fixes an obscure memory leak and make the formatting
of these two routines match the rest of the code in the file.
2010-01-23 09:44:13 -08:00
Cary R 634d47bfe8 Add all the Verilog-AMS 2.3.1 keywords.
Like I did for SystemVerilog the other day this patch adds all the
Verilog-AMS 2.3.1 keywords. This necessitated adding one my byte
to the gperf -k argument (byte 9) to make the laplace_?? tokens
have a unique hash.
2010-01-23 09:40:56 -08:00
Cary R 511a274b41 Add all the SystemVerilog (1800-2005) keywords.
This patch adds the SystemVerilog keywords to Icarus. This allows
use to easily verify that out plain Verilog does not contain any
SystemVerilog keywords. The keywords are not parsed in any way.
When parsing a Verilog file using -gsystem-verilog any identifier
that is a keyword will cause a parse error. It is the users
responsibility to figure out the problem since bison does not
give nice error message when it finds a keyword instead of an
identifier.
2010-01-23 09:35:07 -08:00
Martin Whitaker 14b2037ce4 Fix for pr2922063.
When handling the $signed/$unsigned system functions, the compiler
was applying the new signed/unsigned property to the NetExpr object
representing the input argument. This caused the input argument to
be evaluated incorrectly. This patch fixes this by applying the new
property to the NetExpr object created to pad the result to the
required size.

In testing this fix, it was also discovered that the width of the
input argument expression was not being calculated correctly. This
patch also fixes this issue.
2010-01-23 09:29:40 -08:00