Commit Graph

35 Commits

Author SHA1 Message Date
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 633360a0f9 vlog95: More procedural $signed/$unsigned support/cleanup 2013-06-28 14:16:10 -07:00
Cary R 0e8a257ec2 vlog95: Fix the passing of the sign extend information in a CA 2013-06-27 19:44:17 -07:00
Cary R 7fa4cf5a34 vlog95: Fix a RS vs ARS in the CA code 2013-06-27 18:22:21 -07:00
Cary R 255922e545 vlog95: add support for emitting logic pull devices in a CA
If a logical pull device is converted into a CA then it is an assignment
with strength, so just emit the appropriate constant to get the correct
functionality (e.g. 1'b1 for a pull up and 1'b0 for a pull down).

Also add missing file/line information.
2013-04-18 17:38:30 -07:00
Cary R 69705ef32b vlog95: a sign extend can have an out of scope reference.
If modules instantiations were always handled correctly this would not be
needed, but for now looking for the nexus driver outside the scope is
needed to make some of the tests work.
2013-02-21 19:34:06 -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 28bc333cba vlog95: block generating a concat-Z LPM device in the compiler.
Since the vlog95 code generator needs the strength information we do
not want to hide it behind a concat-Z optimization. For now we abort
the optimization, but in the future we could add parts of this back
in (e.g. all the drivers have matching strength then replace with a
normal concat and a buf-Z if the strength are not both strong. The
original buf-Z should be removed to reduce the number of LPM devices).
2013-02-13 19:19:21 -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 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 dc387ad9d1 vlog95: Add a messge that ** (power) is not supported in a CA. 2013-02-07 10:21:04 -08:00
Cary R 15b0946fc4 vlog95: Add support for the new CONCATZ LPM type. 2013-02-06 10:05:12 -08:00
Cary R 4b28694509 Remove vlog95 compile warning 2012-12-17 17:14:40 -08:00
Cary R adff837399 Remove some new cppcheck warnings in tgt-vlog95 2012-09-03 11:58:43 -07:00
Cary R 0f1523e15d vlog95: minor tweak for array index calculation 2012-08-08 11:59:11 -07:00
Cary R 62412700aa vlog95: Add an error message that SV strings and darrays are not supported
We can not convert SystemVerilog strings or dynamic arrays to valid vlog95.
This patch adds an error message that they are not supported. There are still
issues with converting some of the dynamic array constructs (the compiler
crashes), but the message is printed before the crash.
2012-08-06 18:20:14 -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
Cary R 79b507ea46 Remove some scan-build warnings tgt-vlog95.
Remove an unneeded assignment.
2011-10-20 16:53:52 -07:00
Cary R 5821139e0f vlog95: Add debug code for emitting a nexus.
This patch adds debug code that can be used to investigate how a nexus
is built.
2011-07-19 20:09:57 -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 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 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 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 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
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 c90a896448 vlog95: Don't print a logic/UPD NULL name.
If the logic/UDP name is NULL then don't print anything.
2011-02-28 19:20:39 -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 96a9cb8d54 vlog95: Add a copyright notice for the Icarus UDPs and print a note.
This patch adds copyright information for the Icarus generated UDPs
(lesser GPL version 2.1). It also prints a note to let the user know
that this copyrighted code is being included in the output file. They
can then remove the primitives if needed. These are likely only
needed when the output is from synthesis. At the moment we only have
a positive edge D-FF. In the future a negative edge FF and D latches
will also be needed.
2011-02-28 18:34:51 -08:00
Cary R 7544575040 vlog95: Add preliminary logic gate name/range and assert logic pins in CA.
Add a preliminary gate name and range (zero based) for logic primitives.
Also assert that a logic gate in a continuous assignment has the correct
number of inputs/outputs.
2011-02-28 18:33:39 -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 4679aadbd5 vlog95: Add support for printing file/line information for most line.
This patch adds a flag that emits file and line information for
most lines. This can help the user understand where the various
lines came from in the original code. They are printed as
comments so the generated code still runs correctly.
2011-02-10 19:13:12 -08:00
Cary R 2a9e15e8d8 vlog95: Fix some bugs when emitting a logical device as a CA, etc.
When emitting a logical device as part of a continuous assignment
we need to use the actual inputs (not the output). We also do not
need to emit anything if the nexus is NULL. Also skip logical gates
that have a local output since they are part of a continuous
assignment and the inputs to a logical gate can be an expression
so emit them as a continuous assignment.
2011-02-10 19:09:01 -08:00
Cary R bfb04998c5 vlog95: Add support for UDPs, DFFs, constant nets and bug fixes.
This patch adds the following to the vlog95 converter.

  Add support for emitting  and calling UDPs.

  Generate a UDP for a synthesized DFF.

  Add the ability do emit a constant assigned to a net.
2011-02-10 19:07:51 -08:00
Cary R a2531c5015 Add support for most tran gates and rework/split out logic/lpm code.
This patch moves the logic and lpm code to a new file. It refactors
the strength emitting routine and adds support for emitting the
standard tran style of gates.
2011-02-10 19:00:28 -08:00