• 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. UVM_CMDLINE_PROCESSOR working issue

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 66
  • Views 15673
  • 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

UVM_CMDLINE_PROCESSOR working issue

mahee424
mahee424 over 9 years ago

Hi,

  I'm trying to get value from command line using UVM_CMDLINE_PROCESSOR but couldn't extract the value from command line with the following trail code;

class onscl extends uvm_object;

    extern function new(String name="onscl");

endclass

function onscl::new(string name = "onscl");
     uvm_cmdline_processor l_cmd = uvm_cmdline_processor::get_inst();
     string onscl_inputs[$];
    

     super.new(name);

     void'(l_cmd.get_arg_values(.match("+LENGTH="),.values(onscl_inputs)));
     foreach(onscl_inputs[i])

     begin

        `uvm_info(get_name(),$psprintf("ONSCL-INPUTS[%0d]:%s",i,onscl_inputs[i]),UVM_LOW)

     end

endfunction

       Please share your suggestion  for getting variable value from command line.

Regards,

mahee


         
  

  • Cancel
Parents
  • Freedi
    Freedi over 4 years ago

    Having the same issue,couldn't extract the value from command line with flowing code ,

    function void start_of_simulation_phase(uvm_phase phase);
        int num; 
        uvm_cmdline_processor clp; 
        string myarg ;
        clp = uvm_cmdline_processor::get_inst();
        num = clp.get_arg_value("+myarg=",myarg);
        if (num)
        begin
            $display("****************");
            $display("STRING=%0s",myarg);
            $display("****************");
        end
    endfunction
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Freedi
    Freedi over 4 years ago

    Having the same issue,couldn't extract the value from command line with flowing code ,

    function void start_of_simulation_phase(uvm_phase phase);
        int num; 
        uvm_cmdline_processor clp; 
        string myarg ;
        clp = uvm_cmdline_processor::get_inst();
        num = clp.get_arg_value("+myarg=",myarg);
        if (num)
        begin
            $display("****************");
            $display("STRING=%0s",myarg);
            $display("****************");
        end
    endfunction
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • StephenH
    StephenH over 4 years ago in reply to Freedi

    Works for me:

    // clp.sv
    `include "uvm_macros.svh"
    module clp;
    import uvm_pkg::*;
    class clptest extends uvm_test;
    `uvm_component_utils(clptest)
    function new (string name="clptest", uvm_component parent=null);
    int num;
    uvm_cmdline_processor clp;
    string myarg ;
    super.new(name,parent);
    clp = uvm_cmdline_processor::get_inst();
    num = clp.get_arg_value("+myarg=",myarg);
    if (num)
    begin
    $display("****************");
    $display("STRING=%0s",myarg);
    $display("****************");
    end
    endfunction
    endclass
    initial run_test("clptest");
    endmodule

    % xrun clp.sv -uvmhome CDNS-1.1d +myarg=abcd
    TOOL: xrun 20.10-a001: Started on Nov 23, 2020 at 13:33:27 GMT
    xrun: 20.10-a001: (c) Copyright 1995-2020 Cadence Design Systems, Inc.
    Loading snapshot worklib.clp:sv .................... Done
    SVSEED default: 1

    <snip>

    (Specify +UVM_NO_RELNOTES to turn off this notice)

    ****************
    STRING=abcd
    ****************
    UVM_INFO @ 0: reporter [RNTST] Running test clptest...

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • muffi
    muffi over 4 years ago in reply to Freedi

    Make sure that you do not have the "-define UVM_NO_DPI" or "+define+UVM_NO_DPI" enabled. These will disable the Command Line Interface.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Freedi
    Freedi over 4 years ago in reply to muffi

    thanks solved now , that was the issue.

    • 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