Jump to content
Sign in to follow this  
ljepson74

ncvlog: *E,EXPENC - Expecting the keyword 'endclass'.

Recommended Posts

In my earlier UVM days I ran into this confusing error message a number of times.  I just hit it again, so am posting my solution here, to share and to help myself rediscover when it is time.
 
Error (running IUS 13.1):
   uvm_analysis_imp_my_snoop #( xyz_trans, my_scoreboard) my_snoop_port;
                           |
ncvlog: *E,EXPENC (/user/goblin_dev/tb/my_scoreboard.svh,60|50): Expecting the keyword 'endclass'.

 

 
Below is the pseudo code w/o the error.  In converting the real code to pseudo code (to make it more succinct and sterilized), I do not believe I created any inconsistencies, but this is not what was compiled, of course.
 
`uvm_analysis_imp_decl(_my_snoop)


class my_scoreboard extends uvm_scoreboard;

   `uvm_component_utils(my_scoreboard)

    uvm_analysis_imp_my_snoop #( xyz_trans, my_scoreboard) my_snoop_port;

    function void build_phase(uvm_phase phase)
        my_snoop_port = new("my_snoop_port",this);
    endfunction : build_phase

    function void write_my_snoop( xyz_trans t );
        //guts here 
    endfunction : write_my_snoop

endclass : my_scoreboard

 

The error occurred when the following line was missing from above.
  `uvm_analysis_imp_decl(_my_snoop)
 
 
So, without this macro called, the uvm_analysis_imp_my_snoop class is not declared.  So, I would think that the error message would instead say that the class was not found.  (I should try removing some random class that my tb needs and see what error message appears - b/c that is the error message I would expect here as well.)
 
 
Appendix:
The following code is taken from uvm-1.1/uvm_lib/uvm_sv/src/macros/uvm_tlm_defines.svh :

 

// MACRO: `uvm_analysis_imp_decl
//
//| `uvm_analysis_imp_decl(SFX)
//
// Define the class uvm_analysis_impSFX for providing an analysis
// implementation. ~SFX~ is the suffix for the new class type. The analysis
// implemenation is the write function. The `uvm_analysis_imp_decl allows
// for a scoreboard (or other analysis component) to support input from many
// places. For example:
//
//| `uvm_analysis_imp_decl(_ingress)
//| `uvm_analysis_imp_decl(_egress)
//|
//| class myscoreboard extends uvm_component;
//|   uvm_analysis_imp_ingress#(mydata, myscoreboard) ingress;
//|   uvm_analysis_imp_egress#(mydata, myscoreboard) egress;
//|   mydata ingress_list[$];
//|   ...
//|
//|   function new(string name, uvm_component parent);
//|     super.new(name,parent);
//|     ingress = new("ingress", this);
//|     egress = new("egress", this);
//|   endfunction
//|
//|   function void write_ingress(mydata t);
//|     ingress_list.push_back(t);
//|   endfunction
//|
//|   function void write_egress(mydata t);
//|     find_match_in_ingress_list(t);
//|   endfunction
//|
//|   function void find_match_in_ingress_list(mydata t);
//|     //implement scoreboarding for this particular dut
//|     ...
//|   endfunction
//| endclass


`define uvm_analysis_imp_decl(SFX) \
class uvm_analysis_imp``SFX #(type T=int, type IMP=int) \
  extends uvm_port_base #(uvm_tlm_if_base #(T,T)); \
  `UVM_IMP_COMMON(`UVM_TLM_ANALYSIS_MASK,`"uvm_analysis_imp``SFX`",IMP) \
  function void write( input T t); \
    m_imp.write``SFX( t); \
  endfunction \
  \
endclass

 

Share this post


Link to post
Share on other sites
Additional info:

 

[263]irun -version

TOOL:   irun    13.10-s006

 


[264]nchelp ncvlog EXPENC

nchelp: 13.10-s006: © Copyright 1995-2013 Cadence Design Systems, Inc.

ncvlog/EXPENC =

        The keyword 'endclass' was expected to terminate the

        declaration of a class. It was not found.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...