Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SPECMAN
Aarthi Nadarajan
Interns – Basic Intro
WHAT IS SPECMAN ?
Language “e”
The ‘e’ Language has constructs necessary for
verification automation
High Extensibility
All common procedural actions
No complex pointer arithmetic
Automated memory management
Predefined data structures
A SAMPLE VERIFICATION ENVIRONMENT
GETTING STARTED
Example:
Example:
type opcode: [ADD, SUB];
• By default the new enumerated type is 32 bits, but it can be sized
according to the number of bits required.
type direction: [READ, WRITE](bits: 1);
• Enumerated type statement. Default first enum value is 0.
Subsequent
enum values increment by 1. This internal value is used for
comparisons (with strong type matching maintained).
• Values can be explicitly assigned with the syntax:
type opcode: [ADD = 4, SUB = 6];
IMPORT ‘E’ FILES
• Specman e files are called modules.
Example:
<'
import my_packet, my_port;
...
'>
LISTS IN ‘E’
Lists
Syntax:
method_name([arg: type, …])[:return_type] is {
action;
};
METHODS
Methods can:
• Contain actions (procedural code).
• Declare and use local variables.
• Have zero to fourteen input arguments/parameters.
• Optionally return a value
• Optionally consume time if declared to be a “Time-Consuming
Method(TCM)”
1. if then else
Syntax
if bool-exp [then] {action; ...} [else if bool-exp [then]
{action; ...}] [else {action; ...}]
2. case labeled-case-item
Syntax
case case-exp {labeled-case-item; . [default: {default-action; .}]}
3. case bool-case-item
Syntax
case {bool-case-item; ... [default {default-action;...}]}
PROCEDURAL LOOP CONSTRUCTS
1. while
Syntax
while bool-exp [do] {action; ...}
2. repeat until
Syntax
repeat {action; ...} until bool-exp
3. for each in
Syntax
for each [type] [(item-name)] [using index (index-name)]
in [reverse] list-exp [do] {action; .}
4. for from to
Syntax
for var-name from from-exp [down] to to-exp [step
step-exp] [do] {action; .}
5. for
Syntax
for {initial-action; bool-exp; step-action} [do] {action;
...}
CONSTRAINTS
1. Hard Constraints
2. Soft Constraints
CONSTRAINTS
Constraints can be defined in many ways:
Invoking TCMs:
1.tcm()
Syntax
[[struct-exp].]method-name([parameter-list])
Description
-Calling a TCM
-You can call a TCM only from another TCM.
INVOKING TCM’S
2.start tcm()
Syntax
start [[struct-exp].]method-name([parameter-list])
Description
A start action can be used within another method, either a TCM or a regular method. A started TCM
begins execution either when its sampling event occurs or immediately, if the sampling event has
already occurred for the current Specman tick.
A started TCM runs in parallel with the TCM that started it on a separate thread.
Notes
. A TCM that has a return value cannot be started with a start action.
. You cannot start a TCM before the run phase begins or after the check phase begins.
PACKING AND UNPACKING
Packing performs concatenation of scalars, strings, list elements, or struct fields in the
order that you specify
Unpacking performs the reverse operation, splitting a single expression into multiple
expressions.
1.pack()
Syntax
pack(option:pack option, item: exp, .): list of bit
Parameters
packing.high Places the least significant bit of the last
physical field declared or the highest list item at index
[0] in the resulting list of bit.
packing.low Places the least significant bit of the first
physical field declared or lowest list item at index [0]
in the resulting list of bit.
USING SPECMAN
RUNNING A TEST
USING SOME DEBUG OPTIONS- BASIC
COVERAGE AND EXIT