Your Ad Here

Friday, March 13, 2009

extend feature in e-language

e-language supports extensibility feature in order to add new elements in the declared struct or unit. This feature is very useful in writing Top level Testcases using the constraint parameters.
To understand more, we will look at a small example listed below :

Ex: The e-description for the Packet structure

file name : packet.e

<’ struct packet_s {

Addr: uint (bits: 2);

Len: uint (bits: 6);

Data: list of byte; };

‘>

Extension file name : packet_ext.e

<’ import packet.e;

extend packet_s {

Legal: bool;

Parity: byte; };

‘>

The Legal and Parity fields will be added into the packet structure based on the order of generation if the packet_ext.e is executed.

import, extend are the pre-defined keywords of Specman Elite e-language.

No comments:

Post a Comment