a question: task, function vs module

Thanks for all that helped in my last problem about det FSM. As a beginner, I always meet this situation: When some statements that perform a specific function and would be instantiated more than one times in a module, we may instantiate the statements as a function, a task or another module. For example, I may write a function, a task or a module to form a function of compare two signed number, and then instantiate it in my module. I want to ask that after synthesis and fitting, where are the differences when I am respectively writing statements as follow: /////////////////////////////////////////////////////////////////////////////////////////// //situation I module top_module(...); ... sub_module u1_submodule ( .port1(wire1), ... ); endmodule //sub module module sub_module(...); ... endmodule ///////////////////////////////////////////////////////////////////////////////////////////// //situation II module top_module(...); ... task_name(...); ... //task declaration task task_name; ... endtask endmodule ////////////////////////////////////////////////////////////////////////////////////////////// //situation III module top_module(...); ... function_name(...); ... //function declaration function function_name; ... endfunction endmodule ///////////////////////////////////////////////////////////////////////////////////////////////// Thanks a lot for any reply about differences between the 3 situations. YuQing Youth

Reply to
yyqonline
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.