Download Describing Synthesizable RTL in SystemC
Transcript
Member Functions
You can declare member functions in a module that are not
processes. This type of member function is not registered as a
process in the module’s constructor. It can be called from a process.
Member functions can contain any synthesizable C++ or SystemC
statement allowed in a SC_METHOD process.
A member function that is not a process can return any
synthesizable data type.
Module Constructor
For each module you need to create a constructor, which is used to
•
Register processes
•
Define a sensitivity list for an SC_METHOD process
For synthesis, other statements are not allowed in the constructor.
See Example 2-4.
Implementing the Module
In the module implementation file, define the functionality of each
SC_METHOD process and member function. Example 2-5 shows a
minimal implementation file.
Example 2-5 Module Implementation File
#include "systemc.h"
#include "my_module.h"
void my_module::my_method_proc() {
// describe process functionality as C++ code
}
Creating SystemC Modules for RTL Synthesis: Creating a Module
2-15