Jump to content

mpeer

Members
  • Content Count

    13
  • Joined

  • Last visited

About mpeer

  • Rank
    Junior Member
  • Birthday 10/20/1982
  1. Hi enchanter, I made change in run_phase(). I moved trans t = new() inside repeat(10); Below is the code after change. task run_phase(uvm_phase phase); // trans t = new(); // Removed from this line trans t2; $display("Fifo capacity is %0d", fifo.size()); $display("Putting elements.."); repeat(10) begin trans t = new(); // Moved here; Now for each item there will be new handle. t.randomize(); t.print(); pp.put(t); // Putting into the fifo. $display("Fifo is filled with %0d element(s)", fifo.used()); end $display("Retrieving elements.."); repeat(10) begin gp.get(t2); t2.print(); $display("Fifo size after retieving one element is %0d element(s)", fifo.used()); t2 = null; end Regards Peer Mohammed
  2. Thanks Janick for quick reply. Now its working fine.. Thanks Peer Mohammed
  3. Hi All, I am trying to use tlm fifo. At first putting 10 elements after that I tried getting those elements but I always get the last data from uvm_tlm_fifo. Below is the complete code and the simulation result. Please let me know how should I use it so that I can retrieve all the elements which are being fed into it. I know, I have put_port, get_port and fifo all three inside single component and have connections here itself. It is done intentionally. ===================================================================== Code Here ===================================================================== import uvm_pkg::*; class trans extends uvm_sequence_item; `uvm_object_utils(trans) rand int a; rand int b; function new(string name="trans"); super.new(name); endfunction function void do_print(uvm_printer printer); super.do_print(printer); $display("A =%0h", a); $display("B =%0h", ; endfunction endclass //-----------------------------------// //-----------------------------------// class mon extends uvm_component; `uvm_component_utils(mon) uvm_tlm_fifo #(trans) fifo; uvm_blocking_put_port #(trans) pp; uvm_blocking_get_port #(trans) gp; function new(string name = "sb", uvm_component parent = null); super.new(name, parent); endfunction function void build_phase (uvm_phase phase); super.build_phase(phase); fifo = new ("fifo", this, 100); pp = new ("put_port", this); gp = new ("get_port", this); endfunction function void connect_phase(uvm_phase phase); pp.connect(fifo.put_export); gp.connect(fifo.get_export); endfunction task run_phase(uvm_phase phase); trans t = new(); trans t2; $display("Fifo capacity is %0d", fifo.size()); $display("Putting elements.."); repeat(10) begin t.randomize(); t.print(); pp.put(t); $display("Fifo is filled with %0d element(s)", fifo.used()); end $display("Retrieving elements.."); repeat(10) begin gp.get(t2); t2.print(); $display("Fifo size after retieving one element is %0d element(s)", fifo.used()); t2 = null; end endtask endclass //-----------------------------------// //-----------------------------------// module test; class test1 extends uvm_test; `uvm_component_utils(test1) mon m; function new(string name="test1", uvm_component parent); super.new(name, parent); endfunction function void build_phase (uvm_phase phase); m = mon::type_id::create("mon", this); endfunction : build_phase endclass initial begin run_test("test1"); end endmodule ================================================================= Simulation Result: ================================================================= UVM_INFO @ 0: reporter [RNTST] Running test test1... Fifo capacity is 100 Putting elements.. A =ca343fb9 B =94149dec Fifo is filled with 1 element(s) A =13ab51b1 B =f262ab77 Fifo is filled with 2 element(s) A =76906067 B =8c595989 Fifo is filled with 3 element(s) A =a72b2dd1 B =cfc3e29a Fifo is filled with 4 element(s) A =bddac76f B =517829e8 Fifo is filled with 5 element(s) A =ec897a2a B =88742996 Fifo is filled with 6 element(s) A =f5901441 B =89d0eac5 Fifo is filled with 7 element(s) A =dd44e7b3 B =7661e07a Fifo is filled with 8 element(s) A =786cb3a3 B =2a109a17 Fifo is filled with 9 element(s) A =661c7064 B =ec640f5a Fifo is filled with 10 element(s) Retrieving elements.. A =661c7064 B =ec640f5a Fifo size after retieving one element is 9 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 8 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 7 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 6 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 5 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 4 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 3 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 2 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 1 element(s) A =661c7064 B =ec640f5a Fifo size after retieving one element is 0 element(s)
  4. Hi, Have you used "-full64 -debug_all" options in your compilation command? If not, try with these options. If still it doesn't work add another option "-picarchive" Regards Peer Mohammed
  5. Hi mrforever, One of my colleague had similar issue. try the same code without "typedef" chpp_sigif duv_if(); // SystemVerilog Interface ... initial begin uvm_config_db#(virtual interface chpp_vif)::set(uvm_root::get(), "*", "duv_if", duv_if); run_test(); end Regards Peer Mohammed
  6. Hi All, I am trying to keep my testbench scale able as we do in RTL files using genvars. I want to have queues of a transaction class inside my scoreboard class. e.g. monitor_trans exp_trans_port1[$]; monitor_trans exp_trans_port2[$]; monitor_trans exp_trans_port3[$]; monitor_trans exp_trans_port4[$]; .... I want to scale them in such a way that if you modify the parameters then such instantiations may increase or decrease. To achieve this I cannot use "for loop" here (It gives compilation error). I tried using `define portname(name) monitor_trans name`` [$] ==> This also did not work. Please let me know if you have some idea on this? Let me know if more clarification required. Regards Peer Mohammed
  7. Hi Peter, I am using VCS Version F-2011.12. I downloaded UVM package from Accelara site: UVM version uvm-1.1c. When I compile this package using VCS tool. I get such error. Regards Peer Mohammed
  8. Hi SeanChou, If you are using vcs tool, there are some examples in <INSTALL_PATH>/doc/examples/systemc/vcs/SV_SC_analysis and <INSTALL_PATH>/doc/examples/systemc/vcs/SC_SV_analysis These examples might be useful for you. Regards Peer Mohammed
  9. Hi All, I am using VCS Version F-2011.12. While compiling uvm-1.1c package, I am getting compilation in some of the macro files. Error comes in next line where single line comment is present (in between the definition of `define) E.g. File: $UVM_PKG_PATH/uvm-1.1c/src/macros/uvm_object_defines.svh 1. `define uvm_field_utils_end \ 2. if(what__ inside {UVM_SETINT,UVM_SETSTR,UVM_SETOBJ}) begin \ 3. // remove all scopes recorded (through super and other objects visited before) \ 4. void'(__current_scopes.pop_back()); \ 5. __m_uvm_status_container.m_uvm_cycle_scopes = __current_scopes; \ 6. end \ 7. end \ 8. endfunction Because of single line comment at line 3 (mentioned in above code), Error comes in line 4. I changed all such comment in required files with multi-line comment and addtional space before backslash. Line 3 after change: 3. /* remove all scopes recorded (through super and other objects visited before) */ \ Compilation is through with this change. Please let me know if there is any other option to get rid of such issues. Thanks and Regards Peer Mohammed
  10. Finally... That is not a bug. The default entry for an object is ‘null’. The comment “a new item is created with that key” refers to the pool entry, not the object in the pool. Regards, Peer Mohammed
  11. Hi, In my example I am using uvm_pool as a pool of type uvm_event (similar to ovm_event_pool as in OVM). In OVM also, If no event exists by that name, a new event is created with that name and returned. Please refer to OVM code. I am expecting the similar code in UVM. Otherwise we must change the comment for the "get" function and must have to new() our item then add to the pool before using it(Other Way to achieve the same functionality). Regards Peer Mohammed
  12. Hi All, I tried using uvm_pool in my environment. Class: uvm_pool Below is the code in uvm package uvm-1.0-p1: // Function: get // // Returns the item with the given ~key~. // // If no item exists by that key, a new item is created with that key // and returned. virtual function T get (KEY key); if (!pool.exists(key)) begin T default_value; pool[key] = default_value; end return pool[key]; endfunction In above code, default_value is added to the pool without making it new() (Bold lines above). As per the comments, I am expecting non-null item even if it does not exist in the pool. If the above code is written with the intention of having global pool which can have only the existing objects(non-null) then the above written comments for the function must be changed. Code Should be like: // Function: get // // Returns the item with the given ~key~. // // If no item exists by that key, a new item is created with that key // and returned. virtual function T get (KEY key); if (!pool.exists(key)) begin T default_value; default_value = new(); pool[key] = default_value; end return pool[key]; endfunction Please let me know if it is a bug? Thanks and Regards Peer Mohammed
  13. Hi You may probably use the following code: my_class obj[]; obj = new[10]; for(int i=0;i<10;i++) begin $sformat(str,"obj_%0d",i); obj = my_class::type_id::create(str, this); end The above code will create the obj_0, obj_1, obj_2, obj_3 ..... obj_9. I hope this is what you required. This code was working without any error. Regards Peer Mohammed
×
×
  • Create New...