Search code examples
c++systemc

Is it possible to use System C data types in C++ without the entire System C kernel?


System C provides arbitrary length integer types that can be manipulated either as numbers (i.e. with support for artihmetic) or as bit-vectors (i.e. with support for logic operations and working with sub-vectors).

System C also provides support for all sorts of other things I don't want, such as clocks, flip flops and such, as well as its own runtime. I'm picky - I want the datatypes without the overhead.

Can these data types be used independently of the rest of the system C kernel? If so, how?


Solution

  • I'm not familiar with SystemC, but I do always like to point out that in open source projects, you can get the answer from the horse's mouth.

    Browsing the CPP files which implement the integer type, it seems to depend on things in datatypes/, utils/, and kernel/:

    http://github.com/systemc/systemc-2.2.0/tree/master/src/sysc/datatypes/int/

    If the static linking that Jerry suggests doesn't pare it down enough to what seems reasonable (due to some kind of unnecessary global or subsystem inits), you could fork it off GitHub for your minimalist version if it's important to do so...but there's always a cost to maintaining your own branch.

    (Or you could contribute a meta-system for paring down bits of system-C people don't need which might get incorporated into the main distribution!)