• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Error in UVM code

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 65
  • Views 36856
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error in UVM code

sree205
sree205 over 8 years ago

Hi,

I'm getting the following error when running the UVM code present in the following location. There is a sequence_item example which is present.

www.verificationguide.com/.../uvm-sequence-item.html

When i run it with the following command,

ncvlog -sv -uvmaccess -incdir $UVM_HOME/src mem_seq_item_example.sv

i'm getting the following error.


Can someone suggest why i'm getting the error ? I'm not importing the uvm_pkg in the code coz i've used "-uvmaccess" in the command.


Error I got is :

ncvlog: 14.20-s009: (c) Copyright 1995-2015 Cadence Design Systems, Inc.
class mem_seq_item extends uvm_object;
                                                                     |
ncvlog: *E,SVNOTY (mem_seq_item_example.sv,12|36): Syntactically this identifier appears to begin a datatype but it does not refer to a visible datatype in the current scope.


Suggestions are very much welcome.


~sree205.

  • Cancel
Parents
  • sree205
    sree205 over 8 years ago
    Hi,

    The code which i'm trying to compile is this.

    `include "uvm_macros.svh"

    //-------------------------------------------------------------------------
    //Simple TestBench to access sequence item
    //-------------------------------------------------------------------------
    module seq_item_tb;

    import uvm_pkg::*;

    class mem_seq_item extends uvm_object;
    //data and control fields
    rand bit [3:0] addr;
    rand bit wr_en;
    rand bit rd_en;
    rand bit [7:0] wdata;
    bit [7:0] rdata;

    //Utility and Field macros,
    `uvm_object_utils_begin(mem_seq_item)
    `uvm_field_int(addr,UVM_ALL_ON)
    `uvm_field_int(wr_en,UVM_ALL_ON)
    `uvm_field_int(rd_en,UVM_ALL_ON)
    `uvm_field_int(wdata,UVM_ALL_ON)
    `uvm_object_utils_end


    //Constructor
    function new(string name = "mem_seq_item");
    super.new(name);
    endfunction

    //constaint, to generate any one among write and read
    constraint wr_rd_c { wr_en != rd_en;}

    endclass


    //instance
    mem_seq_item seq_item_0;
    mem_seq_item seq_item_1;

    /* initial begin
    //create method
    seq_item_0 = mem_seq_item::type_id::create("seq_item_0");

    seq_item_0.randomize(); //randomizing the seq_item
    seq_item_0.print(); //printing the seq_item_0

    //clone method
    $cast(seq_item_1,seq_item_0.clone()); //create seq_item_1 and copy seq_item_0 to seq_item_1

    //changing the seq_item_1 values will not reflect on seq_item_0 values.
    seq_item_1.addr = 8;
    seq_item_1.wdata = 'h56;
    `uvm_info("","Printing seq_item_0", UVM_LOW)
    seq_item_0.print(); //printing the seq_item_0
    `uvm_info("","Printing seq_item_1", UVM_LOW)
    seq_item_1.print(); //printing the seq_item_1

    //Note:: name of seq_item_1 will be printed as seq_item_0, because there is no option to pass argument to create method while calling the clone method.
    end
    */
    endmodule

    Error i'm getting is this :

    irun
    -uvm
    copy_vs_clone.sv
    Compiling UVM packages (uvm_pkg.sv cdns_uvm_pkg.sv) using uvmhome location /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d
    import uvm_pkg::*;
    |
    ncvlog: *E,MULPAK (/global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp,4|16): Multiple (2) packages named "uvm_pkg" were found in the searched libraries:
    -> found verilog_package worklib.uvm_pkg:verilog_package (VST)
    -> found verilog_package worklib.uvm_pkg:sv (VST).
    (protected source, `include file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp line 116, file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvm_pkg.sv line 22)
    import uvm_pkg::*;
    |
    ncvlog: *E,NOPBIND (/global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp,4|16): Package uvm_pkg could not be bound.
    (protected source, `include file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp line 116, file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvm_pkg.sv line 22)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • sree205
    sree205 over 8 years ago
    Hi,

    The code which i'm trying to compile is this.

    `include "uvm_macros.svh"

    //-------------------------------------------------------------------------
    //Simple TestBench to access sequence item
    //-------------------------------------------------------------------------
    module seq_item_tb;

    import uvm_pkg::*;

    class mem_seq_item extends uvm_object;
    //data and control fields
    rand bit [3:0] addr;
    rand bit wr_en;
    rand bit rd_en;
    rand bit [7:0] wdata;
    bit [7:0] rdata;

    //Utility and Field macros,
    `uvm_object_utils_begin(mem_seq_item)
    `uvm_field_int(addr,UVM_ALL_ON)
    `uvm_field_int(wr_en,UVM_ALL_ON)
    `uvm_field_int(rd_en,UVM_ALL_ON)
    `uvm_field_int(wdata,UVM_ALL_ON)
    `uvm_object_utils_end


    //Constructor
    function new(string name = "mem_seq_item");
    super.new(name);
    endfunction

    //constaint, to generate any one among write and read
    constraint wr_rd_c { wr_en != rd_en;}

    endclass


    //instance
    mem_seq_item seq_item_0;
    mem_seq_item seq_item_1;

    /* initial begin
    //create method
    seq_item_0 = mem_seq_item::type_id::create("seq_item_0");

    seq_item_0.randomize(); //randomizing the seq_item
    seq_item_0.print(); //printing the seq_item_0

    //clone method
    $cast(seq_item_1,seq_item_0.clone()); //create seq_item_1 and copy seq_item_0 to seq_item_1

    //changing the seq_item_1 values will not reflect on seq_item_0 values.
    seq_item_1.addr = 8;
    seq_item_1.wdata = 'h56;
    `uvm_info("","Printing seq_item_0", UVM_LOW)
    seq_item_0.print(); //printing the seq_item_0
    `uvm_info("","Printing seq_item_1", UVM_LOW)
    seq_item_1.print(); //printing the seq_item_1

    //Note:: name of seq_item_1 will be printed as seq_item_0, because there is no option to pass argument to create method while calling the clone method.
    end
    */
    endmodule

    Error i'm getting is this :

    irun
    -uvm
    copy_vs_clone.sv
    Compiling UVM packages (uvm_pkg.sv cdns_uvm_pkg.sv) using uvmhome location /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d
    import uvm_pkg::*;
    |
    ncvlog: *E,MULPAK (/global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp,4|16): Multiple (2) packages named "uvm_pkg" were found in the searched libraries:
    -> found verilog_package worklib.uvm_pkg:verilog_package (VST)
    -> found verilog_package worklib.uvm_pkg:sv (VST).
    (protected source, `include file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp line 116, file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvm_pkg.sv line 22)
    import uvm_pkg::*;
    |
    ncvlog: *E,NOPBIND (/global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp,4|16): Package uvm_pkg could not be bound.
    (protected source, `include file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvmapi.svp line 116, file: /global/snps_apps/incisiv_14.20.009/linux/tools/methodology/UVM/CDNS-1.1d/additions/sv/cdns_uvm_pkg.sv line 22)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information