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


Tutorials



DATA TYPES




Most e expressions have an explicit data type. These data types are described in the following sections:

----------------------------------------------------------------
Name    Description                         Example
----------------------------------------------------------------
bool    Boolean value: TRUE or FALSE       valid : bool;
int     Integer, default 32 bits                   length: int;
uint    Unsigned integer,default 32 bits   addr  : uint(bits:8);
bit     1-bit unsigned integer                 valid : bit;
byte    8-bit unsigned integer             data  : byte;
time    64-bit unsigned integer            delay : time;
string  String of ASCII characters         prompt: string;
list    Resizable                          payload:list of byte;
----------------------------------------------------------------




Enumerated Types



You can define the valid values for a variable or field as a list of symbolic constants. These are referred to as enumerated types.

Syntax: type enum-type: [name1[=exp],~@][(bits|bytes: width-exp)];



EXAMPLE

type priority_t: [high, medium, low];
type packet_kind_t: [good, bad];



By default, the new enumerated type is 32 bits, but it can be sized according to the number of bits required.



EXAMPLE:
type direction_t: [READ, WRITE] (bits: 1);


Default first enum value is 0. Subsequent enum values are increment by 1. This internal value is used for comparisons(with strong type matching maintained).
Values can be explicitly assigned with the syntax:


EXAMPLE:
type opcode_t: [ADD = 4, SUB = 6];


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