• Content count

  • Joined

  • Last visited

About cdnmcgrath

  • Rank
    Junior Member

Profile Information

  • Gender
  • Location
    New Jersey
  • Interests

    Version 1.3


    Simple perl based UVM 1.2 UVC template generator
  2. The config db table is a string based lookup table - the following provides a hierarchy independent set/get pair: uvm_config_db#(myknobs)::set(null,"LKNOBS","lknobs",lknobs); void'(uvm_config_db#(myknobs)::get(null,"LKNOBS","lknobs",lknobs)); This works, but not generally recommended. Jim
  3. A better solution which avoids the need to use p_sequencer uses the pre_randomize() method in the sequence: class otest_seq extends uvm_sequence #(opkt); rand int delay1; myknobs lknobs; function void pre_randomize(); void'(uvm_config_db#(myknobs)::get(get_sequencer(),"","lknobs",lknobs)); this.print(); //option to confirm set/get works as expected endfunction constraint d1 {delay1 == lknobs.mrange;} //uses knob in sequence constraint
  4. Use the same technique but place the config file on the sequencer, such that it exists when the sequence is called. This would involve adding the config object to the sequence class (and allocating / randomizing as illustrated previously). The handle to the object can be set in the connect_phase() or end_of_elaboration_phase() using either set/get as illustrated previously, or direct handle assignment from the test. In that situation, the knobs config class would exist when the sequence is created and randomized as illustrated in your original question. Jim
  5. class myknobs extends uvm_component; `uvm_component_utils(myknobs) function new (string name = "myknobs", uvm_component parent = null);,parent); endfunction rand int mrange; constraint mrange_c { mrange inside {[5:10]};} function void post_randomize(); `uvm_info("MYKNOBS",$sformatf("myknob.mrange=%0d",mrange),UVM_LOW) endfunction : post_randomize endclass sequence: ------------ class otest_seq extends uvm_sequence #(opkt); myknobs lknobs; `uvm_object_utils_begin(otest_seq) `uvm_field_object(lknobs,UVM_PRINT) `uvm_object_utils_end ... task body(); `uvm_info(get_type_name(),"sequence RUNNING",UVM_MEDIUM) void'(uvm_config_db#(myknobs)::get(null,{"uvm_test_top.",get_type_name()},"lknobs",lknobs)); this.print(); //should see handle of "lknobs" printed test: ----- myknobs lknobs; .... virtual function void build_phase(uvm_phase phase); super.build_phase(phase); lknobs=myknobs::type_id::create("lknobs",this); void'(lknobs.randomize()); uvm_config_db#(myknobs)::set(this,"otest_seq","lknobs",lknobs); uvm_config_db#(int)::set(this,"agnt0","is_active",UVM_ACTIVE); .... Use +UVM_CONFIG_DB_TRACE to confirm the set/get is working properly... Once you have the config class in the sequence, you can access it's members as needed. Jim
  6. Version


    Updated with a few bug fixes. Two minor new features added with v1.10: -use_seqr : by default, no sequencer component is created, this switch willforce a custom uvm_sequencer component to be generated (not available with -one_file) -one_file : generate simple uvc in single file - for building small examples
  7. UVM 1.1 template generator - version 1.09



    Version 1.09. Cleaned up version. Added a README. -h (-help) and -t (-template) made a tiny bit smarter.
  8. Version


    First cut of UVM 1.1 template generator. I have incorporated all the key changes from OVM 2.1.1 and UVM 1.0ea to UVM 1.1. To use "perl -help". Assumes perl is in your path. I plan to make some additional changes including adding the new sequence library setup, driving a couple of dummy ports to see real waveforms, and adding a basic scoreboad, Note this is a VERY BASIC template genarator intended to get a user started with UVM - not intended to replace offically supported vendor template generators. This is AE-ware. Note that it still generates "jrun" and "jclean" scripts and should run out-of-the box. User will need to set UVMHOME env. var to point to UVM-1.1 installation. Good luck!
  9. Simple perl based UCV buider



    I have uploaded a copy of my OVM template genarator updated for UVM. Basically, I changed all OVM/ovm strings to UVM/uvm. You will need to set the environment variable UVMHOME to use the generated "jrun" script. You can email me with any Q's - my email is in the perl script. The simplest way to run: perl cd base/examples setenv UVMHOME <path to UVM install> jrun or perl template=cdn_yapp_uvc.tpl (or you own custom template). It supports only basic int datatypes in the sequence item class. It's only intended to get you started and "over the hump". It's not intended to replace the official template generators. Happy UVMing....