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. Can some uvm expert please throw some light on this topic? Thanks
  3. 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
  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. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. Can someone please give me some idea about it? What could be the UVM methods to create nested frames? Would appreciate it. Thanks,
  11. 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,
  12. 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,
  13. Can someone please give reply to this, I would appreciate it. Thanks
  14. 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,
  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. 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.
  17. 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,
  18. 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
  19. 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
  20. Thanks for your feedback sir. As such, my issue had been resolved and packets are matching. Thanks again
  21. 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
  22. Hello Mr. Alan, Thanks for your reply. I appreciate it. I am finding one more error. The bits are not being received properly at every clock edge from (dut_vi.data) dut_interface. I am trying to assign the serialin with dut_vi.data in run phase() but its not working. It gives following error also: ** Error: monitor82.sv(51): An automatic var. or elem. of a dynamic var. (this) may not be the LHS of a non-blocking assignment. class monitor extends uvm_monitor; //Registration of monitor with the factory. `uvm_component_utils(monitor) virtual dut_if dut_vi; bit [7:0] decdrout1; bit [7:0] decdrout2[]; bit[7:0]queue[$]; //automatic logic serialin; //bit serialin; reg [9:0] pout; bit [9:0] bq[$]; bit[9:0] bytes[]; uvm_analysis_port #(transaction) Montr2Agnt_port; //constructor by using keyword new function new(string name, uvm_component parent); super.new(name, parent); endfunction: new function void build_phase(uvm_phase phase); super.build_phase(phase); assert( uvm_config_db #(virtual dut_if)::get(this, "", "dut_vi", dut_vi) ); Montr2Agnt_port = new("Montr2Ag", this); endfunction : build_phase virtual task run_phase(uvm_phase phase); transaction pkt; // fork forever begin //automatic // logic serialin; //bit [7:0] decdrout1; int j; int pkt_len = 8; //bit [9:0] bq[$]; //bit[9:0] bytes[]; //repeat(10) @( dut_vi.clock); //removed posedge serialin <= dut_vi.data; //This line gives following error too, // ** Error: monitor82.sv(51): An automatic var. or elem. of a dynamic var. (this) may not be the LHS of a non-blocking assignment. $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); //sipo(dut_vi.data); void'(decode(bytes)); pkt = transaction::type_id::create("pkt1"); $display("SM447- Display of the bytes array received after decoding %h",decdrout2); //%h 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); // void'(pkt.unpack_bytes(decdrout2)); pkt.print(); //keep it here uncommented uvm_report_info(get_full_name(),"Completed unpacking of received bytes ...",UVM_LOW); Montr2Agnt_port.write(pkt); end //paired with forever uvm_report_info(get_full_name(),"Sending received packet from monitor to the Scoreboard ...",UVM_LOW); endtask: run_phase virtual task sipo (ref serialin); // must be a ref if you want to read it during the task logic [9:0] pout; reg [3:0] counter_m = 0; $display ("san488- Serialin is %b", serialin); for (int i = 0; i<10; i++) begin pout = {pout[8:0], serialin}; // assuming called just after a posedge? $display ("san491- Pout is %b", pout); $display ("san492- Pout is %h", pout); counter_m = counter_m + 1; $display("san490- Display of the counter_m %d",counter_m); //%h @(posedge dut_vi.clock); end $display ("san493- Pout is %b", pout); endtask : sipo // function decode(bytes); function decode(bytes); ...... ....... endfunction: decode endclass: monitor I am not getting why the bits are not being received properly by dut_vi.data and serialin because I can see the bits coming properly untill dut_interface. Please guide me through what am I missing in the run task to get all the bits serially in and then in sipo function. Thanks,
  23. Hello all UVM geeks, I am working on SIPO(serial in parallel out) in monitor class. Its not working properly and data is not being shifted in the shift registers. Can someone please guide me how to correct this problem so that I can make 10 bits byte out of SIPO. Following is the code for sipo part. task sipo(serialin); // task sipo(dut_vi.data); reg [9:0] pout; // automatic logic [9:0] temp = 0; //reg replaced by logic reg [9:0] temp; reg [4:0] counter_m = 0; //repeat(2) //always @(posedge dut_vi.clock) //removed posedge // for (int i = 0; i < 10 ; i++) begin // temp[9:0] <= {temp[8:0], serialin}; //THIS LINE DOESNT WORK, GIVES ERROR: Error: monitor.sv(167): LHS in non-blocking assignment may not be an automatic variable //temp[9:0] <<<= {temp[8:0], serialin}; //compiles but dont give any result //@(posedge dut_vi.clock) temp[0] = serialin; //temp[8]; $display("san480- Display of the temp %b",temp); temp[1] = temp[0]; $display("san481- Display of the temp %b",temp); temp[2] = temp[1]; $display("san482- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[3] = temp[2]; $display("san483- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[4] = temp[3]; $display("san484- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[5] = temp[4]; $display("san485- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[6] = temp[5]; $display("san486- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[7] = temp[6]; $display("san487- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[8] = temp[7]; $display("san488- Display of the temp %b",temp); // @(posedge dut_vi.clock) temp[9] = temp[8]; $display("san489- Display of the temp %b",temp); // repeat(10)@( dut_vi.clock) // $display("san489- Display of the temp %b",temp); counter_m = counter_m + 1; $display("san490- Display of the counter_m %d",counter_m); //%h end @(posedge dut_vi.clock) //assign pout = temp; $display("san466- Display of the Paralled data out of SIPO %b",pout); //%h uvm_report_info(get_full_name(),"Display of SIPO output parallel data.....",UVM_NONE); bq.push_back(pout); @( dut_vi.clock); $display("san467- Display of the queue contents %h",bq.size()); bytes = new[bq.size()] (bq); $display("san453- Display of the bytes array contents %p",bytes); //%h endtask: sipo Any help is appreciated. Thanks
×
×
  • Create New...