Vl-taskdecl
Representation of a single Verilog task.
This is a product type introduced by defprod.
Fields
- name — stringp
- The name of this task.
- lifetime — vl-lifetime-p
- Indicates whether an explicit automatic or static
lifetime was provided. Each invocation of an automatic task
has its own copy of its variables. For instance, the task
below had probably better be automatic if it there are going to
be concurrent instances of it running, since otherwise
temp could be corrupted by the other task.
- portdecls — vl-portdecllist
- The input, output, and inout ports for the task.
- imports — vl-importlist
- Local package imports
- vardecls — vl-vardecllist
- Local variable declarations, including ones for the ports and
return value (see below); these are marked with
VL_HIDDEN_DECL_FOR_TASKPORT.
- paramdecls — vl-paramdecllist
- Local parameter declarations
- blockitems — vl-blockitemlist
- All the local declarations for the task; we sort these out into
the imports, vardecls, and paramdecls above.
- body — vl-stmt
- The statement that gives the actions for this task, i.e., the
entire begin/end statement in the below task.
- atts — vl-atts
- Any attributes associated with this task declaration.
- loc — vl-location
- Where this task was found in the source code.
Tasks are described in Section 10.2 of the Verilog-2005 standard.
An example of a task is:
task automatic dostuff;
input [3:0] count;
output inc;
output onehot;
output more;
reg [2:0] temp;
begin
temp = count[0] + count[1] + count[2] + count[3];
onehot = temp == 1;
if (!onehot) $display("onehot is %b", onehot);
#10;
inc = count + 1;
more = count > prev_count;
end
endtask
Tasks are somewhat like functions,
but they can have fewer restrictions, e.g., they can have multiple outputs, can
include delays, etc.
Subtopics
- Vl-taskdecl-p
- Recognizer for vl-taskdecl structures.
- Vl-taskdecl-fix
- Fixing function for vl-taskdecl structures.
- Make-vl-taskdecl
- Basic constructor macro for vl-taskdecl structures.
- Vl-taskdecl-equiv
- Basic equivalence relation for vl-taskdecl structures.
- Change-vl-taskdecl
- Modifying constructor for vl-taskdecl structures.
- Vl-taskdecl->vardecls
- Get the vardecls field from a vl-taskdecl.
- Vl-taskdecl->portdecls
- Get the portdecls field from a vl-taskdecl.
- Vl-taskdecl->paramdecls
- Get the paramdecls field from a vl-taskdecl.
- Vl-taskdecl->blockitems
- Get the blockitems field from a vl-taskdecl.
- Vl-taskdecl->name
- Get the name field from a vl-taskdecl.
- Vl-taskdecl->lifetime
- Get the lifetime field from a vl-taskdecl.
- Vl-taskdecl->imports
- Get the imports field from a vl-taskdecl.
- Vl-taskdecl->loc
- Get the loc field from a vl-taskdecl.
- Vl-taskdecl->body
- Get the body field from a vl-taskdecl.
- Vl-taskdecl->atts
- Get the atts field from a vl-taskdecl.