Skip to content

attribute requires static parameter? #1018

@NikLeberg

Description

@NikLeberg

The following (stupid) MWE crashes nvc:

file: stable.vhd

ENTITY stable IS
END ENTITY stable;

ARCHITECTURE arch OF stable IS
    SIGNAL a, b : BOOLEAN;
BEGIN
    a <= FALSE;
    b <= a'STABLE(NOW - a'LAST_EVENT);
END ARCHITECTURE arch;

Crash:

nvc -a stable.vhd -e stable

*** Caught signal 11 (SEGV_MAPERR) [address=0xffffffffffffff98, ip=0x55f739b2a1f5] ***

[0x55f739a43f0d] ../src/util.c:872 signal_handler
[0x7f891c66851f] (/usr/lib/x86_64-linux-gnu/libc.so.6) 
[0x55f739b2a1f5] ../src/rt/model.c:1706 split_nexus.lto_priv.0
[0x55f739b47f8b] ../src/rt/model.c:4008 x_last_event
[0x55f739b47f8b] ../src/rt/model.c:356 __nvc_last_event
[0x55f739b4b065] ../src/jit/jit-exits.c:780 __nvc_do_exit
[0x55f739b4cfa6] ../src/jit/jit-interp.c:831 interp_loop
[0x55f739b4cfa6] ../src/jit/jit-interp.c:1101 jit_interp
[0x55f739b37a0b] ../src/jit/jit-core.c:666 jit_try_vcall.lto_priv.0
[0x55f739b38bdf] ../src/jit/jit-core.c:728 jit_try_call
[0x55f739aa6332] ../src/eval.c:424 eval_instance
[0x55f739aa6332] ../src/eval.c:1425 elab_lower.lto_priv.0
[0x55f739aa7ed1] ../src/elab.c:1536 elab_architecture.lto_priv.0
[0x55f739b84f74] ../src/elab.c:2313 elab.constprop.0
[0x55f739a4ad62] ../src/nvc.c:476 elaborate
[0x55f739a482ca] ../src/nvc.c:2115 process_command
[0x55f739a48785] ../src/nvc.c:1799 cover_report_cmd
[0x55f739a48785] ../src/nvc.c:2145 process_command
[0x55f739a40687] ../src/nvc.c:2257 main

nvc 1.14.0 (1.14.0.r0.g157b0f6) (Using LLVM 14.0.0) [x86_64-pc-linux-gnu]

This seems to be because I did something stupid and tried to use a non static parameter for the attribute. At least this seems to be the case as GHDL and QuestaSim both complain about it:

GHDL:

ghdl -a stable.vhd 
stable.vhd:8:23:error: parameter of signal attribute must be static

QuestaSim:

vcom stable.vhd
** Error: stable.vhd(8): Attribute "STABLE" requires a globally static parameter.

Note that ghdl and questa both fail and emit an error during analyze phase. Nvc does not complain at all. Only if the design is elaborated then nvc crashes.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions