DataTypes
Can't find PageSubscribe to include!
Performance of Data Types
The following study will show some aspects concerning different data types of SystemC.
A simple program was used, without modules and processes, just using the different data types of SystemC to calculate some arbitrary data. Operations in use were both arithmetic and logical operations in a jumbled up manner, repeated one million times in a loop. Those runs have been profiled to measure time consumption of single data types (using the GNU profiler gprof).
The results can be seen in the figure: All data types have been used with different bit-widths to cover multiple constellations (x-axis). The y-axis shows the time consumption in seconds, and the legend shows the data types in use.
SimulationPerformance(2f)DataTypes/attachments/sc_dt.jpg)
As you can see, sc_int and sc_uint seem to be fastest, although only lasting out until a width of 64 bits. Moreover, types like sc_bigint and sc_biguint should used only when necessary, because they are very slow. At very high bit-widths, the types sc_bv and sc_lv are slowest, and thus should only be used when really necessary.
The native C/C++-types ran so fast, their results cannot be shown in this figure, as you wouldn't see them. As a consequence, native C/C++ are the most performant. Not covered here is the usage of fixed point data types, but regarding performance, they fall even below sc_bv and sc_lv, hence, the SystemC fixed-point types are slowest.
So always be aware on which level of abstraction you are modeling, hence what data-types and methodologies apply for your level of abstraction.
PageComment2(commentfirst=1,nosmiley=1,articleview=1)
NewPage(PublicTemplate,New Page Here,SystemC/SimulationPerformance/DataTypes)
Posted January 8th, 2008 by MarkBurton