Commit Graph

59 Commits

Author SHA1 Message Date
Cary R 11f4e71dd0 Fix the vlog95 -> and <-> expression code for wide results 2020-12-01 00:04:00 -08: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 39238fd1cd vlog95 target: ! operator does not require explicit type conversion. 2019-11-09 16:52:28 +00:00
Martin Whitaker f1608e163f Fix implicit fallthrough warnings when building with recent GCC. 2018-10-06 20:15:42 +01:00
Cary R 3fc9ad2db0 Add support for the wild compare operators ==? and !=? 2017-11-17 19:32:50 -08:00
Cary R 4fb91ec7c7 vlog95: Add SV queue specific error message and code generation. 2014-08-25 16:41:08 -07:00
Larry Doolittle ae6743cf69 Easy changes for -Wmissing-prototypes 2014-07-10 14:07:30 -07:00
Cary R 774d173d69 Remove missing parameter warnings 2014-07-09 14:16:57 -07:00
Cary R 8f7277a5ab Remove the unused parameter warnings in tgt-vlog 2014-07-09 09:34:44 -07: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
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 3c7d7a7856 vlog95: Warn that array patterns cannot be converted. 2013-10-22 14:27:26 -07:00
Cary R f3917778bc vlog95: Add some support for $signed()/$unsigned() in a CA 2013-07-29 10:26:56 -07:00
Cary R 817a38494c vlog95: add support for zero argument functions and better named block detect
Add support for translating a zero argument function by adding a dummy
argument and improve the code that looks for a named block in a process.
2013-07-24 19:41:59 -07:00
Cary R 8b7dde0e41 vlog95: improve parameter select warning. 2013-07-18 17:44:45 -07:00
Cary R 3e76f6d656 vlog95: more procedural $signed()/$unsigned() support
Add support for detecting when to add a $signed() or $unsigned() to
create a self-determined context. This makes the test in the test suite
pass, but there could still be issues
2013-07-09 17:55:21 -07:00
Cary R 91ad8a72c6 vlog95: Keep the scaling for a variable parameter indexed part select
The select expression scaling needs to be kept for a variable indexed
part select of a parameter since parameters are zero based in 1364-1995.
2013-07-05 17:23:28 -07:00
Cary R e2361fab29 vlog95: Better unsupported select warnings and variable parameter bit select
Since parameters are now passed by reference use that information to print
the parameter name in a select vs trying to figure it out by searching the
scope looking for a parameter with the same file, line and value information.

Only print the $signed() may need to be removed messages for a select
expression that will actually be cast to signed.

Use the actual parameter information to warn that -pallowsigned=1 is needed
for a parameter when the LSB > MSB.
2013-07-05 16:31:05 -07:00
Cary R cbd1b948a2 vlog95: emit an entire parameter reference by name instead of value. 2013-07-05 10:35:31 -07:00
Cary R fcbb41c391 vlog95: Get sign info correct for procedural power to shift conversion 2013-07-04 14:33:39 -07:00
Cary R 633360a0f9 vlog95: More procedural $signed/$unsigned support/cleanup 2013-06-28 14:16:10 -07:00
Cary R eecc3312b7 vlog95: Add $signed/$unsigned support for signals
The actual signal code is trivial, but the emit expression code needed
to be enhanced to pass a flag that says if one of the arguments in a
binary (except the shifts) or ternary (excluding the condition) context
is unsigned. This information is used to prevent emitting an explicit
$unsigned() for a signal that is used in this context since it will be
implicitly cast to unsigned.
2013-06-27 13:31:40 -07:00
Cary R f631cb6314 Add some support for procedural $signed/$unsigned.
This patch adds support for finding and adding $signed() and $unsigned()
to procedural expressions for the binary, unary and concatenation
operators. Selects have partial support. The select implementation
uncovered limitations in the compiler that need to be fixed before they
will work 100%. Most of the limitations currently generate a message
about the issue.
2013-06-26 21:46:02 -07:00
Cary R 431d62185b vlog95: Emit a new doing a shallow copy as an error. 2013-04-30 11:52:52 -07:00
Cary R 2e86c208d1 vlog95: Add support for variable packed array accesses 2013-02-20 22:10:00 -08:00
Cary R 27b8738d06 vlog95: convert real Verilog-A abs/min/max to $abs/$min/$max
Converting these Verilog-A functions to use the $ version allows nan
to be handled correct. This still needs to be done for the LPM code.
2013-02-19 20:05:34 -08:00
Cary R 8b4dc05ff8 vlog95: for a part/pv look for the strength at the driver
A part/pv passes strength information so we need to use the real driver
to get the appropriate drive information.
2013-02-12 19:38:28 -08:00
Cary R 41c7aa9e83 vlog95: translate darray and class assignments/references
These are not supported in vlog95, but they are easy to translate into
something that looks correct.
2013-02-08 19:16:24 -08:00
Cary R 5abd939655 vlog95: fix bug in min/max translation code 2013-02-08 11:18:49 -08:00
Cary R 06ce23d9c2 vlog95: Add support for Verilog-A abs(), min(), max() and some SV types.
The Verilog-A abs(), min() and max() functions can be converted if the
expressions do not have side effects. Also note the new, null and class
property operators from SystemVerilog are not supported.
2013-02-07 19:53:10 -08:00
Cary R a581e0ef0e vlog95: Report zero argument functions are not supported. 2013-02-07 17:08:59 -08:00
Cary R 331c9ef64a Fix mistake in post incr/decr warning messages. 2012-08-07 16:22:29 -07:00
Cary R 7179274bde vlog95: Add support for some more SV constructs and add some sorry messages
This patch adds support for SystemVerilog packed arrays and adds sorry
messages for generate blocks as well as the new SV final and
fork/join_any/join_none statements.
2012-08-06 10:16:35 -07:00
Cary R dab982f39b vlog95: Major rework of nexus emitting code, etc.
Rework the nexus emitting code to correctly translate most I/O ports.
Fix a few other expression issues uncovered when port translation was
done correctly. Ignore and warn that the SV ++/-- operators and enum
types are not translatable. More updates of the nexus debug code.
2012-01-02 11:29:42 -08:00
Prasad Joshi 6a40d9edaa Change the net expression cast from 'i' to 'v'
Icarus uses 'i' in the net expressions for a cast to integer. Replacing
it with 'v' would free the character 'i' that can be used for increment
operators. This changes cast operators to become 'v', '2', and 'r'.

Signed-off-by: Prasad Joshi <prasad@canopusconsultancy.com>
Suggested-by: Cary R. <cygcary@yahoo.com>
2011-08-07 11:40:34 -07:00
Cary R 8b8e181fe2 vlog95: Print structural string constants and a few other fixes
This patch adds the ability to print a constant string in a
structural context. It also fixes the argument order for
structural function calls and makes a few improvements in
nexus identification.
2011-04-20 17:50:41 -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 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
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 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 2df6850824 vlog95: A parameter in 1364-1995 is always zero based.
The 1364-1995 version of Verilog does not support non zero based
parameters. This patch removes the comment requesting the parameter
MSB/LSB information to denormalize the expression and replaces it
with one stating that we need to keep the compiler normalization.
2011-02-28 19:35:01 -08:00
Cary R b95e46e621 vlog95: Add more procedural variable indexed part select code
This patch adds the rest of the functionality needed to correctly
emit both L-value and R-value procedural variable indexed part
selects as a concatenation of variable bit selects.
2011-02-28 19:19:27 -08:00
Cary R 757611b8e9 vlog95: Add partial support for procedural variable indexed part selects.
This patch adds partial support of procedural variable indexed part
selects (both R and L-value). The restriction is that this currently
only works on a zero based little endian vector. I need to know if
the select is an up or down select to correctly denormalize the base
expression for the general case.
2011-02-28 18:37:01 -08:00
Cary R df85a33583 vlog95: Rework some of the delay emitting code and enclose unary in ()
This patch reworks the delay emitting code to handle delay expressions
better. It also encloses the emitted unary operators in parenthesis to
make sequenced unary operators work properly.
2011-02-28 18:31:03 -08:00
Cary R 28c10311f6 vlog95: Rework delayx to handle a CA vs using emit_expr_signal().
It was incorrect to extend emit_expr_signal() to handle a local signal
(a continuous assignment). The only way this should ever happen is
when evaluating a variable delay expression. It is better to do this
checking in the delayx evaluation where we know if we are processing
a delay for a statement or a continuous assignment. This keeps the
emit_expr_signal() routine cleaner and we only allow a CA delay for
a continuous assignment.
2011-02-28 18:29:38 -08:00
Cary R 88cec4d6f6 vlog95: Fix pull gate bug, emit local expr sigs as CA, etc.
This patch fixes the following bugs in the vlog95 converter:

When emitting a signal as an expression, if the signal is local then
emit the expression that is driving the local signal.

The casts need to emit the expression.

When emitting pull devices they have different default strength rules
(pull is the default).

For compatibility pull devices should only have a single output net.

Extend the code that searches for the <var> = <delay> <value> pattern
to also check for an <event>. The previous event code only looks for
the repeat event pattern.
2011-02-28 18:28:21 -08:00
Cary R 131a3d81d8 vlog95: Add the ability to recreate most variable parameter selects
This patch adds code that when it find a select of a constant it looks
for a parameter in the enclosing scope and the module scope that has
the same line, file and value information. If it find one that is
used to rebuild the expression. A more exhaustive search is need to
make this 100% clean.

It also uses the named scope when emitting statement inside a named
begin or fork instead of the enclosing scope.
2011-02-10 19:02:38 -08:00
Cary R 05a00ff631 vlog95: Convert compiler translation back to wait and strength fixes.
This patch adds the ability to translate the code produced by the
compiler for a wait statement back into a wait statement. It also
reworks the strength emitting code to only emit a single strength
for the pull gates and fixes a bug in the strength emitting code.
2011-02-10 18:53:46 -08:00
Cary R 8744c4279d vlog95: Add CA support, other enhancements, refactoring and bug fixes.
This patch add the following functionality to the vlog95 generator.

  Add support for most CAs. Selects still don't work correctly.
  Emitting a named event as an expression.
  Enhance the ability to find a signal in a nexus.
  Add code to emit a nexus driven by a constant.
  Rework the delay/strength code for logic gates/CAs
  Refactor some of the number code.
  Refactor the variable emitting code to support named blocks.
  Translate the compiler code back to <var> = <event> <value>
2011-01-31 14:41:58 -08:00