Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home2/aefody/public_html/specman-verification.com/scripts/sb_utility.php:873) in /home2/aefody/public_html/specman-verification.com/index.php on line 11

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home2/aefody/public_html/specman-verification.com/scripts/sb_utility.php:873) in /home2/aefody/public_html/specman-verification.com/index.php on line 11

Warning: strpos(): needle is not a string or an integer in /home2/aefody/public_html/specman-verification.com/index.php on line 71
Tips for HVL and HDL users with special emphasis on Specman-e, SystemVerilog and Questa
Specman Verification
Verification engineer? Verifigen has the right project for you!
At last - a professional work interview! 
Monday, December 18, 2006, 12:20 PM - Hardcore verification
My loyal readers probably recall my my complaint that interviews for verification positions are not as professional as they should be, and in many cases are conducted by people who don’t know the first thing about verification. While, I still think that’s true, a recent phone interview I had for a job in Verilab, made me think that maybe those amateur interviews were not such a bad thing after all. For the sake of all of my readers in search of a job, here’s a more or less exact replication of this interview. More or less, because the answers are the correct ones, and not necessarily the ones that I’ve given :-)

Q: (a)What are the differences between structs and units? (b)What are the special unit related fields and methods?

(a) A warm up question. Units are static objects that exist from the start of the simulation right up to its end, while structs are created on the fly and automatically destroyed by the garbage collection mechanism when they can not be accesses anymore. Units are used to store data that is required by many entities, because it is easy to know where they are and reach them from anywhere in an environment (for example using such unit specific methods as get_enclosing_unit(). They are also used to connect to DUT interfaces (BFMs) because these interfaces are active from reset to reset (which is normally equivalent to from start to end of simulation), and for other fixed environment elements such as scoreboards.
(b) The most important method (in fact pseudo method) related to units is get_enclosing_unit().
The most widely used field in a unit is its HDL path. It makes it possible to use relative paths in order to access DUT signals, which is crucial if a move from block level to chip level is planned.

Q: (a) How can you pass a struct by reference in e? (b) how do you pass basic types by reference?

In general, there are two ways of passing a parameter to a function: passing by value and passing by reference. When you pass a parameter by value, any modification made on the parameter by the called function, will not affect the original value. When you pass a parameter by reference modifications in the called function will affect the original value.

(a) The question is phrased in a tricky way because passing by reference is the default and only possible way to pass structs in e. In other words, every time you call a method with a struct parameter, the method gets the original copy, and any modifications it does will persist even after it returns. To pass a struct by value you can use deep_copy() to clone it. In C/C++ you could prevent a calling function from modifying a parameter by defining that function parameter as const. It is too bad that e doesn’t support const as well…

(b) In the case of basic types such as bool, int, uint, etc. you can in fact choose between the two forms. If you prefix the method parameter in the method definition with a star, then it will be passed by reference (modifications persist). Otherwise, it will be passed by value.

My interviewer then asked me what happens when you prefix a struct parameter with a star…turns out that in that case the called method can completely delete the struct and replace it with another or with nothing at all (for example by calling “gen” on the parameter, or by assigning NULL to it)

Q: What is the use of coverage per instance? How can you use it to prevent the creation of fake coverage holes?

Specman 5.1 supports two main types of per instance coverage, referred to, somewhat confusingly, as – “cover group per instance coverage” and “item per instance coverage” (previous versions support only the “item per instance coverage”). Here are two examples of situations where the two types perfectly fit.

Using a “cover group per instance coverage” would be helpful if you have several interfaces that implement the same protocol, but were not written by the same designer, or better put, are not replicated instances of the same code. In this case you will have to check that each of the interfaces obeys to all of the protocol rules. So, if you have interfaces A and B that have to comply with rules 1 and 2, then you would have to check that 1 and 2 work for A and that 1 and 2 work for B. On the other hand, if your interfaces are just replicated instances of the exact same code, then if you check that 1 works for A and 2 works for B, you can say you’re done. This last option corresponds to the way in which e coverage works by default.

Using “item per instance coverage” is beneficial if you have several subtypes of the same interface. For example, consider a situation where someone wrote a bus interface that can be synthesizes either with a Simple option, in which case it will support only atomic reads and writes and will require fewer gates, or with an Extended option in which case it will also support bursts. It goes without saying that you wouldn’t want to collect burst coverage on the Simple interfaces, for the obvious reason that no bursts should happen there (and most probably a burst indication signal doesn’t even exist). The “item per instance coverage” option is used to prevent Specman from collecting burst coverage on the simple interfaces, and thus creating false “coverage holes”. This is shown in the code below:


<'

type InterfaceKind : [Simple, Burst];



unit BusInterface {

   kind : InterfaceKind;

   

   rd : bit;

   wr : bit;



   event transactionDone;



   cover transactionDone is {

      item kind;

      item rd;

      item wr;

   };

};



// written this way you will have

// a fake coverage hole for Simple

// BusInterfaces because the signal

// burst does not exist for these

// and will not be sampled...



extend Burst BusInterface {

   burst : bit;



   cover transactionDone is also {

      item burst;

   };

};



// written this way you will have no

// fake coverage hole



extend Burst BusInterface {

   burst : bit;



   cover transactionDone(kind==Burst) is also {

      item burst;

   };

};



// code to check that I'm not bullshiting

// you

extend sys {

   busInterfaces : list of BusInterface is instance;

   keep for each in busInterfaces {

      index == 0 => it.kind == Simple;

      index == 1 => it.kind == Burst;

   }; // keep for each i...



   post_generate() is also {

      for each in busInterfaces {

         for i from 0 to 50 {

            gen it.rd; gen it.wr;

            if it is a Burst BusInterface (burstIf) {

               gen burstIf.burst;

            };

            emit it.transactionDone;

         };

      }; 

   }; 

};

'>





Two comments as an end note to this lengthy explanation:
I. If you find the terms “cover group per instance” and “item per instance” confusing, you are not alone. The confusion arises because it is not really clear what instance the words “per instance” refer to: while it seems that in “cover group per instance” they refer to an instance of an HDL module or an e unit, it is obvious that this is not the case for “item per instance”, where coverage from several instances of the same subtype will be grouped together. I guess you are even more confused after reading this sentence than before….
II. Unfortunately you can not use “cover group per instance” and “item per instance” together. This would be very useful where you have a single protocol that can be extended and that was implemented by several independent designers. This comment is written with the OCP bus interface in mind, where each IP vendor implements a subset of the protocol separately.

Q: What logical structure (object structure) and physical structure (file structure) are defined by the eRM? Which conventions are defined by the eRM? What type of object is used as a container for an eVC?

I’ll let you read about those in the eRM itself. I didn’t really know most of them myself.

Q: What would you change in Specman?

A nice one ha? I decided to dedicate it a separate entry.

Q: What would you say are the main differences between work as an employee and as an independent consultant?

This one merits its own entry as well, but here are two important ones that took me some time to learn. I’ll definitely give this question its own (static?) entry someday…

(a)A shift in thinking from a job to be done, to a demand vs. cost approach – As an employee, it is often your boss’s responsibility to decide which work needs to get done and to cut it into well defined pieces you can chew. As a consultant, however, you’re expected to manage yourself. The work will be defined only in vague terms, for example, “verify IP X until the end of May”.

When you’re faced with such a vague task your first instinct might be to write the most exhaustive testbench you can. However, assuming that you’re paid by the day, this might cost a lot more than your client is ready to pay. Even if you’re globally paid, your client might be ready to compromise a bit, in order to have a sure delivery at the deadline. Therefore, a better approach would be to present your client with a detailed list of subtasks along with their estimated corresponding price, and let him choose the features he would like to have by himself. Going this way, the responsibility for the end result is shared, and everyone knows in advance what they should expect.

(b)Working by what the client really wants, not by what the client says he wants – This one requires a bit of intuition and diplomacy, but if you go by it, you are sure to make your customer happier. For example, your client states that he wants to dump his current directed testbench and move to coverage-driven verification? Fine. But how far does he really want to go? Is he prepared for the move? Does he really know what he is talking about? Is the motivation professional or political? All of these are questions you should pose to yourself, and maybe, at a later stage to your client as well. Sometimes you’ll find that your client is only interested in 10% of the capabilities of the tool at hand. In that case giving him 20% would make him happy. Giving him 80% is probably more than he will be ready to take.

Q: What do you normally do when you end a project?

I’m still looking for a clever response to that. Maybe with a couple of more projects on my belt…I guess you should have some kind of a meeting to sum up lessons learned, but I’ve never done that.


  |  permalink
I want my plastic back 
Saturday, November 25, 2006, 07:35 AM - Personal
The local authorities, “le conseil generale Alpes Maritime” have decided to oblige all supermarket chains to stop handing out plastic bags. As a rule, I tend to support green legislation, but I must say that I never understood the big issue people (including my mother) make out of these plastic bags. It is as if these plastic bags, not pollution, deforestation, over-fishing, mining, river dams, you name it, were the major ecological problem our plant faces. Why they assumed such a major importance? I guess it is just because they are an insistent daily demonstration of the useless staff we constantly make.

Though I don’t have any reliable data at hand, I would guess that these plastic bags are just a negligible fraction of all the plastic waste a person creates. As an example just take a look at the staff I bought yesterday in that plastic bag free supermarket: yellow cheese, white cheese, wafers, steaks, all wrapped up in generous amounts of nylon and plastic and some fruits and vegetables that you must put in small separate plastic bugs. An extra plastic bag would have probably added no more then 5-10% to the total plastic weight I already had.

And if I needed an extra proof of that, while I was waiting for my turn, my eyes came across a supermarket commercial announcing the fact they were eliminating plastic bags, because, to cite the commercial "while I was doing my shopping they were thinking about earth". They had a picture of a shopping cart there…The funny thing was that all the fruits and vegetables were just lying there inside the shopping cart, without those small plastic bags that you find everywhere. Several bagguettes were thrown "au natural" inside the cart as well, without those long wrappers they normally have. And the only other plastics they had were water bottles, probably because those are transparent, so they were hoping they would go unnoticed.

So, whose the big winner? I guess it’s the supermarket that now sells “reusable”, thick plastic bags, to all those people that forgot to bring something to carry all that plastic wrapped food they just bought with them, for 69 euro cents.

  |  permalink
Airbus 
Saturday, November 25, 2006, 07:11 AM - Personal
My Indian colleague D. just started working at TI as well. He wanted me to help him find some bus schedules on the web, which he can’t do because he can’t read French. We looked around a bit and found a page with a phone number where you can call and get the schedules sent to you by email. I called. A woman answered and asked me to write an email to “stcaraerobus wanadoo fr”, or at least that was what I though I heard. I was ok with STCAR because that’s the company name and with wanadoo and fr, but I wasn’t really sure about the “aerobus” part, although it made some sense because after all that’s a bus company, and some of their buses go to the airport. I asked:
“stcar aerobus in one word?”
“yes” she said.
Ok, I hanged up and tried to send an email to stcaraerobus@wanadoo.fr. It immediately returned. After trying several other options I called again:
“I’m sorry”, I said “we just talked, can you please give me the address again?”
This time she spelled it:
“S like spring, t like taxi, c like cat, a like air, r like red, aerobus wanadoo fr”
I didn’t understand why she stopped spelling at the aerobus part which was just the part I needed her to spell, so I asked her to spell again. She became a bit annoyed.
“S T C A R aerobus wanadoo fr”
I was starting to get frustrated as well. I tried to tell her that I wanted her to spell the aerobus part as well, but my French sentence was probably not correct, because she said again:
“S T C A R aerobus wanadoo fr…do you know how to send an email?”
“Of course”, I said “I just can’t get the address right”
She wasn’t convinced “Just ask someone to help you” she said.
“I’m sending emails 200 times a day!” I said almost shouting now “can you just spell aerobus again? That’s all I need!
“Goodbye” she said “just ask somebody who knows how to send a mail…”

3 hours later I finally got it…aerobus is in fact “aerobe” the French word for @

  |  permalink

Back Next