For SystemC, platform are composed of a custom topcell, i.e. a sc_main() function in a source file. This netlist source has to be linked with template C++ code of each component, using the right template parameters for all needed modules.
A platform description file contain such things:
This can be used by The soclib-cc command, with the soclib-cc -p option to build a complete simulator.
The global syntax is the same as .sd file syntax.
The root statement is an assignation of a Platform object to the todo variable.
Here is an example with a self-contained topcell (not using external modules):
todo = Platform('caba', 'top.cpp')
Parameters: |
|
---|
A complete example:
todo = Platform('caba', 'top.cpp',
uses = [
Uses('caba:vci_xcache_wrapper',
iss_t = 'common:mips32el'),
Uses('caba:vci_ram'),
Uses('caba:vci_vgmn'),
Uses('common:elf_file_loader'),
],
cell_size = 4,
plen_size = 6,
addr_size = 32,
rerror_size = 1,
clen_size = 1,
rflag_size = 1,
srcid_size = 8,
pktid_size = 1,
trdid_size = 1,
wrplen_size = 1
)
Semantically equivalent to its verbose counterpart:
todo = Platform('caba', 'top.cpp',
uses = [
Uses('caba:vci_xcache_wrapper',
iss_t = 'common:mips32el',
cell_size = 4,
plen_size = 6,
addr_size = 32,
rerror_size = 1,
clen_size = 1,
rflag_size = 1,
srcid_size = 8,
pktid_size = 1,
trdid_size = 1,
wrplen_size = 1),
Uses('caba:vci_ram',
cell_size = 4,
plen_size = 6,
addr_size = 32,
rerror_size = 1,
clen_size = 1,
rflag_size = 1,
srcid_size = 8,
pktid_size = 1,
trdid_size = 1,
wrplen_size = 1),
Uses('caba:vci_vgmn',
cell_size = 4,
plen_size = 6,
addr_size = 32,
rerror_size = 1,
clen_size = 1,
rflag_size = 1,
srcid_size = 8,
pktid_size = 1,
trdid_size = 1,
wrplen_size = 1),
Uses('common:elf_file_loader'),
],
)