quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bullet_green_ball.gif Introduction

Modules are the basic building block within SystemC to partition a design. Modules allow designers to break complex systems into smaller more manageable pieces. Modules help split complex designs among a number of different designers in a design group. Modules allow designers to hide internal data representation and algorithms from other modules. This forces designers to use public interfaces to other modules, and the entire system becomes easier to change and easier to maintain. Modules are similar to module in Verilog and Entity in VHDL.

   

space.gif

A Module should in basic should contain ports, constructor, and methods/functions to work on the ports. Below is list of parts of a module.

   

space.gif

  • ports
  • Internal Variables
  • Constructor
  • Internal Methods.
   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif SC_MODULE

In SystemC modules are declared with SystemC keyword SC_MODULE. Below is syntax of a SC_MODULE.

   

space.gif

Syntax :

   

space.gif


 1 SC_MODULE("module_name") {
 2   // module body
 3 }
You could download file module_syntax.cpp here
   

space.gif

Here

  • SC_MODULE : Macro or reserve word
  • module_name : Any valid module name
   

space.gif

If you don't want to use SC_MODULE macro and want to write in pure C++ syntax, then you can write as below.

   

space.gif


 1 class module_name : sc_module {
 2   // Module body
 3 }
You could download file module_cpp.cpp here
   

space.gif

This form of declaration resembles a typical C++ declaration of a struct or a class. The macro SC_MODULE provides an easy and very readable way to describe the module.

   

space.gif

  ../images/main/bullet_star_pink.gif Example SC_MODULE
   

space.gif


 1 // All systemc code should include systemc.h file
 2 #include "systemc.h"
 3 // SC_MODULE is macro, hello_world is module name
 4 SC_MODULE (hello_world) {
 5   // Body of module hello_world
 6 };
You could download file module.cpp here
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com