Fundamental datatype are:
Files contain declarations of different modules. Basic module types are:
These declarations can use fundamental datatypes and statements, among them:
Module, PortDecl and Signal take the declared module name as first argument. All other arguments are named and specify attached metadata.
Defines a new module. Module can be either actual entities, or simple helper modules, like pure C++ classes.
Parameters: |
|
---|
Example declaring a component named “caba:my_module” in the Module Index, implemented as the MyModule class, with code in the my_module.h and my_module.cc files:
Module("caba:my_module",
classname = "MyModule",
header_files = ["my_module.h"],
implementation_files = ["my_module.cc"],
)
Defines a new signal type
Parameters: |
---|
Defines a new port type.
Parameters: |
---|
Example defining the bit type:
# A bit signal only supports one driver, but any number of bit input
# ports may be connected on it.
# No specific header files are necessary for these declarations as
# they use builtin SystemC types.
Signal('caba:bit',
classname = 'sc_core::sc_signal<bool>',
accepts = {'caba:bit_in' : True,
'caba:bit_out' : 1,
},
)
PortDecl('caba:bit_in',
signal = 'caba:bit',
classname = 'sc_core::sc_in<bool>',
)
PortDecl('caba:bit_out',
signal = 'caba:bit',
classname = 'sc_core::sc_out<bool>',
)
If the module uses another module internally, we may want to declare this also. Uses() statement serves this goal.
Parameters: |
|
---|
Example with “caba:my_super_module” using “caba:my_module”:
Module("caba:my_super_module",
classname = "MySuperModule",
header_files = ["my_super_module.h"],
implementation_files = ["my_super_module.cc"],
uses = [
Uses("caba:my_module"),
],
)
Port statements declare a port with a given type and name.
Parameters: |
|
---|
Supported types are either:
Built-in port types, depending on language:
Example:
Port("rtl:bit_in", "p_in0")
Word-based ports need a W parameter to set their width:
Port("rtl:word_out", "p_result", W = 5)
If a port is connected to a specific net, this can be hinted through the auto keyword:
Port('caba:bit_in', 'p_resetn', auto = 'resetn')
Other composite port types declared with a PortDecl() statement.
Usage in a module with one output IRQ port, and 10 input IRQ ports:
Module("caba:my_super_module",
classname = "MySuperModule",
ports = [
Port('caba:bit_out','p_irq'),
Port('caba:bit_in','p_irq_in', 10),
],
)