Skip to content

Use of open in signal declaration causes crash #1057

@cameronweston

Description

@cameronweston

Hopefully I found what is causing the error that I mentioned in #1045. Passing open to an already constrained portion of a type declaration causes NVC to crash. Replacing open with 7 downto 0 (or any other range, causes the test to pass).

tb_simple.vhd

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity tb_simple is
end tb_simple;

architecture tb of tb_simple is
  type my_rec is array (7 downto 0) of std_logic_vector;
  signal sigA             : my_rec(open)(0 downto 0); --replacing open with 7 downto 0 causes test to pass
begin
  sigA(0)(0) <= '0';
end tb;

test_simple.py

import logging
import os
import cocotb
from cocotb.runner import get_runner

@cocotb.test()
async def run_test(dut):
  log = logging.getLogger("cocotb.tb")
  log.setLevel(logging.DEBUG)

  #sigC = dut.test_inst.c


def test_runner():
  tests_dir = os.path.dirname(__file__)
  sim = os.getenv("SIM", "nvc")

  runner = get_runner(sim)

  sources = [
    os.path.join(tests_dir,"tb_simple.vhd")
  ]

  runner.build(
    sources=sources,
    hdl_toplevel="tb_simple",
    always=True
  )

  runner.test(
    hdl_toplevel="tb_simple",
    test_module="test_simple"
  )

Error Message

*** Caught signal 11 (SEGV_MAPERR) [address=0x8, ip=0x55c2223fe3a6] ***

[0x55c2222d8e9d]
[0x7f41bf16d51f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x55c2223fe3a6]
[0x55c2223fd8a4]
[0x55c2223f67ba]
[0x55c2223f7b32]
[0x55c2223f8e67]
[0x55c2223c2b22]
[0x55c2222e133e]
[0x55c2222dd7c6]
[0x55c2222e0442]
[0x55c2222dd25a]
[0x55c2222d5617]
[0x7f41bf154d8f] (/usr/lib/x86_64-linux-gnu/libc.so.6) ../sysdeps/nptl/libc_start_call_main.h:58 __libc_start_call_main
[0x7f41bf154e3f] (/usr/lib/x86_64-linux-gnu/libc.so.6) ../csu/libc-start.c:392 __libc_start_main@@GLIBC_2.34
[0x55c2222d6a24]

nvc 1.14.1 (e10a10e) (Using LLVM 14.0.0) [x86_64-pc-linux-gnu]

Please report this bug at https://github.com/nickg/nvc/issues

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions