Hello Christiano,

 

you stated that you are compiling GHDL from sources, but the generated 0.33 is 
not the latest version.

The current GitHub source code generates a “0.34dev” version.

 

Regarding your “make install” line: On my Linux (Debian), I need to wrap this 
command in “sudo” to get

root rights to install the files into the system directories. Is sudo not 
required on Raspi? Please check

if make install has overwritten all old GHDL files.

 

Regards

    Patrick

 

-----------------------------------

Wissenschaftliche Hilfskraft

 

Technische Universität Dresden

Fakultät Informatik

Institut für Technische Informatik

Lehrstuhl VLSI-Entwurfssysteme, Diagnostik und Architektur

01062 Dresden

 

From: Ghdl-discuss [mailto:ghdl-discuss-boun...@gna.org] On Behalf Of 
Christiano SA
Sent: Tuesday, May 17, 2016 6:16 PM
To: ghdl-discuss@gna.org
Subject: [Ghdl-discuss] Reporting bug: Foreign declarations and Procedure 
problem in ghdl-llvm

 

Summary: The program works normally when calling external functions in FUNCTION 
format and returns error while in PROCEDURE format.

 

The program below is working:

------------- t.vhdl-------------------

package math is
  function fxch(x: integer) return integer;
  attribute foreign of fxch : function is "VHPIDIRECT fxch";
end math;
     
package body math is
  function fxch(x: integer) return integer is
  begin
    assert false severity failure;
  end fxch;
end math;

--  Hello world program.
use std.textio.all; -- Imports the standard textio package.
use work.math.all;

--  Defines a design entity, without any ports.
entity hello_world is
end hello_world;

architecture behaviour of hello_world is
begin
  process
    variable x: integer;
  begin
    x := fxch(1);
    wait;
  end process;
end behaviour;

--------------------------------------------------------------------------

---------------- fxch.c ------------------------

#include <stdio.h>
int fxch(int x)
{
  printf("hi\n");
  return 0;
}

-------------------------------------------
------- terminal ----------------------------------

$ gcc -c fxch.c

$ ghdl -a t.vhdl

$ ghdl -e -Wl,fxch.o hello_world

$ ./hello_world

hi

$

-------------------------------------------------

This code above uses FUNCTION, however when I use PROCEDURE something goes 
wrong, see below:

------------- t2.vhdl-------------------

package math is
  procedure fxch;
  attribute foreign of fxch : procedure is "VHPIDIRECT fxch";
end math;
     
package body math is
  procedure fxch is
  begin
    assert false severity failure;
  end fxch;
end math;

--  Hello world program.
use std.textio.all; -- Imports the standard textio package.
use work.math.all;

--  Defines a design entity, without any ports.
entity hello_world is
end hello_world;

architecture behaviour of hello_world is
begin
  process
  begin
    fxch;
    wait;
  end process;
end behaviour;

-------------------------------------------------

------- fxch2.c -------------

#include <stdio.h>
void fxch()
{
  printf("hi\n");
}

------------------

--------- terminal -------------

$ gcc -c fxch2.c

$ ghdl -a t2.vhdl 

******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.33 (20150921) [Dunoon edition]
Compiled with GNAT Version: 4.9.2
In directory: /home/pi/
Command line:
/usr/local/bin/ghdl1-llvm -P/usr/local/lib/ghdl/v93/std/ 
-P/usr/local/lib/ghdl/v93/ieee/ -c -o t2.o t2.vhdl
Exception CONSTRAINT_ERROR raised
Exception information:
Exception name: CONSTRAINT_ERROR
Message: ortho_llvm.adb:2911 access check failed
******************************************************************
ghdl: compilation error

-------------------------------------------------------------

 

My system is:

$ uname -a
Linux raspberrypi 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l 
GNU/Linux

 

My ghdl was compiled as follow:

./configure --prefix=/usr/local --with-llvm=/usr

make

make install

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to