• 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. NULL pointer dereference

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 64
  • Views 19215
  • 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

NULL pointer dereference

archive
archive over 17 years ago

Hello Friends,

     I'm building a class based SV UVC using URM methodology. As usual, I've master agent & slave agent with independent monitors in it.
   Now, in my master bfm I've used build operation and casted a new unit(say "X") inside it which is needed for my protocol. So, i've binded my monitor to this unit also as shown below:

class master_bfm extends urm_bfm;
   master_monitor mon_ref;
  
  `urm_unit_utils_begin(master_bfm)
       `urm_field_object(mon_ref, REFERENCE + PRINT)
  `urm_unit_utils_end


  function new(input string name, input urm_unit parent);
       super.new(name,parent);
  endfunction: new

  virtual function build();
     super.build();
     $cast(X, create_unit("X_unit", X));
     X.build();

     X.mon = mon_ref; // Here I'm binding the monitor in X_unit to the monitor in master_bfm
  endfunction: build

 ........my code..................

endclass: master_bfm
 


If you observe the code, I've created a "mon" reference in the X_unit with same master_monitor unit.
 And I tried accessing the variables of monitor like "reset_asserted" in X_unit. It gives "NULL pointer dereference" during the "ncsim" run. I tried all ways of connecting it properly through references but could not succeed. In fact, I could access those monitor variables inside the master_bfm but not in X_unit.

Can anyone lemme know the solution of it or where I went wrong?

Thanks in advance,
Jalli


Originally posted in cdnusers.org by jaally
  • Cancel
  • archive
    archive over 17 years ago

    Jalli,

    Try doing new() of mon_ref in your bfm code. This should solve your problem.

    function new(input string name, input urm_unit parent);
    super.new(name,parent);
    mon_ref = new;
    endfunction: new

    -Vivek


    Originally posted in cdnusers.org by prasad_vc
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Vivek,

    Your suggestion didn't help! :(


    CORRECTION in my above code
    `urm_unit_utils_begin(master_bfm)
    `urm_field_object(X, REFERENCE + PRINT) // This was missing in my above code
    `urm_field_object(mon_ref, REFERENCE + PRINT)
    `urm_unit_utils_end

    Regards,
    Jalli


    Originally posted in cdnusers.org by jaally
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi Vivek,

    Continuing your post,
    If "new" is used an object of monitor will be created in bfm.(as per methodology the monitor will not have object created in the bfm, monitor reference should be there in bfm).

    -Arjun.


    Originally posted in cdnusers.org by arjuny
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Arjun,

    What you say is correct, i haven't used any methodologies with SV, however i knew one thing that you get an "Null pointer Deference" when a "new" of your object or variable is not done.

    I don't knew exactly where it will be done, as per the uRM.

    -Vivek.


    Originally posted in cdnusers.org by prasad_vc
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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