failure to compile a Scoreboard in Modelsim DE using osvvm 2018.04

Why OSVVM™? Forums OSVVM failure to compile a Scoreboard in Modelsim DE using osvvm 2018.04

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1465

    Hello OSVVM forum, and Jim 🙂 

    I am using Modelsim DE 32 bit under UBUNTU, i have turned an the -2008 switch in all my VHDL files.

    I have made a generic package for my scorecboard as follows:

    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;

    library osvvm;
    context osvvm.OsvvmContext;
    use osvvm.all;

    use work.osvvm_testbench_pkg.all;
    use work.design_package.ETHER_IPv4_ESP_TYPE;

    package ScoreBoardPkg_IPv4Pkg_wrapper is

          — reference the package that define types and functions.
    — use std.standard.all ; — implicitly included
    package ScoreBoardPkg_IPv4Pkg is new ScoreBoardGenericPkg
    generic map (
    ExpectedType       => ETHER_IPv4_ESP_TYPE,
    ActualType         => ETHER_IPv4_ESP_TYPE,
    match              => ETHER_IPv4_ESP_MATCH,
    expected_to_string => ETHER_IPv4_ESP_TYPE_to_string,
    actual_to_string   => ETHER_IPv4_ESP_TYPE_to_string
    );

    end package ScoreBoardPkg_IPv4Pkg_wrapper;

    I have been trying to compile a scoreboard without success for a couple of hours now. The error message i get is this :

    — Compiling architecture Behavioral of osvvm_testbench
    # ** Error: /home/barry2/vivado_projects/packetDecoder200G/packetDecoder200G/packetDecoder200G.srcs/sim_1/new/osvvm_testbench.vhd(132): A member of an uninstantiated package is referenced outside the scope of the package.

    I may have instantiated the scoreboard incorrectly in my testbench… i could not get my generic package to work either directly inside my testbench which is why i am trying to reference it from within another package file as above. All my code compiles except for this error. I am thinking i must have missed a step alomg the way. I have been follwoing Jim’s examples in his Scoreboard Generic Package User Guide
    User Guide for Release 2017.05

    My testbench (as far as this generic scoreboard goes) looks like this :

    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.NUMERIC_STD.ALL;
    use IEEE.std_logic_textio.all;

    library UNISIM;
    use UNISIM.VComponents.all;

    library std;
    use std.textio.all;
    use std.env.all;

    library osvvm;
    context osvvm.OsvvmContext;
    use osvvm.all;

    –**********************************************************************************************************************

    — Packages with user Defintions for Simulation

    –**********************************************************************************************************************
    use work.design_package.BUI_TYPE;
    use work.design_package.ETHER_IPv4_ESP_TYPE;
    use work.ScoreBoardPkg_IPv4Pkg_wrapper.all;
    use work.osvvm_testbench_pkg.all;

    entity osvvm_testbench is

    end entity osvvm_testbench;

    architecture Behavioral of osvvm_testbench is

        use work.ScoreBoardPkg_IPv4Pkg_wrapper.all;

    …… then just before the architecture begin i have this shared variable defined as a Protcted Type for my scoreboard instance :

    shared variable ScoreBrd : osvvm.ScoreboardGenericPkg.ScoreBoardPType;

    Can anybody help me figure out where i am going wrong please ?

    thanks, Dr Barry H

    #1467
    Jim Lewis
    Member
    Hi Barry,
    A package instance creates a package.   For example, for integer, all you need is:
    use std.textio.all ;
    library ieee ;
      use ieee.std_logic_1164.all ;
      use ieee.numeric_std.all ;

    package ScoreBoardPkg_int is new work.ScoreboardGenericPkg
      generic map (
        ExpectedType        => integer, 
        ActualType          => integer, 
        Match               => "=", 
        expected_to_string  => to_string, 
        actual_to_string    => to_string   
      ) ; 

    Hence, the “wrapper package” in your example is both extra work and problematic.  Remove it and if you don’t have other errors you should be fine.

    Best Regards,

    Jim

    #1472

    Hi Jim, Many thanks for your answer. My problem is that i have tried every which way to get things to compile and i always get errors.

    My scoreboard generic package is defined like this now in a seperate design unit (i.e. a VHDL file):

    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;

    library osvvm;
    –use osvvm.OsvvmContext;
    use OSVVM.ScoreboardGenericPkg;

    use work.osvvm_testbench_pkg.ETHER_IPv4_ESP_MATCH;
    use work.osvvm_testbench_pkg.ETHER_IPv4_ESP_TYPE_to_string;
    use work.design_package.ETHER_IPv4_ESP_TYPE;

    package ScoreBoardPkg_IPv4Pkg is new ScoreBoardGenericPkg
    generic map (
    ExpectedType       => ETHER_IPv4_ESP_TYPE,
    ActualType         => ETHER_IPv4_ESP_TYPE,
    match              => ETHER_IPv4_ESP_MATCH,
    expected_to_string => ETHER_IPv4_ESP_TYPE_to_string,
    actual_to_string   => ETHER_IPv4_ESP_TYPE_to_string
    );

    In my testbench i reference my new package instance like this

    use work.ScoreBoardPkg_IPv4Pkg.all;

    And i am wondering where do i make the instantiation ? I have tried like this in my testbench :

    architecture Behavioral of osvvm_testbench is

         use work.ScoreBoardPkg_IPv4Pkg.all;

    And when compiling my design in Modelsim i get this error

     — Loading package ScoreboardGenericPkg
    # ** Error: /home/barry2/vivado_projects/packetDecoder200G/packetDecoder200G/packetDecoder200G.srcs/sim_1/new/osvvm_testbench.vhd(45): A member of an uninstantiated package is referenced outside the scope of the package.
    # — Loading package design_package
    # — Loading context declaration OsvvmContext
    # — Loading package osvvm_testbench_pkg
    # ** Error: /home/barry2/vivado_projects/packetDecoder200G/packetDecoder200G/packetDecoder200G.srcs/sim_1/new/osvvm_testbench.vhd(65): VHDL Compiler exiting
    # End time: 08:43:03 on Aug 01,2018, Elapsed time: 0:00:00
    # Errors: 2, Warnings: 0
    # ** Error: /home/barry2/msim32bit/modelsim_dlx/linuxpe/vcom failed.

    So i don’t understand why i get this error because i (think !) that i have instantiated my new scoreboard package based on ScoreboardGenericPkg in my design unit : ScoreBoardPkg_IPv4Pkg.vhd

    and this package does compile fine…i have implemented some functions for the match, expected_to_string and actual_to_string ports and i have referenced this new instantiation with my include clause.

    Can you please help explain where i am going wrong Jim ?

    cheers, Barry

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.