Changes between Version 3 and Version 4 of Soclib Cc/Design Guide
- Timestamp:
- Mar 25, 2010, 12:51:24 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Soclib Cc/Design Guide
v3 v4 9 9 each of them is a different implementation of the same LRM, and 10 10 yields incompatible objects 11 * Templated classes, with separate implementation. 12 In order to reduce compilation time when a file changes, splitting 13 implementation from header is the right thing to do. Unfortunatelly 14 it involves manually instaciating source code for each used 15 template. 11 12 * Templated classes. The usual way of using templated code is to 13 put all code in .h, having template code emitted at use in main C++ 14 file. 15 16 This is good for small utilities, but SystemC modules may 17 be more than 1000 lines-long, and more that 40 of them may be used 18 in a topcell. This may yield a single translation unit with more than 19 50000 lines of code, heavily templated. This implies some usage issues 20 (compiler getting out of memory, unreasonnable compile times) 21 22 Therefore we need two features: 23 * Separate implementation: Put template class definition and implementation 24 in two separate files. Compile them separately. 25 26 This implies template code must be explicitely instanciated with some 27 `template class Foo<parameters>;` code. It has to be done automatically. 28 * Object reuse: Once modules built separately, we can put objects 29 in a global repository and use the in a cached way. 30 16 31 * Different build modes (debugging, profiling release, others ??) 17 * Compiled objects reuse: as we may build lots of SoCs with minor18 modifications, reusing compiled objects from one build to the other19 seems interesting (considering templated C++ build time)20 32 21 33 === Reuse of current tools ?? === … … 25 37 readibility. 26 38 39 There is no build tool known out the which does object caching and 40 template instantiation at the same time. Even if current build tools 41 may be enhanced to do the job, this is not an easy task. 42 27 43 This very tool has been implemented as a `make` wrapper before, 28 44 generated Makefiles were unreadable (all templates parameters in the 29 middle, ...), and it did not work so well. It had been developped in a 30 week, debugged in two weeks. 45 middle, ...), and it did not work so well. 31 46 32 Soclib-cc has been totally developped in 16 hours.33 47 34 48 = Configuration = … … 36 50 In order to compile SoCLib objects, we need: 37 51 * a working SystemC installation 38 * a working GNU-Bfd installation (used for loading binaries into the platform)39 52 * a working GNU-C++ compiler 40 53