What is the type or object type of "sys" in specman?
Specman language (or also called 'e' language, are often used interchangeably) has two main building blocks - "struct" and "unit" (both here are keywords.) While struct is similar to structure in C, unit is specific to Specman.
What necessitated the creation of unit as another building block for specman? This is another way of asking the advantages and disadvantages of struct and unit. The features of struct is more flexible and efficient than the unit, it so appears that unit is not necessary. How?
"Sys" is something similar to main() function in C. So this is the very first pre-defined object that is generated and executed as the simulation starts.
"Sys" is a pre-defined unit and cannot be a struct because it cannot be used as a dynamic object, that is, it cannot be created or generated on the fly. This is automatically called by the specman at the very beginning of simulation. If it is a struct, then "sys" can also be generated on the fly from within the middle of the code, which, theoretically, should re-start the simulation. This is an impossible situation in hardware verification. Also, this defeats the very purpose of using unit as static objects.
What are static and Dynamic objects?
Dynamic objects can have lifetime shorter than the whole simulation period, while static objects have a lifetime equal to the simulation time. According to this, structs are dynamic objects and units are static objects. So "sys" is a static object which is generated when the simulation starts and killed only when the simulation ends.
So, a static object like 'unit' was required in Specman because of a need to be constantly in connect with the DUT interface (and also with scoreboard.) So, unit can be accessed as a repository of data by other entities inside the program (for eg., thru get_enclosing_unit().) This necessitates the need for unit as a static object inside Specman.
Together with dynamic object such as struct, memory can be efficiently used in random verification with Specman.
I found more such questions and answers on Specman here.
-*-*-*-*-*-*-*-*-*-*-*-*
No comments:
Post a Comment