|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



STRUCT




Structs are the basis building blocks for any e language based testbenches. This are similar to class in C++ and thus are used for constructing compound data structures. Like in C++ and C, we can use this compound data structures in all the places like, it Can be used as regular data types in any context where a type is required. The default value for a struct is NULL . Struct can be passed to/from methods just as in C methods. Struct Can be used in another struct as normal data type . You can also define a variable using a struct type.



EXAMPLE:
<'
struct data {
addr : uint (bits : 32);
data : uint (bytes: 8);
rdwr : bit;
};
extend sys {
d : data;
run() is also{
gen d;
print d;
gen d;
print d;
};
};
'>

RESULT

d = data-@0: data
@11
0 addr: 1956082095
1 data: 5743609808327112738
2 rdwr: 0
d = data-@1: data
@11
0 addr: 3861093091
1 data: 8956857106270623639
2 rdwr: 0


Index
Introduction
E Basics
Data Types
Operators
Struct
Units
List
Methods
Concurrency Actions
Constraints
Extend
When And Like
Events
Temporal Expressions
Temporal Operators 1
Temporal Operators 2
Synchronizing With The Simulator
Wait And Sync
Physical Virual Feilds
Packing N Unpacking
Pre Run N On The Fly
Coverage
Commands
Extendable Methods
Non Extendable Methods
And Gate Evc

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright 2007-2017 :: all rights reserved www.testbench.in::Disclaimer