Jump to content

swapnilm

Members
  • Content Count

    83
  • Joined

  • Last visited

Everything posted by swapnilm

  1. Dear All, I need to send some high impedance/IDLE symbols (eg 101010...) between the two packets/frames for long time. So is it possible in UVM to send some random data (not through packets in the form of bytes)? If yes, how do I do it? Can this be done through some constraint variables, set in a config db object? Its urgent, so any guidance, regarding the process, will be appreciated. Thanks
  2. Hello all, Can there be more than one different kinds of sequences, containing different kinds of pkts, be nested in one single sequence? so that the test case scenerio, will be to show different kinds of pkts,going one after another in a single sequence to the driver? Please guide,thanks
  3. Can some uvm expert please throw some light on this topic? Thanks
  4. Dear all, I need to create different kinds of packets, for eg nested packets(one or more pkts encapsulated in another pkt), simple packets etc, of the same protocol. Can these different kinds of pkts be made/created (as an object) from the same transaction class? If yes, how shall I manage the packing/unpakcing(do_pack/do_unpack functions) of their bytes, as the bytes travel scenerios, will vary from pkt to pkt? OR if I am creating different classes for each different kind of pkt structure, then will they be controlled properly from sequences, in order to create testcase scenerios? Any guidance will be helpfull. Thanks
  5. Dear All, Is it always the case that the TOP test class can control/manage the control knobs of sequences only? I mean, I want to override/control some parameters of driver class from top test class, can this be done? If yes, how can that be done? because top test class stimulates only a sequence, so how would the control knob of driver be controlled from top test class? any guidance will be helpfull. Thanks
  6. Hello mea1201, Actually I need to send different kind of data pkts. In here, there will be a traffic to send only NACK(for missed pkts) bytes (received from monitor) to be sent to the driver. This is high priority data. So I want to know that, there is a single driver, and it can receive one pkt at a time through get_next_item. I am not able to know how the driver would know/respond to these priorities? I mean the driver should respond to these NACK bytes first and not to the normal traffic pkts. It may be possible by setting the priority of sequences from sequencer. Is that correct? Please guide me through. Thanks
  7. Hello all, Can I have 3 TLMs connected between a single sequencer and a single driver in UVM? In other words, I want 3 pipes/TLM connections to send three different kind of packets to the same driver from the same sequencer. Or in other words, can a sequencer has 3 exports? Can a diver has 3 ports, so that they can be connected with each other? Please guide, thanks
  8. swapnilm

    Nesting of frames in UVM?

    Hi mea1201, I actually want to insert one(or more) packets into another packet.This encapsualtion of pkts will start from the second byte of the header. I didnt really get what you said. Could you please elaborate a little more. Thanks
  9. Hello all, I want to create nested frames/packets. My packet structure is shown below. I want to have nested frames(one or more frames within another frame) starting from 2nd byte of header and before the EOF/EOT. Please give me some guidance of how to include nested frames into another frames in UVM? What are the methods/macros in UVM which will be usefull in this regard. [/code] rand bit [7:0] sync; rand bit [7:0] sof; rand bit [15:0] header; rand bit [7:0] payload[]; rand bit [15:0] crc; rand bit [7:0] eof; //Or EOT(end of transmission) [/code] Any help/suggestion is appreciated. Thanks,
  10. Hello All, I need to send some bytes/packets(which are received from the DUT, for eg. NACK for missed packets) to the driver. So can I directly connect the monitor to the driver, without going through the sequencer? In other words, I want to connect one TLM between monitor and driver, can this be done? Please guide, Thanks
  11. Hello all, I am receiving serial bits in the monitor from DUT. This is RX path and independent from TX path i.e driver path. Then I have to make parallel data out of it using sipo(serial in parallel out) and then I have to decode the data to form the packet from the decoded bytes. In order to receive the all the bits of all the packets in RX path(monitor class), I have to give packet_length inside the for loop. Right now in order to check he functionality of monitor (in loop back mode), I am sending only one packet(8 bytes) so I know the number of bits, which I can use for packet_length parameter. But I want to make it generic because in real world I wont know how many packets might be coming. So the issue is, Is there any generic way in UVM to calculate the number of bytes(OR serial bits) coming into monitor? Is there any uvm method by which I can find this packet_length in a generic way? Packet structure is shown below: class transaction extends uvm_sequence_item; rand bit [7:0] sync; rand bit [7:0] sof; rand bit [15:0] header; rand bit [7:0] payload[]; rand bit [15:0] crc; rand bit [7:0] eof; constraint data_size_c { payload.size inside { [6 : 6]};}; ............. ............. endclass: transaction class monitor extends uvm_monitor; ..... virtual task run_phase(uvm_phase phase); transaction pkt; forever begin int pkt_len = 130; //This is in bits,HERE I NEED TO PASS THE CALCULATED LENGTH FROM SOME GENERIC UVM FUNCTION,TO START RECEIVING ALL THE SERIAL BITS. repeat(3)@(dut_vi.clock); for (int j = 0; j < pkt_len; j++) begin serialin = dut_vi.data; $display("san14- Display of the serial line serialin %b",serialin); $display("san15- Display of the Serial Line dut_vi.data %b",dut_vi.data); sipo(serialin); end void'(decode(bytes)); pkt = transaction::type_id::create("pkt1"); $display("SM447- Display of the bytes array received after decoding %h",decdrout2); void'(pkt.unpack_bytes(decdrout2)); uvm_report_info(get_full_name(),"Decoded completely 10bits into 8bits ...",UVM_LOW); uvm_report_info(get_full_name(),"Started unpacking of received bytes ...",UVM_LOW); pkt.print(); uvm_report_info(get_full_name(),"Completed unpacking of received bytes ...",UVM_LOW); Montr2Agnt_port.write(pkt); end uvm_report_info(get_full_name(),"Sending received packet from monitor to the Scoreboard ...",UVM_LOW); endtask: run_phase ........... .......... endclass: monitor Any help is appreciated, thanks
  12. swapnilm

    Nesting of frames in UVM?

    Can someone please give me some idea about it? What could be the UVM methods to create nested frames? Would appreciate it. Thanks,
  13. Dear All, I am getting one strange error while using questasim 10.2a. While simulating 1st time, it simulates properly, all the packages, libraries get loaded fine. But when I tried to simulate the design 2nd time, the Questasim gets stuck forever while loading the libraries and packages, and further doesnt simulate it. So I have to restart the tool. This process is happening again and again, And it gets stuck again at the 2nd time while simulating. What might be the error/problem happenning here? I am using the license server for this. Please help me to debug this error. Thanks,
  14. Can someone please give reply to this, I would appreciate it. Thanks
  15. Hello all, How do I set priorities for some features, to be added in a transaction class? Is there any method in UVM for that? For eg. when I get a NACK, I need to respond to it quickly and resend the same frame or (a nested frame), in priority. Can some one please give me some guggestions for this? How do I include this feature in a transaction/packet class? Thanks,
  16. Dear All, I am getting one strange error while using questasim 10.2a. While simulating 1st time, it simulates properly, all the packages, libraries get loaded fine. But when I tried to simulate the design 2nd time, the Questasim gets stuck forever while loading the libraries and packages, and further doesnt simulate it. So I have to restart the tool. This process is happening again and again, And it gets stuck again at the 2nd time while simulating. What might be the error/problem happenning here? I am using the license server for this. Please help me to debug this error. Thanks,
  17. Hello mea1201, Yea, what you are saying makes sense. But I want to know that, in the end, the packets are travelling as an object to the monitor and I can get the packet length when I pack the packet bytes in do_pack function (in transaction class itself). So I know whats the length of the packet before even I send the packet to driver/ monitor. So in this way, I will have packet length for each and every packet beforehand, even before I send it across. So can this not be done, if I happen to pass the Variable in which I stored that packet length, through a package, to the monitor? This is my question? I hope whatever I am saying is understandable. Can this be done? Please throw some light. I appreciate your feedback.
  18. hello all, Can I get to know the packet length from a Packing function(i.e. do_pack), like by using get_packed_size() method in do_pack function? So that I would know the packet length up in advance even before I receive that packet in monitor. Can this be done? please give some feedback, would appreciate it. Thanks,
  19. Hello All, I want to connect driver directly to the monitor,(not going through any DUT). So how does it work? Which TLM can be used and how? Can someone plz help in this regard? The transaction packets are being sent from driver to monitor in byte form. So please guide me through. Thanks, Swapnil
  20. Hello Samrat, that will be great, thanks.
  21. Hello all, I am stuck at one place. I want to unpack my payload bytes which are actually produced by dynamic array. Some uvm geeks suggested me to use another parameter,length, in order to unpack the size of the payload but the specifications doesnt allow me to do that. Please find below the transaction class code. And some part of monitor class run phase. Transaction class:- class transaction extends uvm_sequence_item; rand bit [7:0] sync; rand bit [7:0] sof; rand bit [15:0] header; rand bit [7:0] payload[]; rand bit [15:0] crc; rand bit [7:0] eof; //rand bit [7:0] length; // dont want to use this kind of parameter bcoz the specifications doesnt support it. constraint data_size_c { payload.size inside { [1 : 4]};}; //constraint length_c { length== payload.size }; // dont want to use this kind of parameter bcoz the specifications doesnt support it. function new(string name = ""); super.new(name); endfunction : new function [15:0] cal_crc; int j; bit [7:0]data; bit [15:0] n; bit [7:0] N[]; reg [15:0] newcrc; n = header; N = new [this.payload.size + 2]; // 2 more for header N = { >> {n, payload} }; `uvm_info ("TXHP", $sformatf("header + payload: %h", N), UVM_MEDIUM); for ( j = 0; j < N.size ; j++) begin bit [15:0] crc; reg [7:0] d; reg [15:0] c; d = N[j]; // data[j]; c = crc; newcrc[0] = d[4] ^ d[0] ^ c[8] ^ c[12]; newcrc[1] = d[5] ^ d[1] ^ c[9] ^ c[13]; newcrc[2] = d[6] ^ d[2] ^ c[10] ^ c[14]; newcrc[3] = d[7] ^ d[3] ^ c[11] ^ c[15]; newcrc[4] = d[4] ^ c[12]; newcrc[5] = d[5] ^ d[4] ^ d[0] ^ c[8] ^ c[12] ^ c[13]; newcrc[6] = d[6] ^ d[5] ^ d[1] ^ c[9] ^ c[13] ^ c[14]; newcrc[7] = d[7] ^ d[6] ^ d[2] ^ c[10] ^ c[14] ^ c[15]; newcrc[8] = d[7] ^ d[3] ^ c[0] ^ c[11] ^ c[15]; newcrc[9] = d[4] ^ c[1] ^ c[12]; newcrc[10] = d[5] ^ c[2] ^ c[13]; newcrc[11] = d[6] ^ c[3] ^ c[14]; newcrc[12] = d[7] ^ d[4] ^ d[0] ^ c[4] ^ c[8] ^ c[12] ^ c[15]; newcrc[13] = d[5] ^ d[1] ^ c[5] ^ c[9] ^ c[13]; newcrc[14] = d[6] ^ d[2] ^ c[6] ^ c[10] ^ c[14]; newcrc[15] = d[7] ^ d[3] ^ c[7] ^ c[11] ^ c[15]; $display("The value of CRC result newcrc = %h ",newcrc); // return newcrc; //result; end return newcrc; //result; endfunction : cal_crc function void post_randomize(); crc = cal_crc(); uvm_report_info(get_full_name(),"Appending crc into the packet ",UVM_LOW); endfunction : post_randomize `uvm_object_utils_begin(transaction) uvm_default_packer.use_metadata = 1; //int i; `uvm_field_int(sync, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(sof, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(header, UVM_ALL_ON|UVM_NOPACK) `uvm_field_array_int(payload, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(crc, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(eof, UVM_ALL_ON|UVM_NOPACK) `uvm_object_utils_end function void do_pack(uvm_packer packer); int i; super.do_pack(packer); // uvm_default_packer.use_metadata = 1; packer.pack_field_int(sync,$bits(sync)); packer.pack_field_int(sof,$bits(sof)); packer.pack_field_int(header,$bits(header)); foreach(payload[i]) packer.pack_field_int(payload[i],8); packer.pack_field_int(crc,$bits(crc)); packer.pack_field_int(eof,$bits(eof)); endfunction : do_pack function void do_unpack(uvm_packer packer); int i; super.do_unpack(packer); //super.do_pack(packer); //uvm_default_packer.use_metadata = 1; sync = packer.unpack_field_int($bits(sync)); sof = packer.unpack_field_int($bits(sof)); header = packer.unpack_field_int($bits(header)); payload.delete(); // added later by me payload = new [payload.size]; //added later foreach(payload[i]) payload[i] = packer.unpack_field_int(8); crc = packer.unpack_field_int($bits(crc)); eof = packer.unpack_field_int($bits(eof)); endfunction : do_unpack endclass: transaction Monitor (run phase part):- task run_phase(uvm_phase phase); transaction pkt; forever begin bit [7:0] bq[$],bytes[]; repeat(3)@(dut_vi.clock); //keep repeat(3) at 3 or 4 only in order to match the first byte. foreach(dut_vi.data[j]) // this works // for ( int j = 0; j < pkt.size ; j++) begin $display("san- Display of the packet contents %h",dut_vi.data); @(dut_vi.clock); //added later bq.push_back(dut_vi.data); $display("san1- Display of the packet contents %p",bq); @(dut_vi.clock); //keep this uncommented end $display("san3- Display of the packet contents %h",bq.size()); bytes = new[bq.size()] (bq); //(bq) @(dut_vi.clock); uvm_report_info(get_full_name(),"Received packet from the DUT into the Monitor...",UVM_LOW); // pkt = transaction::type_id::create("pkt"); pkt = new("pkt1"); uvm_default_packer.use_metadata = 1; void'(pkt.unpack_bytes(bytes)); // void'(tx.unpack_bytes(bytes)); //gives some sync values with unpack_bytes. and no values with pack_bytes. //The unpack methods extract property values from an array of bits,bytes or ints. pkt.print(); @(dut_vi.clock); Montr2Agnt_port.write(pkt); uvm_report_info(get_full_name(),"Sending received packet from monitor to the Scoreboard ...",UVM_LOW); end endtask: run_phase Please help me out here as this is urgent and important. I m stuck at here since some time now. Any help is appreciated. Thanks
  22. Hello all, I came to know that there are some differences between the versions of UVM libraries,especially uvm-1.0p1 and uvm-1.1 class libraries. I think there had been lot of additions in classes and macros of the uvm-1.1 than uvm1.0p1; some deletions are also there. I have questasim10.0b in which there is uvm-1.0p1 is in built. I ran a basic example in which there were some macros featured from uvm1.1 viz. resourse database and config database and these are not present in uvm-1.0p1. So can anyone plz tell me, how did the old version of uvm-1.0p1 support the features for uvm1.1? How does it work? Can some one plz put some light on it? Thanks, Swapnil
  23. Dear all, In scoreboard, I want to store the received and sent packets into files (byte wise) separately. Can someone suggest how to use uvm_file to do this task? Please give some idea,Thanks
  24. Dear all, I appreciate the feedback from all of you. I used $bits in the unpack function in the transaction class as shown below in the code: class transaction extends uvm_sequence_item; rand bit [7:0] sync; rand bit [7:0] sof; rand bit [15:0] header; rand bit [7:0] payload[]; rand bit [15:0] crc; rand bit [7:0] eof; constraint data_size_c { payload.size inside { [6 : 6]};}; `uvm_object_utils_begin(transaction) `uvm_field_int(sync, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(sof, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(header, UVM_ALL_ON|UVM_NOPACK) `uvm_field_array_int(payload, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(crc, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(eof, UVM_ALL_ON|UVM_NOPACK) `uvm_object_utils_end function void do_pack(uvm_packer packer); int i; super.do_pack(packer); packer.pack_field_int(sync,$bits(sync)); packer.pack_field_int(sof,$bits(sof)); packer.pack_field_int(header,$bits(header)); foreach(payload[i]) packer.pack_field_int(payload[i],8); packer.pack_field_int(crc,$bits(crc)); packer.pack_field_int(eof,$bits(eof)); endfunction : do_pack function void do_unpack(uvm_packer packer); //The unpack methods extract property values from an array of bits,bytes or ints. int i; //The do_unpack method is the user-definable hook called by the unpack method. int unsigned packet_size_in_bytes, payload_size_in_bytes; super.do_unpack(packer); sync = packer.unpack_field_int($bits(sync)); sof = packer.unpack_field_int($bits(sof)); header = packer.unpack_field_int($bits(header)); packet_size_in_bytes = packer.get_packed_size() / $bits(byte); // get_packed_size returns the number of bits that were packed. payload_size_in_bytes = packet_size_in_bytes -(($bits(sync) + $bits(sof) + $bits(header) + $bits(crc) + $bits(eof)) / $bits(byte) ); $display("san999- Display of the packet size %h",packet_size_in_bytes); pkt_len = packet_size_in_bytes * 10; // CAN I PASS THIS VARIABLE pkt_len TO MONITOR CLASS AND GET IT'S VALUE EVEN BEFORE THE SERIAL BITS ARE ACTUALLY BEING RECEIVED? $display("san996- Display of the packet length in bits %h",pkt_len); payload = new [payload_size_in_bytes]; foreach (payload[i]) //`uvm_unpack_int(payload[i]) // payload = new[sz]; // for ( i=0; i<sz; i++) payload[i] = packer.unpack_field_int(8); //8 less than or equal to 64 bits $display("san995-tran- Display of the payload contents %h",payload.size()); $display("san998-tran- Display of the payload contents %h",payload_size_in_bytes); crc = packer.unpack_field_int($bits(crc)); eof = packer.unpack_field_int($bits(eof)); endfunction : do_unpack endclass:transaction class monitor extends uvm_monitor; ..... virtual task run_phase(uvm_phase phase); transaction pkt; forever begin int pkt_len = 130; //This is in bits,HERE I NEED TO PASS THE CALCULATED LENGTH FROM SOME GENERIC UVM FUNCTION,TO START RECEIVING ALL THE SERIAL BITS. repeat(3)@(dut_vi.clock); for (int j = 0; j < pkt_len; j++) begin serialin = dut_vi.data; $display("san14- Display of the serial line serialin %b",serialin); $display("san15- Display of the Serial Line dut_vi.data %b",dut_vi.data); sipo(serialin); end void'(decode(bytes)); pkt = transaction::type_id::create("pkt1"); $display("SM447- Display of the bytes array received after decoding %h",decdrout2); void'(pkt.unpack_bytes(decdrout2)); uvm_report_info(get_full_name(),"Decoded completely 10bits into 8bits ...",UVM_LOW); uvm_report_info(get_full_name(),"Started unpacking of received bytes ...",UVM_LOW); pkt.print(); uvm_report_info(get_full_name(),"Completed unpacking of received bytes ...",UVM_LOW); Montr2Agnt_port.write(pkt); end uvm_report_info(get_full_name(),"Sending received packet from monitor to the Scoreboard ...",UVM_LOW); endtask: run_phase ........... .......... endclass: monitor CAN I PASS THIS VARIABLE pkt_len TO MONITOR CLASS IN THAT FORLOOP AND GET IT'S VALUE EVEN BEFORE THE SERIAL BITS ARE ACTUALLY BEING RECEIVED? BECAUSE UNPACK FUNCTION WILL GET THE PACKET LENGTH AFTER DECODE FUNCTION. AND THE pkt_len VARIABLE COMES EARLY IN THE CODE. IF I CAN PASS, THEN HOW IS IT DONE? PLEASE GIVE SOME GUIDANCE ON THIS. I APPRECIATE YOUR HELP, THANKS
  25. Can anyone please give me some guidance on above issue? Thanks,
×