Commit Graph

6076 Commits

Author SHA1 Message Date
Cary R c71a5f08b9 Fix MinGW specific shadow warning.
This patch removes a MinGW specifc shadow warning.
2010-09-24 15:36:52 -07:00
Cary R 4b16785f16 Fix possible undefined value compiler warning 2010-09-22 13:41:24 -07:00
Larry Doolittle b909c74a20 Spelling fixes
All fixes are in comments, except for one error message (was "iternal error")
2010-09-22 10:43:32 -07:00
Cary R 0dad9e3adb Update fstapi.c to the latest from GTKWave-3.3.12 2010-09-22 09:13:00 -07:00
Cary R cac725ed3d Fix signed/unsigned compare warnings.
Fix all the Icarus files that can be so that we do not have any
signed/unsigned compare warnings. It also removes const as a
return qualifier for two routines in discipline.h.
2010-09-22 09:09:26 -07:00
Cary R f522ca8a9c Pad and sign convert array index expressions as needed.
This patch mimics what was done for vectors, but is simpler since
arrays don't use the endian information. It also needs to address
the fact that .array/port assumes the expression is unsigned so
any signed expression must be padded to make it larger than the
maximum array word when it is converted to unsigned.
2010-09-19 13:41:32 -07:00
Cary R fabde6d1b5 Normalize variable bit/indexed part selects using a fixed routine.
This patch modifies all the variable bit and indexed part selects
to use a common routine. This routine determines the minimum
width needed to calculate the result correctly, pads the expression
if needed and then converts the expression to signed if required to
make the calculation correct.
2010-09-19 13:41:22 -07:00
Cary R dd4fb9b4ef Fix spacing issues.
This patch removes space before a tab and space or tab before end
of line.
2010-09-19 13:21:59 -07:00
Cary R 5ae3e48cdb Fix generation of PS files and hence PDF files on cygwin.
The Cygwin man command requires that you have a / in the path
if you want to avoid looking at the normal search path. This
patch addes ./ before the manual page file name. Which should
work on any system. It also makes the vvp generation create a
PS file like is done in the other Makefiles.

By default we generate normal manual pages. You can then
create PostScript version and from these you can generate a
PDF version.
2010-09-19 13:19:29 -07:00
Cary R acb55916da Resize constants in eval_expr when needed.
If we are given an unsized constant that is smaller then the requested
width then resize the constant to fit.
2010-09-13 16:16:08 -07:00
Cary R 4001c7a27f An if statement is optional and results in no delay.
While checking for an infinite loop in an always block I missed
the case where an if statement does not have a statement. This
was resulting in a segmentation fault.
2010-09-13 14:02:25 -07:00
Nick Gasson d9bf96d8fa Basic parameter support in VHDL target
This is a fix for pr2555831. A separate entity/architecture pair is
generated for each module that is instantiated with a unique
parameter combination.
2010-09-11 12:17:06 +01:00
Cary R b252dc0192 Don't elide unconnected module ports.
When performing a translation we do not want to elide any module
ports. Dropping ports can result in port mismatch issues.
2010-09-08 16:56:47 -07:00
Cary R 4b98a50dce Report and fail gracefully for recursive parameter definitions.
If someone accidentally makes a parameter depend on itself
we need to report this not crash. This patch fixes the crash
and prints an appropriate string of messages to figure out
the loop. Icarus currently supports forward references of
parameters so more complicated loops can be created. These
are also caught.
2010-09-08 16:51:41 -07:00
Cary R 5e1546faaf Don't elide a BUFZ that represents a continuous assignment.
To prevent a force from back propagating we need to keep a BUFZ
that represents a continuous assignment between two nets. This
only effects continuous assignments of the form assign out = in.
In general these are fairly rare so keeping them has minimal
impact on the simulation speed.
2010-09-08 15:16:37 -07:00
Nick Gasson 56525d0c20 Merge branch 'generics' into vhdl 2010-09-08 19:37:00 +01:00
Nick Gasson c87186a15c Add uwire support to VHDL backend
Implemented as std_ulogic which behaves almost identically.
2010-09-08 11:20:54 -07:00
Cary R c9f28902eb Warn the user that synthesis is no longer maintained.
Add code to print a warning if the user tries to use the -S flag.
We need this warning since synthesis is not currently being actively
maintained or supported in any branch after V0.8.
2010-09-04 16:37:38 -07:00
Cary R 6257d31582 Add another missing probe_expr_width() call.
The indexed select width argument was missing a call to
probe_expr_width() and was crashing the compiler.
2010-09-03 18:38:58 -07:00
Nick Gasson e41f2f36a3 List parameters/values in VHDL entity comment
For example:

  -- Generated from Verilog module child (vhdl_tests/generics.v:30)
  --   MY_VALUE = 3
  entity child is

To make it clear which values were used for this entity.
2010-08-28 17:13:23 +01:00
Nick Gasson 0c883a00bf Change VHDL $finish to use report not assert
Changes:

   assert false report "SIMULATION FINISHED" severity failure;

To just:

   report "SIMULATION FINISHED" severity failure;
2010-08-24 22:17:11 +01:00
Nick Gasson 48ae8c1ce5 Generate VHDL report statements for $display
This changes the implementation of $display/$write to use VHDL
report statements rather the the std.textio functions. The code
produced is simpler and more like what a real VHDL designed would
write. However it no longer exactly matches the Verilog output as
most VHDL simulators prepend the text with simulation time, entity
name, severity level, etc. There is a corresponding change in
ivtest to support this.
2010-08-24 22:13:08 +01:00
Nick Gasson 0cec4495ca Add VHDL report statement
Not output yet, but will be used to replace std.textio
implementation of $display.
2010-08-18 23:50:13 +01:00
Nick Gasson f9da800cf5 Reduce number of 0 ns waits in generated VHDL
Previous we generated a "wait for 0 ns" statement after
every blocking assignment that wasn't the last statement
in the process. While this implements the Verilog semantics,
it generates excessive waits, and cannot usually be synthesised.
This patch only generates "wait for 0 ns" statements when it
cannot be avoid (e.g. when the target of a blocking assignment
is read in the same process).

An example:

  begin
    x = 5;
    if (x == 2)
      y = 7;
  end

Becomes:

  x <= 5;
  wait for 0 ns;    -- Required to implement assignment semantics
  if x = 2 then
    y <= 7;         -- No need for wait here, not read
    -- wait for 0 ns  (previously)
  end if;
2010-08-17 22:49:27 +01:00
Nick Gasson 406d3936af Add find_vars method to VHDL syntax objects
Finds set of read and written variables. For use in
post-processing the syntax tree for cleanup.
2010-08-17 22:49:27 +01:00
Nick Gasson 0d6b42885b Reduce superflous parens in generated VHDL
Purely cosmetic, replaces output like:

  if (x + foo(x + (2 * y))) then ...

With:

  if x + foo(x + (2 * y)) then ...
2010-08-17 22:49:27 +01:00
Stephen Williams 2c11850f3c Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog 2010-08-15 16:38:11 -07:00
Cary R f29d09dcbe Add uwire support/functionality to the stub and vvp back ends
This patch adds a check in the vvp back end that a uwire has
at most one driver. Previously this was just converted (with
a warning message) to a wire just after elaboration.
2010-08-15 16:29:20 -07:00
Cary R 6023ab0893 Remove some incorrect const properties
A recent patch incorrectly change these two methods to const.
2010-08-13 20:16:57 -07:00
Cary R 03f6283203 Add support for calling system functions as a task (SystemVerilog)
This patch adds the ability to call a system function as a task for
the SystemVerilog generation (-g2009). The return value is really
calculated, but it is ignored.
2010-08-13 20:05:23 -07:00
Cary R 860f8627ba Fix some possible memory leaks and make some methods const.
This patch fixes a couple places where there were some memory
leaks on error and also makes some methods const that can be.
Found with cppcheck.
2010-08-11 17:39:20 -07:00
Nick Gasson d33082bca5 Resize VHDL vector before cast in signed comparison
E.g. $signed(x) > y with x, y different sizes should be

  resize(signed(x), N) > y

Not

  signed(resize(x, N)) > y

As this does not treat the sign bit correctly. Was causing
the signed5 test to fail.
2010-08-11 17:34:16 -07:00
Nick Gasson ae0fe9541d Rename modules which are VHDL reserved words 2010-08-11 17:30:27 -07:00
Nick Gasson 5e0f80afca Avoid emitting VHDL Bool_To_Logic calls for common cases
No functional change, just improves the output a bit. E.g.

  x <= Bool_To_Logic(y = z);

Becomes:

  x <= '1' when y = z else '0';
2010-08-08 14:34:13 -07:00
Nick Gasson 090f7730e6 Avoid VHDL type error in concurrent assignment
When translating a relational LPM to concurrent VHDL assignment, the
generated code would be incorrect if the input types differed in
signedness.
2010-08-08 14:34:06 -07:00
Nick Gasson 2d97486897 Rename VHDL instances which are reserved words
Fixes compiler errors with some real-world examples
2010-08-08 14:34:00 -07:00
Patrick Doyle 2ffc2d36f2 Keep expression width when evaluating expressions ahead of time.
Added 'expr_wid' parameter to calls to 'eval_expr()' within
PEBinary::elaborate_eval_expr_base_()'.  This makes a specific problem
go away and may even be the correct thing to do.
2010-08-06 22:13:13 -07:00
Stephen Williams f23a56e632 Revert "Add $info, $warning and $error as aliases to $display"
This reverts commit 99619bc326.
The $error functions are already well supported in devel, so this
patch does nt belong there. Oops.
2010-07-31 17:12:12 -07:00
Stephen Williams 99619bc326 Add $info, $warning and $error as aliases to $display
Submitted by voiz@sourceforge.net
2010-07-30 19:11:34 -07:00
Cary R 029a61d074 Fix the white space errors in tgt-vvp 2010-07-30 18:59:38 -07:00
Cary R 314714997f Add support for variable UDP delays.
This patch adds support for a UDP with variable delays. In the process the
intrinsic support for delays was removed from the UDP functor and replaced
with a call to the .delay functor. Both a normal gate and a UDP now use the
same code to generate the delay.
2010-07-30 18:59:29 -07:00
Cary R 86653ddff9 Remove some cppcheck warnings.
This patch modifies the code to remove some more cppcheck warnings.
2010-07-30 18:50:52 -07:00
Cary R 44b08a4630 Update fstapi.c to latest from gtkwave 3.3.10 2010-07-19 21:22:13 -07:00
Cary R 30fa8f64fa Cleanup some compiler warnings under CentOS 5.5
This patch cleans up a couple of warnings when compiling on CentOS 5.5
using gcc 4.1.2.
2010-07-19 21:20:24 -07:00
Stephen Williams a436f7f794 Draw code for a delayed enable to tranif gates. 2010-07-19 21:14:29 -07:00
Stephen Williams ae3b6a9de2 Show tranif delays in the diagnostic dumps. 2010-07-18 20:43:42 -07:00
Cary R df4722b92c The switch gates do not support a strength specification.
This patch splits the switch types out of the gates to allow
them to be defined to not take a strength specification.
2010-07-13 19:21:02 -07:00
Cary R 5fe5171e49 Fix bug when calculating the decay time from two variable delays.
We need to also update the decay time if the new rise/fall value
is less than the minimum value and we are in ignore decay mode.
2010-07-13 18:23:21 -07:00
Cary R 13fb07dc17 Add support for only two variable delays and add delay checks.
This patch adds checks that the delay count is correct for the
various gates and adds support for a missing variable decay
time. For this case the decay time is the minimum of the rise
and fall times. This is denoted by setting the decay variable
to 0 in the vvp file. vvp notes this and sets an ignore decay
time property in the base delay. This turns off the ability
to set the decay time and the minimum delay calculation will
also update the decay time.
2010-07-13 18:23:16 -07:00
Cary R 6fbf47025f We have already verified that we have a 64 bit immediate value.
These checks are not needed since we have already verified that
we have a 64 bit immediate value. This is likely old code that
should have been removed when the original functionality was
changed.
2010-07-13 16:25:19 -07:00