Menu

#1 Attributes delayed, stable or quiet can sometimes make "ghdl -a" crash

1.0
closed
None
2014-04-06
2013-12-15
No

Upstream report from Debian bug 573721.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573721

If the three attributes 'delayed, 'stable or 'quiet are applied in a process, and their parameters include variables or constants declared local to the process, ghdl fails to compile the process.

It reports:

./ghdl_gcc -a 573721_deb.vhd

******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.31dev (20132311) [Dunoon edition]
Compiled with GNAT Version: 4.8
In directory: /home/brian/Projects/ghdl/play/bugs/
Command line:
/home/brian/Projects/ghdl/hg/ghdl/translate/ghdl1-gcc -P/home/brian/Projects/ghdl/hg/ghdl/translate/lib//v93/std/ -P/home/brian/Projects/ghdl/hg/ghdl/translate/lib//v93/ieee/ -quiet -o 573721_deb.s 573721_deb.vhd
Exception TYPES.INTERNAL_ERROR raised
Exception information:
Exception name: TYPES.INTERNAL_ERROR
Message: translation.adb:23507
Call stack traceback locations:
0x53de2a 0x53e04c 0x53e1a3 0x55b313 0x50c3c5 0x51b9a9 0x51bf72 0x515453 0x51bb49 0x4febf0 0x502ec4 0x53ca47 0x4e06f0 0x55c9fc 0x568b3f 0x45aaff 0x432227 0x43e7b4 0x4405f8 0x435c7f 0x45ab66 0x4312e2 0x7f3ccd29f993 0x430903 0xfffffffffffffffe
******************************************************************

Testcase attached.

1 Attachments

Discussion

  • Anonymous

    Anonymous - 2013-12-16

    ip1 declared as a variable is responsible for reported crashes at lines 26, 36, and 46:


    14.1

    ...

    S'DELAYED [(T)]
    Kind: Signal.
    Prefix: Any signal denoted by the static signal name S.
    Parameter: A static expression of type TIME that evaluates to a nonnegative value. If omitted, it defaults to 0 ns.
    Result Type: The base type of S.
    Result: A signal equivalent to signal S delayed T units of time. The value of S'DELAYED(t) at time Tn is always equal to the value of S at time Tn-t.

    ...

    S'STABLE [(T)]
    Kind: Signal.
    Prefix: Any signal denoted by the static signal name S.
    Parameter: A static expression of type TIME that evaluates to a nonnegative value. If omitted, it defaults to 0 ns.
    Result Type: Type Boolean.
    Result: A signal that has the value TRUE when an event has not occurred on signal S for T units of time, and the value FALSE otherwise. (See 12.6.2 .)

    ...

    S'QUIET [(T)]
    Kind: Signal.
    Prefix: Any signal denoted by the static signal name S
    Parameter: A static expression of type TIME that evaluates to a nonnegative value. If omitted, it defaults to 0 ns.
    Result Type: Type Boolean.
    Result: A signal that has the value TRUE when the signal has been quiet for T units of time, and the value FALSE otherwise. (See 12.6.2 .)


    4.3.1.3 Variable declarations
    ...
    NOTES (2.)
    ... For processes, which never complete, all variables persist from the beginning of simulation until the end of simulation.


    tp1 has a default value which has a locally static primary. and is not otherwise the target of a variable assignment statement.
    Is tp1 static?

    note that tp2 which is a constant also fails, which says tp2 and tp1 without an operator and secondary unit aren't being interpreted as expressions (which they are, they are primaries and more telling within parentheses).

    If you were to look up static in the glossary you'd find that refers to either locally static or globally static. There are no assignments to i1 or t1 after the default values.

    B.108 globally static expression: An expression that can be evaluated as soon as the design hierarchy in which it appears is elaborated. A locally static expression is also globally static unless the expression appears in a dynamically elaborated context. (§ 7.4 )

    B.109 globally static primary: A primary whose value can be determined during the elaboration of its complete context and that does not thereafter change. Globally static primaries can only appear within statically elaborated contexts. (§ 7.4.2 )

    B.147 locally static expression: An expression that can be evaluated during the analysis of the design unit in which it appears. (§ 7.4 , § 7.4.1 )

    B.149 locally static primary: One of a certain group of primaries that includes literals, certain constants, and certain attributes. (§ 7.4 )

    This is why i1 and t1 purportedly work without resorting to breaking them out and simulating. They are declared locally with static primaries and have no drivers.

    And this all looks like someone is trying to get you to run their test vectors more than complain about faults. That there are faults is almost incidental. All of these Debian attached test cases have that flavor to them. It says regression/validation testing for 'customers' is somewhat important and they are a hard crowd (to please).

    more later.

     

    Last edit: Anonymous 2013-12-16
  • Tristan Gingold

    Tristan Gingold - 2013-12-27

    There is indeed a missing check. The parameter must be static.

     
  • Tristan Gingold

    Tristan Gingold - 2013-12-28
    • status: open --> closed
    • assigned_to: Tristan Gingold
     

Log in to post a comment.

MongoDB Logo MongoDB