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


Tutorials



METHODS



e methods are similar to C functions, Verilog tasks, and VHDL processes.
Methods can contain actions (procedural code). User can declare and use local variables and parameters. Methods can have zero to fourteen input arguments/parameters. You can work around this restriction by passing a compound parameter such as a struct or a list. It can aslo optionally return a value .



EXAMPLE:
<'
struct A {my_type() is {out("I am type A")}};
extend sys {
a: A;
run() is also {
a.my_type();
};
};
'>

RESULT:

I am type A



Time-Consuming Methods(Tcms)



A TCM is a time-consuming method that is distinguished from a regular method by the presence of @event and can use time-consuming actions such as sync and wait.


EXAMPLE:
<'
struct data_drive {
event clk is rise('top.clk') @sim;
data: list of int;
driver() @clk is {
for each in data {
wait true('top.data_ready'== 1);
// Will not fall through, even if the condition
// holds when the wait is reached.
'top.in_reg' = it;
};
stop_run();
};
shadow() @clk is {
while TRUE {
sync true('top.data_ready' == 0);
// If the condition holds, the sync falls through.
out("Shadow read ", 'top.in_reg');
wait cycle;
// This wait is necessary to prevent
// an infinite loop.
};
};
run() is also {
start driver();
start shadow();
};
};
'>

Invoking Tcms:



start tcm() Syntax start [[struct-exp].]method-name([parameter-list])

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.



EXAMPLE:
<'
struct meth {
event clk is rise('top.clk');
run() is also {
out("Starting mainâ~@¦");
start main();
};
};
'>

Execution Flow



Specman Elite provides a predetermined execution flow composed of â~@~\test phasesâ~@~].

Each test phase is called in a specific order.
Each test phase is represented by a predefined method.
Most predefined methods are meant to be extended.
Extend a predefined method to call your method(s) at the appropriate time.

---------------------
Execution Phases
---------------------
--Initialization
--Pre-run generation
--Simulation run
--Post-run check
--Finalization
---------------------


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