Commit Graph

5049 Commits

Author SHA1 Message Date
Nick Gasson a34348bb35 Add (temporary) error for ICT_SCOPE_GENERATE
Generate scopes were previously ignored, and this would cause a segfault
later on. This patch gives an error whenever it encounters a generate
scope. This should be removed once generate statements are implemented.
2008-09-06 11:38:37 +01:00
Stephen Williams 8717a85f7f Prepare for snapshot 20080905 2008-09-05 17:44:41 -07:00
Cary R 5bf55485d5 Pass file and line number information for expression constants.
This patch passes the file and line number information for
constants that are used in expressions.
2008-09-05 17:33:45 -07:00
Stephen Williams 38970fea65 Merge branch 'vhdl' 2008-09-05 14:40:48 -07:00
Cary R 90fbac6e33 Add callbacks to vpiMemory objects.
This patch adds the ability to set a global array callback.
These type of callbacks will be called when any element of
the array changes.
2008-09-04 21:37:50 -07:00
Larry Doolittle 66949122cf Non-controversial whitespace cleanup
Nothing to do with tab width!  Eliminates useless
trailing spaces and tabs, and nearly all <space><tab>
pairings.  No change to derived files (e.g., .vvp),
non-master files (e.g., lxt2_write.c) or the new tgt-vhdl
directory.

Low priority, simple entropy reduction.  Please apply
unless it deletes some steganographic content you want
to keep.
2008-09-04 21:31:30 -07:00
Stephen Williams 6f002935d7 Parse attributes on statements within event statements.
Statements can have attributes attached to them. Handle a few cases in
the parser where attributes may be attached to statements, and get them
as far as the pform.
2008-09-04 21:27:21 -07:00
Stephen Williams 5f0b723534 Merge branch 'master' into elaborate-net-rework 2008-09-03 19:59:31 -07:00
Cary R 7beb059d90 Add blocking repeat event control, make repeat sign aware
This patch adds blocking repeat event controls and also makes the
base repeat statement sign aware. If the argument to repeat is
negative (it must be a signed variable) then this is treated just
like an argument of 0 (there is no looping). Doing this allows us
to model the repeat event control as follows.

  lhs = repeat(count) @(event) rhs;

is translated to:

  begin
    temp = rhs;
    repeat (count) @(event);
    lhs = temp;
  end

This patch also pushes the non-blocking event control
information to the elaboration phase where it will report they
are not currently supported.
2008-09-03 19:35:54 -07:00
Stephen Williams 60169f6353 Get generate block scope from generate case.
The generate block is a placeholder for the generate items, and it
is the items themselves that can specify the name of the generate
block that is created.
2008-09-03 17:59:39 -07:00
Stephen Williams e4411777ed Remove unused net_force.cc source file. 2008-09-02 18:38:04 -07:00
Stephen Williams 456fffa7ed Remove last vestiges of XNF.
XNF hasn't been supported in a while. Xilinx doesn't put any effort
into it either, for that matter.
2008-09-02 18:23:48 -07:00
Nick Gasson 4cb2090978 Fix vhdl_expr::cast when expression has no assigned type
This avoids a couple of segfaults
2008-09-02 20:22:50 +01:00
Nick Gasson ff766899b0 Add IVL_LPM_CMP_GT 2008-09-02 19:07:38 +01:00
Nick Gasson 122890fef4 Make sure LPM expression is cast to the output type
This fixes some signed/unsigned bugs identified by the signedX tests.
2008-09-02 19:02:54 +01:00
Cary R 1944f372c5 Fix a couple uninitialized value problems found with tgt-vhdl.
This patch fixes two uninitialized variable problems found
with valgrind when testing the VHDL code generator.
2008-09-01 21:23:58 -07:00
Cary R 8fbfdffe91 Allow .array/port input access generate statement.
For nested array accesses the .array/port statement must
evaluate its input argument before it starts printing the
actual .array/port statement.
2008-09-01 14:04:51 -07:00
Larry Doolittle 23127852c7 Compatibility with gcc-4.3
Add "include" to fix error with abort() in dup_expr.cc
Add "include" to AStatement.h so usage of struct PExpr works
Get rid of eval_tree.cc:577: warning: suggest parentheses around comparison in operand of ^
2008-09-01 13:55:57 -07:00
Stephen Williams c150223a3a Fix problem with vvp_vector2_t right shift
that trips only when starting with perfectly
aligned inputs.
2008-09-01 13:55:42 -07:00
Stephen Williams c0a4b7c670 Fix a bug in vector evaluation of abs().
The calculation of the abs of a signed value
was inverting the value if it was signed,
and not if it was negative.
2008-08-30 17:35:57 -07:00
Stephen Williams 319b886118 Build files compatible with snapshot 20080830 2008-08-30 17:09:51 -07:00
Stephen Williams fc476aa281 Fix right shift of vvp_vector2_t.
The right shift of vvp_vector2_t needs to
account for and mask off shifted bits. Otherwise
there will be unexpected results after
a vvp_vector2_t::trim method.
2008-08-30 15:30:22 -07:00
Stephen Williams 49c4f2d106 Fix crash on uninitialized data. 2008-08-30 15:28:31 -07:00
Stephen Williams bc3411e28e Merge branch 'master' into elaborate-net-rework 2008-08-29 22:13:07 -07:00
Cary R 97e662d667 Remove unneeded real compare code.
The code removed is unneeded since real values are already
handled by the real specific comparison that is called at
the beginning of each function.
2008-08-29 21:16:59 -07:00
Stephen Williams f900b6d541 Add the Verilog-2005 and Verilog-AMS constant system functions.
This patch adds the constant system functions for Verilog-2005
and Verilog-AMS. These are evaluated at compile time. $abs(),
$min() and $max() support their polymorphic behavior in the
compiler where it really matters. They are always evaluated
as reals in the run time and the result/argument(s) will be
converted as needed.

The Verilog-2005 functions are available if using the 2005
generation (default) and if either the icarus-misc (also on
by default) or verilog-ams flags are set.

The Verilog-AMS functions are available if either the
icarus-misc or verilog-ams flags are set.
2008-08-29 21:11:44 -07:00
Cary R 0804eccfec Evaluate constant real EQ and NE constructs.
This patch adds code to evaluate constant == and != with real values.
2008-08-29 20:41:10 -07:00
Cary R 2e97b28185 More NaN constant fixes.
This patch cleans up %loadi/wr regarding NaN values. It also
fixes the code generator to correctly output a NaN value as
a Cr<> constant.
2008-08-29 19:32:00 -07:00
Cary R 2d3cd7cb9a Handle NaN constant in the code generator and fix loadi/wr NaN bug.
This patch fixes a bug in %loadi/wr regarding NaN values. It also
fixes the code generator to correctly output a NaN value.
2008-08-29 19:31:50 -07:00
Stephen Williams c9efe87146 Merge branch 'master' into elaborate-net-rework 2008-08-29 19:10:48 -07:00
Stephen Williams 1ca8241b88 Merge branch 'master' into verilog-ams 2008-08-29 19:03:34 -07:00
Stephen Williams 8d21c0390e Remove dead EEQ code.
The EEQ function is handled by vvp_cmp_eeq, an arithmetic expression
processor and the logic version of EEQ is never used.
2008-08-29 18:45:19 -07:00
Stephen Williams 3b778b1a06 Minor improvements to expression debug prints. 2008-08-29 18:44:45 -07:00
Stephen Williams e322cce650 Clean up $clog2() measurement of unsized numbers.
If the argument to $clog2() is unsized constant, then trim it to the
smallest representation that doesn't lose the sign, then do the $clog2
on that.

Also, use integer_width instead of 32 for the minimum $clog2() result
for a negative value.
2008-08-29 18:42:22 -07:00
Nick Gasson ed929a37bb Merge branch 'master' of git://icarus.com/~steve-icarus/verilog into vhdl 2008-08-29 18:38:49 +01:00
Stephen Williams 4c7144afc0 Remove dead EEQ code.
The EEQ function is handled by vvp_cmp_eeq, an arithmetic expression
processor and the logic version of EEQ is never used.
2008-08-28 22:08:46 -07:00
Stephen Williams 5d5228b6b8 Minor improvements to expression debug prints. 2008-08-28 21:16:44 -07:00
Stephen Williams e6c2637367 Clean up $clog2() measurement of unsized numbers.
If the argument to $clog2() is unsized constant, then trim it to the
smallest representation that doesn't lose the sign, then do the $clog2
on that.

Also, use integer_width instead of 32 for the minimum $clog2() result
for a negative value.
2008-08-28 21:15:43 -07:00
Stephen Williams 468f45b4db Merge branch 'master' into elaborate-net-rework 2008-08-28 18:17:24 -07:00
Cary R 8c38872b4b Fix the always zero delay check to happen after elaboration.
This patch moves the always zero or possibly zero delay checks
to a point after the circuit is full elaborated. Before it
could try to check tasks that had not already been evaluated
resulting in a crash.
2008-08-28 17:49:41 -07:00
Cary R d15e2a2f73 Work around a flex limitation with yyrestart()
See the comments added with this patch for more information.
2008-08-28 17:41:13 -07:00
Cary R 150d51c19b Optimize block delay type check
When looking for a delay_type() in a block stop when we have a
DEFINITE_DELAY. Doing this could reduce the number of statements
that need to be checked.
2008-08-28 17:38:02 -07:00
Larry Doolittle b455f3af5d Spelling fixes
Comments only, no code changes
2008-08-28 17:36:32 -07:00
Nick Gasson 0e458501b3 Ensure binary operands have correct signedness
Previously only signedness was only corrected for the
result. This patch ensures the VHDL operands have the
same signedness as their Verilog counterparts.

This fixes a few of the signedX tests.
2008-08-28 21:53:12 +01:00
Cary R 3b8dc81a97 By default convert a recv_vec8_pv to a recv_vec4_pv
Assume that anything that is strength aware already handles a
recv_vec8_pv and make the default function convert the bits
to a vec4 and then call recv_vec4_pv with this new value.
2008-08-27 21:22:18 -07:00
Cary R 0ae8f744c4 Variable arrays need to keep their signedness.
Since variable arrays create their elements dynamically the base array
structure for them needs to keep the signedness information.
2008-08-27 21:16:25 -07:00
Cary R 370ff9719f Make &A and &PV nestable.
This patch makes it so that &A and &PV can nest for the symbol
argument. This allows nested array selects, etc.
2008-08-27 21:09:41 -07:00
Stephen Williams 3ed0c4e809 Don't crash looking for delay_type of empty task.
It is legal for a task to have no definition. In that case, the
delay_type calculations (used to detect infinite loops) can assume
that an empty definition is a no-op and return NO_DELAY.
2008-08-27 18:42:05 -07:00
Stephen Williams 0121c41942 Better optimization of constants in expressions
Be more sophisticated with the code generated for constant values.
When values are large, use an optimal mix of %movi and %mov
instructions to get the desired value, no matter what the content.
2008-08-27 18:22:23 -07:00
Stephen Williams 091a546387 Broken run-time wide divide.
The wide-divide function was broke. It generated bad results.
2008-08-27 18:20:35 -07:00