Tuesday, April 26, 2011

Killing Sequences on Sequencer Abruptly

Sometimes you may need to drive input until you see come condition or some timer expires. Once you meet that condition, you need to stop generating stimulus. The code for this scenario look like below.


//Test
begin
    fork
    begin
        wait(rtl_linkup == 1);
    end
    begin
       forever
           idles_transmit.start(Sequencer);
    end
  join_any
  disable fork;
end


In the above code we are driving idles until rtl_linkup condition is observed. But here there is a problem, As we are trying kill idles_transmit sequence abruptly when condition is met, this may cause the sequencer to be in intermittent state. This will cause the problem on the next sequences which trigger on the same sequencer. As sequencer is in intermittent state it may not get grant and will wait for for grant forever. To avoid this problem we need to reset the sequencer after killing threads. The code look like below.


//Test
begin
   fork
      begin
        wait(rtl_linkup == 1);
      end
      begin
           forever
              idles_transmit.start(Sequencer);
      end
   join_any
   disable fork;
   Sequencer.stop_sequence();
end


In the above code the stop_sequences call will reset the sequencer variables and won't cause any problem for the next sequences which are triggered on same sequencer. Here also we have another problem with the sequence thread which is killed with disable fork. Sometimes by the time thread is killed request might have been sent to driver. if thread is killed and stop_sequence is called before receiving the item_done, item_done will cause fatal error as request fifo is empty. So we need to kill thread and call of stop_sequence only after receiving item_done from driver. The code will look like below.


//Sequence .
class idles_transmit extends ovm_sequence #(REQ= packet);
    bit received_item_done;
    task body();
       wait_for_grant();
       assert(req.randomize());
       send_req(req);
       received_item_done = 0;
       wait_for_item_done();
       received_item_done = 1;
   endtask
endclass


//Test
begin
    fork
        begin
            wait(rtl_linkup == 1);
        end
        begin
             forever
                  idles_transmit.start(Sequencer);
        end
     join_any
     @(posedge idles_transmit.received_item_done);
     disable fork;
      Sequencer.stop_sequence();
end


In the above code we are trying to kill the thread and reseting sequencer state only after receiving the ite_done for the request sent, which is the idle way to stop thread.

Sunday, April 10, 2011

IT'S NOT HOW GOOD YOU ARE, IT'S HOW GOOD YOU WANT TO BE

IT'S NOT HOW GOOD YOU ARE, IT'S HOW GOOD YOU WANT TO BE - PAUL ARDEN

Everybody will have dreams and want to be Good with Success in Life. In similar lines, I came across above book and found it has beautiful points to follow.
Here is the gist of Book.

1. Nearly all rich and powerful people are not notably talented, educated, charming or good-looking. They become rich and powerful by wanting to be rich and powerful.
2. Your vision of where or who you want to be is the greatest asset you have. Without having a goal it's difficult to score.
3. All creative people need something to rebel against, it's what gives their lives excitement, and it's creative people who make the clients' lives exciting.
4. There is no instant solution, to become good. It is only through experience and mistakes.
5. You can achieve the unachievable. Always aim beyond what you are capable of. Try to do things that you are incapable of.
6. Always dream about how good you want to be.
7. Energy is the 75 % of the job. 
8. Don't seek praise. Seek criticism. So that you can always improve your idea.
9. If You are involved in something that goes wrong, never blame others. Blame no one but yourself. If you accept responsibility, you are in a position to do something about it.
10. Give away everything you know, and more will come back to you.
11. Don't look for the next opportunity. The one you have in hand is the opportunity.
12. Eliminate the Negative.
13. Don't promise what you can't deliver. 
14. Know your client Aims for whom you are working.
15. Always show a client what he want's first, he is then relaxed and is prepared to look at what you want to show him.
16. Don't take No for an answer.
17. When it can't be done, do it. If you don't do it, it doesn't exist.
18. If you can't solve the problem, it's because you are playing by the rules.
19. The person who doesn't make mistakes is unlikely to make anything.
20. It's wrong to be right.
21. Don't be afraid of Silly Ideas.
22. How you perceive yourself is how others will see you.
23. It's not what you know. It is who you know.
24. Don't give a speech. Put on a show.
25. Rough Layouts sell ideas better than polished ones. Show the client a scribble. Explain it to him, talk to him through it, let him use his imagination. Work with him rather than confronting with idea. 
26. If you get stuck, use a different pen.
27. Don't hand over to a team hoping that they will produce the magic. It's for you to lead them along the path of enlightenment.
28. Don't be afraid to work with the best.
29. Don't try to win awards. Be true to your subject and you will be far more likely to create something that is timeless.
30. Success is going from failure to failure with no loss of enthusiasm.
31. The first thing to decide before you walk into any negotiation is what to do if the other fellow says no.
32. Those who lack courage will always find a philosophy to justify it. 
33. If everything seems under control you're not going fast enough.
34. We don't see things as they are. We see them as we are.


Finally at some point we need to draw line somewhere.