Commit Graph

59 Commits

Author SHA1 Message Date
Cary R 424fba819e vlog95: more functionality and some bug fixes.
This patch adds support for emitting an array as an expression. This is
used as a system task/function argument.

It partially reworks the real display code to print an appropriate
expression for NaN, inf and -inf. To get other real numbers to always
display correctly we need to build a custom printing routine that adjusts
what is displayed based on the actual bits in the double.

Add the ability to print a real variable delay. They are not scaled by
the compiler.

Since a delayx delay may be variable we must always enclose this type of
delay with parenthesis.

Fix the L-value concatenation to be in the correct order.

Handle the special case that an if with a single if as the true statement
does not loose any associated else clause to the enclosed if. Basically
add a begin/end pair as needed to make things work out correctly.
2011-01-31 12:01:03 -08:00
Cary R dd0ea9db40 vlog95: Add partial support for getting a nexus name, etc.
This patch adds preliminary support for finding the correct name for
a nexus at a given scope level. It also does the following.

Report that real modulus is not supported.
Fix a bug in the generation of concat expressions.
Add missing generation of unary ! operator.
Add ability to generate > integer delays.
Refactor some of the support code.
Make some of the error messages more descriptive.
Ignore the ALLOC and FREE statements (only used with automatic tasks).
2011-01-24 13:31:10 -08:00
Cary R 755d0b59d6 vlog95: Add support for translating some power expressions as a left shift.
If the left power operator expression is a numeric constant that has a
value 2^n n>0 then we can use a left shift to calculate the result. This
patch adds code to do this. All other power expressions are flagged as a
compilation error.
2011-01-18 17:23:46 -08:00
Cary R 5cec7e3870 Remove some cppcheck warnings about variable scope.
There were a couple variable that could have reduced scope.
2011-01-18 17:22:11 -08:00
Cary R 203a8cc997 Add more functionality to the vlog95 back end.
This patch adds significantly more functionality to the vlog95 back end.
The following are the major additions:

Display unsigned numbers without undefined bits in hex.
Add support for both L-Value and R-value bit and part selects.
Added support for out of scope references.
Added support for emitting logic gates (range not finished, name is invalid).
Added support for emitting initial/always blocks.
Add support for event inter statement delays.
Convert a blocking inter statement delay assign back to the original form.
Added support for rescaling variable delays.
Added support for the disable statement.
Added support for an event trigger statement (event name is missing).
Added support for calling a user task (calling arguments are missing).
Added support for an event based delay statement (@) (event name is missing)

Not all of these are working as expected since there is not currently a
routine to find a nexus name as a function of scope (needed for event names,
logic gate ports, etc.). Since the Icarus compiler generates structural code
the arguments to modules, module instantiations and calling user tasks are
also still missing.
2011-01-18 17:22:02 -08:00
Cary R 6581b13005 vlog95: add support for a scope and user function call expression.
This patch adds support for using a scope in an expression and calling
a user function. It also fixes an issue in the module name mangling
and calling a system task/function with multiple arguments.
2011-01-15 15:59:50 -08:00
Cary R dc7bb9149e vlog95: Add support for more statements and a delay expression
This patch adds the ability to print a delay expression (it is rescaled
to the module timescale) and adds support the following statement types:

  nonblocking assignment with a delay (event control is still missing)
  condition (if/else)
  forever
  repeat
  while (Icarus translated for loops to while loops)
  fork
  procedural continuous assign
  deassign
  force
  release
2011-01-15 15:45:08 -08:00
Cary R 428c1f3222 vlog95: add expression support for ternary, concat and system functions.
This patch adds support to the vlog95 convert for the ternary operator,
the concat/repeat operator and calling a system function. It also adds
the `celldefine information when appropriate.
2011-01-12 16:43:59 -08:00
Cary R 50106547e3 Extend the vlog95 converter
This patch adds more support to the Verilog 1995 converter. There is
still a lot that is missing and there is still some implemented
functionality that is not 100%.
2011-01-12 16:43:50 -08:00