Changes between Version 11 and Version 12 of Soclib Cc/Design Guide
- Timestamp:
- Mar 30, 2010, 3:08:39 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Soclib Cc/Design Guide
v11 v12 11 11 * Component indexation in the library tree 12 12 * Parametrization of source files 13 (about C++, it means templated code) 13 14 * 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 14 18 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. 19 Additional features: 20 * Parallel compilation (virtual prototypes may be huge) 21 * Object caching (users nearly always use the same parameters — ccache is be an option) 26 22 27 23 == Why ? == … … 31 27 * Different SystemC backends (SystemC-OSCI, SystemCASS, SoCView) 32 28 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 34 31 * Metadata-based component definition, including used source files. 35 32 Components are not necessarily implemented in an unique file, but … … 38 35 put all code in .h, having template code emitted at use in main C++ 39 36 file. [[BR]] 40 This is good for small utilities, but SystemC modules may37 This is good for small libraries (like STL), but SystemC modules may 41 38 be more than 1000 lines-long, and more that 40 of them may be used 42 39 in a topcell. This may yield a single translation unit with more than 43 40 50000 lines of code, heavily templated. This implies some usage issues 44 41 (compiler getting out of memory, unreasonnable compile times). [[BR]] 45 Therefore we need two features:46 * Separate implementation: Put template class definition and implementation42 Therefore we need two more features: 43 * Separate implementation: Put template class definition (header) and implementation (.cpp) 47 44 in two separate files. Compile them separately. 48 45 [[BR]] 49 This implies t emplate codemust be explicitely instanciated with some46 This implies that the C++ templates must be explicitely instanciated with some 50 47 `template class Foo<parameters>;` code. It has to be done automatically. 51 * Object reuse: Once modules built separately, we can put objects48 * Object reuse: Once modules are built separately, we can put objects 52 49 in a global repository and use the in a cached way. 53 50 * Different build modes (debugging, profiling release, others ??) … … 55 52 == Why not reuse existing tools ? == 56 53 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 54 There is no known build tool out there which does object caching and 55 template instantiation at the same time. 56 57 Even if current build tools 59 58 may be enhanced to do the job, this is not an easy task. 60 59 Moreover, resulting code would be a kludge. 61 This is all about flexibility, and user-input readability. 60 Soclib-cc has been implemented as a `make` wrapper before, 61 it 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 62 67 63 Thiscould be seen as reimplementing make, or even SCons, and this is68 Soclib-cc could be seen as reimplementing make, or even SCons, and this is 64 69 not totally wrong. But we added other features: 65 70 * Template instantiation … … 67 72 * Object caching 68 73 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. 74 This is all about flexibility, and user-input readability. 75 75 76 76 == Compilation flow ==