Changes between Version 11 and Version 12 of Soclib Cc/Design Guide


Ignore:
Timestamp:
Mar 30, 2010, 3:08:39 AM (14 years ago)
Author:
Nicolas Pouillon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Soclib Cc/Design Guide

    v11 v12  
    1111 * Component indexation in the library tree
    1212 * Parametrization of source files
     13   (about C++, it means templated code)
    1314 * Build of all these files
     15 * compile all these with different SystemC implementations
     16 * compile all these with different compilation modes (debug, release, profiling, …)
     17 * without having to change build files
    1418
    15 We also want to be able to compile all these with different SystemC implementation
    16 and different compilation modes (debug, release, profiling, …) without having
    17 to change build files.
    18 
    19 As virtual prototypes
    20 may be huge but users always use the same parameters, we would like the
    21 following additional features:
    22  * Parallel compilation
    23  * Object caching (ccache could be an option)
    24 
    25 As we speak about C++, parametrization of source files uses templated code.
     19Additional features:
     20 * Parallel compilation (virtual prototypes may be huge)
     21 * Object caching (users nearly always use the same parameters — ccache is be an option)
    2622
    2723== Why ? ==
     
    3127 * Different SystemC backends (SystemC-OSCI, SystemCASS, SoCView)
    3228   each of them is a different implementation of the same LRM, and
    33    yields incompatible objects
     29   yields incompatible objects, thus objects have to be in separate
     30   directories in order to be able to reuse objects without conflicts
    3431 * Metadata-based component definition, including used source files.
    3532   Components are not necessarily implemented in an unique file, but
     
    3835   put all code in .h, having template code emitted at use in main C++
    3936   file. [[BR]]
    40    This is good for small utilities, but SystemC modules may
     37   This is good for small libraries (like STL), but SystemC modules may
    4138   be more than 1000 lines-long, and more that 40 of them may be used
    4239   in a topcell. This may yield a single translation unit with more than
    4340   50000 lines of code, heavily templated. This implies some usage issues
    4441   (compiler getting out of memory, unreasonnable compile times). [[BR]]
    45    Therefore we need two features:
    46    * Separate implementation: Put template class definition and implementation
     42   Therefore we need two more features:
     43   * Separate implementation: Put template class definition (header) and implementation (.cpp)
    4744     in two separate files. Compile them separately.
    4845     [[BR]]
    49      This implies template code must be explicitely instanciated with some
     46     This implies that the C++ templates must be explicitely instanciated with some
    5047     `template class Foo<parameters>;` code. It has to be done automatically.
    51    * Object reuse: Once modules built separately, we can put objects
     48   * Object reuse: Once modules are built separately, we can put objects
    5249     in a global repository and use the in a cached way.
    5350 * Different build modes (debugging, profiling release, others ??)
     
    5552== Why not reuse existing tools ? ==
    5653
    57 There is no build tool known out there which does object caching and
    58 template instantiation at the same time. Even if current build tools
     54There is no known build tool out there which does object caching and
     55template instantiation at the same time.
     56
     57Even if current build tools
    5958may be enhanced to do the job, this is not an easy task.
    6059Moreover, resulting code would be a kludge.
    61 This is all about flexibility, and user-input readability.
     60Soclib-cc has been implemented as a `make` wrapper before,
     61it was not usable:
     62 * generated Makefiles were unreadable (all templates parameters in the middle, …)
     63 * it did not work so well (make interprets `:` a special way, and escaping is nearly unusable)
     64 * the code generator was a big ugly piece of software
     65 * we still had to do `.sd` file indexation
     66 * we still had to emit template instantiation code
    6267
    63 This could be seen as reimplementing make, or even SCons, and this is
     68Soclib-cc could be seen as reimplementing make, or even SCons, and this is
    6469not totally wrong. But we added other features:
    6570 * Template instantiation
     
    6772 * Object caching
    6873
    69 Soclib-cc has been implemented as a `make` wrapper before,
    70 it was not usable:
    71  * generated Makefiles were unreadable (all templates parameters in the middle, …)
    72  * it did not work so well (make interprets `:` a special way, and escaping is nearly unusable)
    73  * the code generator was a big ugly piece of software
    74  * we still had to do `.sd` file indexation.
     74This is all about flexibility, and user-input readability.
    7575
    7676== Compilation flow ==