OS X gives the same results:

david_koontz@Macbook: make
rm -rf work
mkdir work
ghdl -a  --work=work --workdir=work sim_pkg.vhd
gcc -c -fPIC sim.c -o sim.o
ghdl -a  --work=work --workdir=work tb_cosim.vhd

******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.31 (20140108) [Dunoon edition]
Compiled with GNAT Version: GPL 2013 (20130314)
In directory: /Users/david_koontz/Desktop/reneedoss/
Command line:
/opt/ghdl/gcc-4.8.2/libexec/gcc/x86_64-apple-darwin13.0.0/4.8.2/ghdl1 
--work=work --workdir=work 
-P/opt/ghdl/gcc-4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/vhdl/lib//v93/std/
 
-P/opt/ghdl/gcc-4.8.2/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/vhdl/lib//v93/ieee/
 -quiet -o work/tb_cosim.s tb_cosim.vhd
Exception TYPES.INTERNAL_ERROR raised
Exception information:
Exception name: TYPES.INTERNAL_ERROR
Message: sem_names.adb:1847
Call stack traceback locations:
0x105b77a34 0x105b78a91 0x105b7f23c 0x105b831af 0x105b7f368 0x105b831af 
0x105b7f368 0x105b7e5a0 0x105b6b219 0x105b6b70f 0x105b90134 0x105b876c9 
0x105b6c279 0x105b91725 0x105b615d1 0x105b62737 0x105abb024 0x105a9b8b3 
0x105aa70ef 0x105aa8c1a 0x105a9e65e 0x105abb084 0x105a9ac04
******************************************************************

Execution terminated by unhandled exception
Exception name: TYPES.INTERNAL_ERROR
Message: sem_names.adb:1847
Call stack traceback locations:
0x105b77a34 0x105b78a91 0x105b7f23c 0x105b831af 0x105b7f368 0x105b831af 
0x105b7f368 0x105b7e5a0 0x105b6b219 0x105b6b70f 0x105b90134 0x105b876c9 
0x105b6c279 0x105b91725 0x105b615d1 0x105b62737 0x105abb024 0x105a9b8b3 
0x105aa70ef 0x105aa8c1a 0x105a9e65e 0x105abb084 0x105a9ac04
ghdl: compilation error
make: *** [all] Error 1

Shotgunning by commenting out the processes then the function declaration/body 
in tb_cosim.vhd show it’s the crc function causing the problem. (ghdl -a 
tb_cosim.vhd)

Undoing commenting out as a troubleshooting method leaves this as the offending 
line in function crc:

  crc_out := (crc(3 downto 0) & crc_out(31 downto 4)) xor crc;

Note that crc_out isn’t initialized and is guaranteed to propagate ‘U’s for 
part of it’s range of elements, and giving a default value: 

    variable crc_out : std_logic_vector(31 downto 0) := (others => '1');

makes no difference.

And on closer examination we find that crc is called recursively twice:

  crc_out := (crc(3 downto 0) & crc_out(31 downto 4)) xor crc;
  ------------^-------------------------------------------^

That should be crc_value. Note there is no argument and no default value.

The line should look something like:

   crc_out := (crc_value(3 downto 0)& crc_out(31 downto 4)) xor crc_value;

After which tb_cosim.vhd analyzes.

So the problem occurs when you trip across is the first invocation - crc(3 
downto 0) during analysis.

The occurrence of the name crc appears legal within the scope of the function 
specification.

There’s a missing association list for the call to crc (crc_value doesn’t have 
a default value) that’s not being detected when taking a slice of the result, 
regardless that isn’t what’s intended. You could also note recursive invocation 
of crc doesn’t look like it does or could do anything meaningful.

You could notice that if you only fix the first crc reference:

     crc_out := (crc_value(3 downto 0)& crc_out(31 downto 4)) xor crc;

You get:

david_koontz@Macbook: ghdl -a tb_cosim.vhd                                      
tb_cosim.vhd:32:67: function "crc" requires parameters
ghdl: compilation error

We’re missing the same check when using a slice of a function return value.


> On 28/08/2015, at 6:57 am, René Doß <d...@gmx.de> wrote:
> 
> I want also report a bug.
> 
> 
> ******************** GHDL Bug occured ****************************
> Please report this bug on http://gna.org/projects/ghdl
> GHDL release: GHDL 0.31 (20140108) [Dunoon edition]
> Compiled with GNAT Version: 4.8.3 20140627
> In directory: /home/red/ghdl/
> Command line:
> /opt/ghdl/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/ghdl1 --work=work
> --workdir=work
> -P/opt/ghdl/lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/vhdl/lib//v93/std/
> -P/opt/ghdl/lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/vhdl/lib//v93/ieee/
> -quiet -o work/tb_cosim.s tb_cosim.vhd
> Exception TYPES.INTERNAL_ERROR raised
> Exception information:
> Exception name: TYPES.INTERNAL_ERROR
> Message: sem_names.adb:1847
> Call stack traceback locations:
> 0x61690f 0x617c72 0x61e5c7 0x61fb33 0x61e1b5 0x61fb33 0x61e1b5 0x61bdae
> 0x60a909 0x60b12e 0x62d868 0x624bf5 0x60bc95 0x62f6d5 0x60121b 0x6022e5
> 0x567ea5 0x54af93 0x555f44 0x557a28 0x54dac1 0x567ef9 0x549881
> 0x7f2ef3932b03 0x549a53 0xfffffffffffffffe
> ******************************************************************
> 
> Execution terminated by unhandled exception
> Exception name: TYPES.INTERNAL_ERROR
> Message: sem_names.adb:1847
> Call stack traceback locations:
> 0x61690f 0x617c72 0x61e5c7 0x61fb33 0x61e1b5 0x61fb33 0x61e1b5 0x61bdae
> 0x60a909 0x60b12e 0x62d868 0x624bf5 0x60bc95 0x62f6d5 0x60121b 0x6022e5
> 0x567ea5 0x54af93 0x555f44 0x557a28 0x54dac1 0x567ef9 0x549881
> 0x7f2ef3932b03 0x549a53 0xfffffffffffffffe
> ghdl: compilation error
> makefile:7: recipe for target 'all' failed
> make: *** [all] Error 1
> red@linux-k4o7:~/ghdl>
> 
> 
> <makefile.txt><sim.c><sim_pkg.vhd><tb_cosim.vhd>_______________________________________________
> 





_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to