Jump to content

Any better way to serialize the data, please give suggestion?


Recommended Posts

Hello all,


I am working on piso(parallel in serial out). I am receiving the 10bits byte properly upto foreach loop, But after that data is not being shifted properly in shift register and its not getting serialized. Following is the code for the piso task.



 
task piso(encodrout1); 
      bit[9:0]encodrout1[]; 
      $display("san355- Display of the bytes array received inside the PISO %p",encodrout1); //%h
              uvm_report_info(get_full_name(),"Received All 10bits into the PISO...",UVM_LOW); 
          
    uvm_report_info(get_full_name(),"Driving 10bits and converting into serial bitstream.....",UVM_NONE);
   
    foreach (encodrout1[k]) 
       begin
        // automatic 
        reg [9:0] load;
        //automatic bit [9:0] load; // =0;
         reg [4:0] counter_d = 0;
         
         dut_vi.reset <= 0; 
    
     load = encodrout1[k];
   
                         $display("san340- Display of the load %b",load); 
                         $display("san340- Display of the load %h",load); 
                 
    @(posedge dut_vi.clock) 
   
    //for (int i = 0; i < 10 ; i++) //I guess this line is not needed
    begin
                // repeat(10)@(posedge dut_vi.clock)
               // @(posedge dut_vi.clock) 
                 counter_d = counter_d + 1;   
                
                  load[9:0] <= {load[8:1] & load[0]} ; //THIS LINE DOESNT WORK, GIVES ERROR: Error: driver72.sv(269): LHS in non-blocking assignment may not be an automatic variable
    
     load[9] = load[8];
                 $display("san370- Display of the load %b",load); 
                 // @(posedge dut_vi.clock)
                 dut_vi.data <= load[9];
             load[8] = load[7];
             $display("san371- Display of the load %b",load); 
             // @(posedge dut_vi.clock)
             dut_vi.data <= load[8];
                 load[7] = load[6];
                 $display("san372- Display of the load %b",load); 
                 // @(posedge dut_vi.clock)
                 dut_vi.data <= load[7];
             load[6] = load[5];
             $display("san373- Display of the load %b",load); 
             //  @(posedge dut_vi.clock)
             dut_vi.data <= load[6];
             load[5] = load[4];
             $display("san374- Display of the load %b",load); 
             //  @(posedge dut_vi.clock)
             dut_vi.data <= load[5];
             load[4] = load[3];
             $display("san375- Display of the load %b",load); 
            // @(posedge dut_vi.clock)
             dut_vi.data <= load[4];
             load[3] = load[2];
             $display("san376- Display of the load %b",load); 
            // @(posedge dut_vi.clock)
             dut_vi.data <= load[3];
             load[2] = load[1];
             $display("san377- Display of the load %b",load); 
            // @(posedge dut_vi.clock)
             dut_vi.data <= load[2];
             load[1] = load[0];
             $display("san378- Display of the load %b",load); 
            // @(posedge dut_vi.clock)
             dut_vi.data <= load[1];
                 load[0] = load[9]; 
                 $display("san379- Display of the load %b",load); // */                 
                 dut_vi.data <= load[0];
          
    // repeat(10)@(posedge dut_vi.clock)
     counter_d = counter_d + 1;
     $display("san365- Display of the counter_d %d",counter_d); //%h
     $display("san369- Display of the load %h",load); //%h
     $display("san369- Display of the load %b",load); //%h
   
             uvm_report_info(get_full_name(),"Display of load inside PISO2222.....",UVM_NONE);
    end  
    //ser_OUTPUT=load[9]; // this needs to be connected to the serial line of DUT It works here
    /*@(posedge dut_vi.clock) 
    dut_vi.data <= load[9]; //serial data goes out
    @(posedge dut_vi.clock) 
    dut_vi.data <= load[8];
    @(posedge dut_vi.clock) 
    dut_vi.data <= load[7]; //*/
    $display("san384- Display of the load[9] %b",load[9]); //%h
    //dut_vi.data <= ser_OUTPUT; //
    $display("san385- Display of the dut_vi.data %b",dut_vi.data); //%h It works here
    //end
       end
                  
     endtask : piso 
 

 


Any help will be appreciated, thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...