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()isalso{ 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:listof int; driver()@clk is{ foreachin 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{ whileTRUE{ 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()isalso{ start driver(); start shadow(); }; }; '>
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.
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.