Sunday, November 30, 2008

System Veriog GOTHCA 01

Types defined in different scopes:

The LRM words this as follows: ―The scope of a data type identifier shall include the hierarchical instance scope. In other words, each instance with a user-defined type declared inside the instance creates a unique type. To have type matching or equivalence among multiple instances of the same module, interface, or program, a class, enum, unpacked structure, or unpacked union type must be declared at a higher level in the compilation-unit scope than the declaration of the module, interface, or program, or imported from a package.

This has several implications. For example,

typedef struct {int A; int B;} AB_t;
typedef struct {int A; int B;} otherAB_t;

defines two different types and you cannot simply assign a variable of one type to a variable of the other, even though the type contents are identical. You must use an explicit type cast. GOTCHA!

Furthermore, if the type declaration of AB_t is found in module m, and m is instantiated twice, as m1 and m2, then the two types m1.AB_t and m2.AB_t are considered different types and again cannot be assigned from one to the other without an explicit cast.

However, if the typedef is found at a higher level, such as in the compilation-unit scope of the module ($unit), or in a package that is imported into the module, then the two module instances are considered to have the same type definition.

An anonymous type declaration also defines its own type. An anonymous type declaration is where the type definition appears as part of the variable declaration, and not as a separate typedef. For example:

struct {bit[15:0] value;} AB4, AB5;
struct {bit[15:0] value;} AB6;

AB4 and AB5 are defined with the same anonymous type declaration, and so they are assignment-compatible, but AB6 has a separate anonymous type definition and thus is not assignment-compatible with AB4 and AB5 without a cast, even though the type definitions are identical.

As stated in the LRM, these restrictions apply to enums, unpacked structures and unions, and classes. So they do not apply, for example, to packed structs or to arrays, packed or unpacked.

So a function can return an unpacked struct, for example, but you won‘t want to define the struct as an anonymous type in the function header, like this:

function struct {bit[15:0] value;} f(args);

because then you will not be able to assign the function return value to another variable in the calling scope, as they will be considered to have different types:

AB4 = f(args); // illegal, different types

1 comments:

Anonymous said...

[u][b]Xrumer[/b][/u]

[b]Xrumer SEO Professionals

As Xrumer experts, we possess been using [url=http://www.xrumer-seo.com]Xrumer[/url] for a sustained immediately now and grasp how to harness the enormous power of Xrumer and go off it into a Bills machine.

We also provide the cheapest prices on the market. Assorted competitors see fit expect 2x or consistent 3x and a destiny of the continuously 5x what we charge you. But we maintain in providing enormous help at a debilitated affordable rate. The unbroken incidental of purchasing Xrumer blasts is because it is a cheaper variant to buying Xrumer. So we train to keep that thought in cognizant and provide you with the cheapest grade possible.

Not simply do we have the best prices but our turnaround occasion for the treatment of your Xrumer posting is wonderful fast. We intention take your posting done to come you know it.

We also outfit you with a roundish log of affluent posts on manifold forums. So that you can get the idea seeking yourself the power of Xrumer and how we hold harnessed it to gain your site.[/b]


[b]Search Engine Optimization

Using Xrumer you can wish to realize thousands upon thousands of backlinks over the extent of your site. Tons of the forums that your Place you force be posted on oblige high PageRank. Having your link on these sites can deep down help strengthen up some cover rank help links and genuinely riding-boot your Alexa Rating and Google PageRank rating owing to the roof.

This is making your put more and more popular. And with this increase in popularity as familiarly as PageRank you can keep in view to appreciate your place in effect rank high in those Search Motor Results.
Traffic

The amount of see trade that can be obtained before harnessing the power of Xrumer is enormous. You are publishing your site to tens of thousands of forums. With our higher packages you may even be publishing your locality to HUNDREDS of THOUSANDS of forums. Create 1 brief on a all the rage forum drive almost always rig out 1000 or so views, with communicate 100 of those people visiting your site. Now devise tens of thousands of posts on fashionable forums all getting 1000 views each. Your freight liking withdraw sometimes non-standard due to the roof.

These are all targeted visitors that are interested or curious about your site. Imagine how assorted sales or leads you can execute with this considerable figure up of targeted visitors. You are truly stumbling upon a goldmine friendly to be picked and profited from.

Keep in mind, Transport is Money.
[/b]

GET YOUR CHEAPLY BURST TODAY:


http://www.xrumer-seo.com