FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2005, 09:20 AM
Linh Hoang
Guest
 
Posts: n/a
Default task and module

Hi anyone,

i'm reading intro. to verilog and am confusing on these two things.
Aren't they the same? task, module, and function seem to do the same
thing. Which one should one stick to if the target is to have
synthesizable verilog design. Thank you for your help.
Reply With Quote
  #2 (permalink)  
Old 06-26-2005, 02:51 AM
SystemVerilog
Guest
 
Posts: n/a
Default Re: task and module

The following rules distinguish tasks from functions:

# A function shall execute in one simulation time unit;
a task can contain time-controlling statements.

# A function cannot enable a task;
a task can enable other tasks or functions.

# A function shall have at least one input type argument
and shall not have an output or inout type argument;
a task can have zero or more arguments of any type.

# A function shall return a single value;
a task shall not return a value.


difference between a module and task/function can be equated as
differnce between class and it's functions in C++.

Reply With Quote
  #3 (permalink)  
Old 06-27-2005, 06:33 AM
Rob Dekker
Guest
 
Posts: n/a
Default Re: task and module


"Linh Hoang" <[email protected]> wrote in message news:[email protected]..
> Hi anyone,
>
> i'm reading intro. to verilog and am confusing on these two things.
> Aren't they the same? task, module, and function seem to do the same
> thing. Which one should one stick to if the target is to have
> synthesizable verilog design. Thank you for your help.
>


Hi Linh,

A module is a bit different beast than a task or function.

A module defines a 'concurrently' executing model, essentially
directly modeling hardware.
E.g. : Ports on the top-level module become pins on the chip after synthesis.

Tasks and functions execute 'sequentially'. That is, they get called
as specific times (not concurrently) and execute their statements
one-by-one (after each other).

All three are synthesizable.

Rob


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What difference between task and module Horng-jyi Fuh Verilog 0 10-16-2004 07:59 AM
Problems with TASK - how to transfer data back to module? Troy Heagy Verilog 3 07-29-2004 07:10 PM
module inside module problem. shragafr Verilog 2 05-24-2004 08:03 PM
multiple task 'instances' Steven Sharp Verilog 2 07-24-2003 02:12 AM
System Task $fgets kumar Verilog 2 07-09-2003 01:10 AM


All times are GMT +1. The time now is 01:01 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved