Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem compiling UVVM libraries with GHDL #649

Closed
smislata opened this issue Sep 10, 2018 · 3 comments
Closed

Problem compiling UVVM libraries with GHDL #649

smislata opened this issue Sep 10, 2018 · 3 comments
Labels
FeaReq: VHDL-2008 Requested feature addition related to VHDL-2008.
Milestone

Comments

@smislata
Copy link

Description
I am trying to install the last version of the UVVM libraries for VHDL 2008 with the provided script and it fails when it compiles the first file, following the order suggested by the developers.

Context

smislata@DASPC061:/usr/local/lib/ghdl/vendors$ ./compile-uvvm.sh --uvvm --src ~/git/UVVM_GHDL/UVVM/ --out /opt/Xilinx/UVVM-lib-last/
Creating vendor directory: '/opt/Xilinx/UVVM-lib-last'.
Compiling library 'uvvm_util'...
Analyzing package '/home/smislata/git/UVVM_GHDL/UVVM/uvvm_util/src/types_pkg.vhd'
/home/smislata/git/UVVM_GHDL/UVVM/uvvm_util/src/types_pkg.vhd:141:88: can't match 'c_info_on_finishing_await_any_completion_vvc_name_default' with type character
/usr/local/bin/ghdl: compilation error

It is only pasted the first messages, since the rest of the files are not compiled either due to some dependencies with the first file (type_pkg.vhd), but if needed, I can copy the rest of the messages.

  • OS:
Ubuntu 18.04.1 LTS \n \l
  • GHDL Version:
GHDL 0.36-dev (v0.35-191-ge135fe7f) [Dunoon edition]
 Compiled with GNAT Version: 7.3.0
 GCC back-end code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2015 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@diogratia
Copy link

-- type for identifying VVC and command index finishing await_any_completion()
  type t_info_on_finishing_await_any_completion is record
    vvc_name                : string(1 to 100); -- VVC name should not exceed this length
    vvc_cmd_idx             : natural;          -- VVC command index
    vvc_time_of_completion  : time;             -- time of completion
  end record;
 
type t_uvvm_status is record
    found_unexpected_simulation_warnings_or_worse     : natural range 0 to 1; -- simulation end status: 0=no unexpected, 1=unexpected
    found_unexpected_simulation_errors_or_worse       : natural range 0 to 1; -- simulation end status: 0=no unexpected, 1=unexpected
    mismatch_on_expected_simulation_warnings_or_worse : natural range 0 to 1; -- simulation status: 0=no mismatch, 1=mismatch
    mismatch_on_expected_simulation_errors_or_worse   : natural range 0 to 1; -- simulation status: 0=no mismatch, 1=mismatch
    info_on_finishing_await_any_completion            : t_info_on_finishing_await_any_completion; -- await_any_completion() trigger identifyer
  end record t_uvvm_status;

  -- defaults for t_uvvm_status and t_info_on_finishing_await_any_completion
  constant C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT : string := "no await_any_completion() finshed yet\n";
  constant C_UVVM_STATUS_DEFAULT : t_uvvm_status := (
    found_unexpected_simulation_warnings_or_worse     => 0,
    found_unexpected_simulation_errors_or_worse       => 0,
    mismatch_on_expected_simulation_warnings_or_worse => 0,
    mismatch_on_expected_simulation_errors_or_worse   => 0,
    info_on_finishing_await_any_completion            => (vvc_name    => (C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT, others => ' '),
                                                          vvc_cmd_idx => 0,
                                                          vvc_time_of_completion => 0 ns)
);

Here

constant C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT : string := "no await_any_completion() finshed yet\n";

Line 141 is the info_on_finishing_await_any_completion association where the aggregate (C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT, others => ' ') isn't a -2008 feature supported by ghdl (as yet).

You could patch around this problem:

     constant sixty_spaces:    string(1 to 60) := (others => ' ');  -- ADDED constant

      -- defaults for t_uvvm_status and t_info_on_finishing_await_any_completion
      constant C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT : string := "no await_any_completion() finshed yet\n";
      constant C_UVVM_STATUS_DEFAULT : t_uvvm_status := (
        found_unexpected_simulation_warnings_or_worse     => 0,
        found_unexpected_simulation_errors_or_worse       => 0,
        mismatch_on_expected_simulation_warnings_or_worse => 0,
        mismatch_on_expected_simulation_errors_or_worse   => 0,
        info_on_finishing_await_any_completion            => (
           vvc_name    =>  --(C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT, others => ' '),
   C_INFO_ON_FINISHING_AWAIT_ANY_COMPLETION_VVC_NAME_DEFAULT & sixty_spaces,  
          vvc_cmd_idx => 0, vvc_time_of_completion => 0 ns)
    );

Although I'd suspect you might find more as yet unsupported -2008 features UVVM relies on here.

@smislata
Copy link
Author

Yep, that was the part where I found that problem, and indeed the patch passes the error. However, after that, some GHDL bug happened. I consider this same issue is the proper place to report about it.

Analyzing package '/home/smislata/git/UVVM_GHDL/UVVM/uvvm_util/src/string_methods_pkg.vhd'

******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 0.36-dev (v0.35-191-ge135fe7f) [Dunoon edition]
Compiled with GNAT Version: 7.3.0
Target: x86_64-linux-gnu
In directory: /opt/Xilinx/UVVM-lib-last/uvvm_util/v08/
Command line:
/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/ghdl1 -fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments --std=08 --work=uvvm_util -P/opt/Xilinx/UVVM-lib-last/ -P/usr/local/lib/ghdl/ieee/v08/ -P/usr/local/lib/ghdl/ -quiet -o string_methods_pkg.s /home/smislata/git/UVVM_GHDL/UVVM/uvvm_util/src/string_methods_pkg.vhd
Exception TYPES.INTERNAL_ERROR raised
Exception information:
raised TYPES.INTERNAL_ERROR : trans-chap3.adb:3094
Call stack traceback locations:
0x6f7956 0x6eb3b2 0x6ee2d5 0x72f321 0x70c11d 0x72f4d5 0x70c11d 0x70eb23 0x70e0d5 0x70ec6c 0x70e0d5 0x70e179 0x70e3b3 0x70fabd 0x6fd7bd 0x72452c 0x6feab2 0x6ddccd 0x6d2b0a 0x6d16d7 0x60dd88 0xae448c 0x6081fb 0x613869 0x73bdf9 0x606928 0x7fed7183fb95 0x60a6b8 0xfffffffffffffffe
******************************************************************

Execution terminated by unhandled exception
raised TYPES.INTERNAL_ERROR : trans-chap3.adb:3094
Call stack traceback locations:
0x6f7956 0x6eb3b2 0x6ee2d5 0x72f321 0x70c11d 0x72f4d5 0x70c11d 0x70eb23 0x70e0d5 0x70ec6c 0x70e0d5 0x70e179 0x70e3b3 0x70fabd 0x6fd7bd 0x72452c 0x6feab2 0x6ddccd 0x6d2b0a 0x6d16d7 0x60dd88 0xae448c 0x6081fb 0x613869 0x73bdf9 0x606928 0x7fed7183fb95 0x60a6b8 0xfffffffffffffffe
/usr/local/bin/ghdl: compilation error

@diogratia
Copy link

diogratia commented Sep 10, 2018

That's another unimplemented -2008 feature, unbounded arrays (distinct from prevision revisions unconstrained array definition).

 function Index_Base (Base : Mnode; Atype : Iir; Index : O_Enode)
                        return Mnode
   is
      El_Type  : constant Iir := Get_Element_Subtype (Atype);
      El_Tinfo : constant Type_Info_Acc := Get_Info (El_Type);
      Kind     : constant Object_Kind_Type := Get_Object_Kind (Base);
   begin
      if Is_Unbounded_Type (El_Tinfo) then
         --  return Reindex_Unbounded_Array (Base, Atype, Index, El_Tinfo);
         --  TODO
         raise Internal_Error;
      elsif Is_Complex_Type (El_Tinfo) then
         return Reindex_Complex_Array (Base, Atype, Index, El_Tinfo);
      else
         return Lv2M (New_Indexed_Element (M2Lv (Base), Index),
                      El_Tinfo, Kind);
      end if;
   end Index_Base;

The error is following the TODO comment and is uncomplete at this time (Tristan may view your squeaky wheel compliant seriously enough to create an actual error message.)

After reviewing IEEE Std 1076-2008 5.3.2 Array types you may find yourself equipped to identify the declaration causing the problem in string_methods_pkg.vhd. (There may be more than one, they may not be easy to patch.)

Of note is thast the vendors/compile-uvvm.sh script you're invoking is intended for an earlier version of uvvm. While I've never succeeded using any of Paebell's vendors scripts on MacOS It's possible to analyze uvvm 1.1.0:

make
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util adaptations_pkg.vhdl
adaptations_pkg.vhdl:198:19:warning: type of a shared variable must be a protected type [-Wshared]
adaptations_pkg.vhdl:259:14:warning: package "adaptations_pkg" does not require a body [-Wbody]
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util string_methods_pkg.vhdl
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util protected_types_pkg.vhdl
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util hierarchy_linked_list_pkg.vhdl
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util alert_hierarchy_pkg.vhdl
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util license_pkg.vhdl
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util methods_pkg.vhdl
methods_pkg.vhdl:31:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:32:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:33:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:34:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:35:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:36:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:37:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:38:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:39:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:40:19:warning: type of a shared variable must be a protected type [-Wshared]
methods_pkg.vhdl:41:19:warning: type of a shared variable must be a protected type [-Wshared]
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util bfm_common_pkg.vhdl
/usr/local/bin/ghdl -a  --std=08 -frelaxed-rules --work=uvvm_util uvvm_util_context.vhdl

I'd suspect the script is intended for an earlier version of uvvm, it doesn't specify a version.

While you can show disappointment in ghdl not fully supporting -2008 features yet (in this question so far aggregates and unbounded arrays), UVVM requires pre -2002 shared variables, while standard revisions -2002 and -2008 require shared variables be protected types. Such a requirement is not guaranteed to produce a portable design specification (Tristan added the shared variable protected type semantic requirement to -frelaxed-rules to support an early UVVM version).

You could imagine without validation any of the vendors scripts might be out of date.

tgingold added a commit that referenced this issue Sep 18, 2018
@tgingold tgingold reopened this Sep 18, 2018
@Paebbels Paebbels added this to the v0.36 milestone Sep 18, 2018
@Paebbels Paebbels added Bug FeaReq: VHDL-2008 Requested feature addition related to VHDL-2008. and removed Bug labels Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeaReq: VHDL-2008 Requested feature addition related to VHDL-2008.
Projects
None yet
Development

No branches or pull requests

4 participants