SlideShare a Scribd company logo
1
Verilog HDLVerilog HDL
ASIC DESIGN USING
FPGA
BEIT VII
KICSIT
Sept 24 2012 Lecture 12
2
Tasks
Sept 24 2012
• In Verilog, you may use a task to encapsulate a
behavior.
• It is defined in a module.
• It is invoked when its name is called in the
procedural code.
• It has access to all data objects, so it does not
need inputs, outputs, though it can have inputs,
outputs and inouts.
Lecture 12
3
Tasks
Sept 24 2012
• You can use the task statement to structure your
Verilog code so that a portion of code is reusable.
• Task may take more than zero time to
complete ; they can have delays (#), wait
statements and event controls (@) in them.
• Task may call other Tasks and Functions.
Lecture 12
4
Tasks
Sept 24 2012
• The definition of a task is the following:
task <task name>; // Notice:
no parameter list or ()s
<argument ports>
<declarations>
<statements>
endtask
•An invocation of a task is of the following form:
<name of task> (<port list>);Lecture 12
5
Tasks
Sept 24 2012
• Tasks can be used to apply stimulus;
module hello_tsk ;
initial begin
say_hello ; // Task
say_hello ; // Task
end
task say_hello;
$display(“ Hello Verilog Tasks! ”) ;
endtask
endmodule
Lecture 12
6
Tasks
Sept 24 2012
module test_adder_t3;
reg [7:0] a, b;
reg cin;
wire [7:0] sum, sum_chk;
wire cout, cout_chk;
// RTL Instance
adder adder_inst(a, b, cin, sum, cout);
//Model instance
adder_model adder_model_inst(a,b,cin,sum_chk,cout_chk);
initial begin
test_design(0, 0, 0); // Task
test_design(0, 1, 1); // Task
test_design(10, 34 1); // Task
test_design(150, 85, 0); // Task
end Lecture 12
7
Tasks
Sept 24 2012
task test_design;
input [7:0] ax, bx;
input cx;
begin
a = ax; b = bx; cin = cx;
#50 if(sum !== sum_chk || cout !== cout_chk)
begin
$display(“ERROR: Sum is wrong");
$stop;
end
end
endtask
endmodule
Lecture 12
8
Tasks
Sept 24 2012 Lecture 12

More Related Content

PPTX
Madeo - a CAD Tool for reconfigurable Hardware
ESUG
 
PDF
Realizing Fine-Grained and Flexible Access Control to Outsourced Data with At...
Mateus S. H. Cruz
 
PDF
Power tools in Java
DPC Consulting Ltd
 
PPT
Coding style for good synthesis
Vinchipsytm Vlsitraining
 
PDF
Functions and tasks in verilog
Nallapati Anindra
 
DOCX
applist
babak danyal
 
PPT
Verilog Tasks and functions
Vinchipsytm Vlsitraining
 
PPT
Assic 13th Lecture
babak danyal
 
Madeo - a CAD Tool for reconfigurable Hardware
ESUG
 
Realizing Fine-Grained and Flexible Access Control to Outsourced Data with At...
Mateus S. H. Cruz
 
Power tools in Java
DPC Consulting Ltd
 
Coding style for good synthesis
Vinchipsytm Vlsitraining
 
Functions and tasks in verilog
Nallapati Anindra
 
applist
babak danyal
 
Verilog Tasks and functions
Vinchipsytm Vlsitraining
 
Assic 13th Lecture
babak danyal
 

Similar to Assic 12th Lecture (20)

PPTX
Verilogspk1
supriya kurlekar
 
PPTX
a verilog presentation for deep concept understa
SRAJALDWIVEDI1
 
PPT
Assic 4th Lecture
babak danyal
 
PPT
Unit 4 - Features of Verilog HDL (1).ppt
partheepan118
 
PDF
L03_4.pdf
SHIVANSHKAUSHIK22
 
PPT
Verilog Lecture2 thhts
Béo Tú
 
PPT
Fpga 13-task-and-functions
Malik Tauqir Hasan
 
PPTX
Verilog overview
posdege
 
PPT
verilog
Shrikant Vaishnav
 
PPTX
Functional and code coverage verification using System verilog
JuhaMichel
 
PPT
Fpga 05-verilog-programming
Malik Tauqir Hasan
 
PDF
SKEL 4273 CAD with HDL Topic 2
alhadi81
 
PDF
DDUV.pdf
VandanaPagar1
 
PPTX
systemverilog and veriog presentation
KhushiV8
 
PDF
Vhdl introduction
VandanaPagar1
 
PPTX
Verilog Final Probe'22.pptx
SyedAzim6
 
PDF
7 Elements Of Verilog HDL
Allison Koehn
 
PDF
Verilog HDL
HasmukhPKoringa
 
PPT
Verilog Hardware Description Language.ppt
MrRRThirrunavukkaras
 
PPT
Basics of Verilog.ppt
CoEBMSITM
 
Verilogspk1
supriya kurlekar
 
a verilog presentation for deep concept understa
SRAJALDWIVEDI1
 
Assic 4th Lecture
babak danyal
 
Unit 4 - Features of Verilog HDL (1).ppt
partheepan118
 
Verilog Lecture2 thhts
Béo Tú
 
Fpga 13-task-and-functions
Malik Tauqir Hasan
 
Verilog overview
posdege
 
Functional and code coverage verification using System verilog
JuhaMichel
 
Fpga 05-verilog-programming
Malik Tauqir Hasan
 
SKEL 4273 CAD with HDL Topic 2
alhadi81
 
DDUV.pdf
VandanaPagar1
 
systemverilog and veriog presentation
KhushiV8
 
Vhdl introduction
VandanaPagar1
 
Verilog Final Probe'22.pptx
SyedAzim6
 
7 Elements Of Verilog HDL
Allison Koehn
 
Verilog HDL
HasmukhPKoringa
 
Verilog Hardware Description Language.ppt
MrRRThirrunavukkaras
 
Basics of Verilog.ppt
CoEBMSITM
 
Ad

More from babak danyal (20)

PPT
Easy Steps to implement UDP Server and Client Sockets
babak danyal
 
PPT
Java IO Package and Streams
babak danyal
 
PPT
Swing and Graphical User Interface in Java
babak danyal
 
PPT
Tcp sockets
babak danyal
 
PPTX
block ciphers and the des
babak danyal
 
PPT
key distribution in network security
babak danyal
 
PPT
Lecture10 Signal and Systems
babak danyal
 
PPT
Lecture8 Signal and Systems
babak danyal
 
PPT
Lecture7 Signal and Systems
babak danyal
 
PPT
Lecture6 Signal and Systems
babak danyal
 
PPT
Lecture5 Signal and Systems
babak danyal
 
PPT
Lecture4 Signal and Systems
babak danyal
 
PPT
Lecture3 Signal and Systems
babak danyal
 
PPT
Lecture2 Signal and Systems
babak danyal
 
PPT
Lecture1 Intro To Signa
babak danyal
 
PPT
Lecture9 Signal and Systems
babak danyal
 
PPT
Lecture9
babak danyal
 
PPT
Cns 13f-lec03- Classical Encryption Techniques
babak danyal
 
PPT
Classical Encryption Techniques in Network Security
babak danyal
 
DOCX
Problems at independence
babak danyal
 
Easy Steps to implement UDP Server and Client Sockets
babak danyal
 
Java IO Package and Streams
babak danyal
 
Swing and Graphical User Interface in Java
babak danyal
 
Tcp sockets
babak danyal
 
block ciphers and the des
babak danyal
 
key distribution in network security
babak danyal
 
Lecture10 Signal and Systems
babak danyal
 
Lecture8 Signal and Systems
babak danyal
 
Lecture7 Signal and Systems
babak danyal
 
Lecture6 Signal and Systems
babak danyal
 
Lecture5 Signal and Systems
babak danyal
 
Lecture4 Signal and Systems
babak danyal
 
Lecture3 Signal and Systems
babak danyal
 
Lecture2 Signal and Systems
babak danyal
 
Lecture1 Intro To Signa
babak danyal
 
Lecture9 Signal and Systems
babak danyal
 
Lecture9
babak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
babak danyal
 
Classical Encryption Techniques in Network Security
babak danyal
 
Problems at independence
babak danyal
 
Ad

Recently uploaded (20)

PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 

Assic 12th Lecture

  • 1. 1 Verilog HDLVerilog HDL ASIC DESIGN USING FPGA BEIT VII KICSIT Sept 24 2012 Lecture 12
  • 2. 2 Tasks Sept 24 2012 • In Verilog, you may use a task to encapsulate a behavior. • It is defined in a module. • It is invoked when its name is called in the procedural code. • It has access to all data objects, so it does not need inputs, outputs, though it can have inputs, outputs and inouts. Lecture 12
  • 3. 3 Tasks Sept 24 2012 • You can use the task statement to structure your Verilog code so that a portion of code is reusable. • Task may take more than zero time to complete ; they can have delays (#), wait statements and event controls (@) in them. • Task may call other Tasks and Functions. Lecture 12
  • 4. 4 Tasks Sept 24 2012 • The definition of a task is the following: task <task name>; // Notice: no parameter list or ()s <argument ports> <declarations> <statements> endtask •An invocation of a task is of the following form: <name of task> (<port list>);Lecture 12
  • 5. 5 Tasks Sept 24 2012 • Tasks can be used to apply stimulus; module hello_tsk ; initial begin say_hello ; // Task say_hello ; // Task end task say_hello; $display(“ Hello Verilog Tasks! ”) ; endtask endmodule Lecture 12
  • 6. 6 Tasks Sept 24 2012 module test_adder_t3; reg [7:0] a, b; reg cin; wire [7:0] sum, sum_chk; wire cout, cout_chk; // RTL Instance adder adder_inst(a, b, cin, sum, cout); //Model instance adder_model adder_model_inst(a,b,cin,sum_chk,cout_chk); initial begin test_design(0, 0, 0); // Task test_design(0, 1, 1); // Task test_design(10, 34 1); // Task test_design(150, 85, 0); // Task end Lecture 12
  • 7. 7 Tasks Sept 24 2012 task test_design; input [7:0] ax, bx; input cx; begin a = ax; b = bx; cin = cx; #50 if(sum !== sum_chk || cout !== cout_chk) begin $display(“ERROR: Sum is wrong"); $stop; end end endtask endmodule Lecture 12
  • 8. 8 Tasks Sept 24 2012 Lecture 12