Your Ad Here

Friday, April 10, 2009

specman elite e-language supports subtype stimulus creation

Specman elite e-language supports the formation of subtype stimulus creation.
In order to achieve we need to use the enumerated define types.
e.g If we want to control the generation of fields w.r.t subtypes, it is better to use enumerated types as a controlling parameters.
Let's have requirements in mind for the Read / Write scenario. We all Know that Address field is common for both Read / Write Transcation, whereas we need to generated write data when we are performing the Write Transcation.
Here is how we control the generation using the specman e-language subtype declaration.
The following example demonstrates , if the enumerate type declared is WR in nature it generates Write Address and Write Data else it only performs Read Transcation.
< '
type packet_wr_rd_t : [ WR, RD];
struct packet_s {
packet_wr_rd : packet_wr_rd_t ; // Declaration of the field
keep soft packet_wr_rd == WR;
Address : byte ; // Common field for both RD / WR
keep soft Address == 0x10;
// Apply the Subtype to control the generation
when WR' packet_s {
wr_data : byte ;
// default value, can be overwritten using testcase
keep soft wr_data == 0x0 ;
}; // end of WR subtype creation.
}; // end of struct definition

'>

No comments:

Post a Comment