| 1 | == Config files == |
| 2 | |
| 3 | DSX configuration is done through dedicated configuration files. |
| 4 | The following files are evaluated in order: |
| 5 | |
| 6 | * `$DSX_DIR/etc/dsx.conf` |
| 7 | Default config, system wide. |
| 8 | * `~/.dsx.conf` |
| 9 | In your home dir, default config, user wide |
| 10 | * `./dsx.conf` |
| 11 | Setup for current directory / project. |
| 12 | |
| 13 | == Syntax == |
| 14 | |
| 15 | Config files have an "ini-like" syntax, much like windows ini files. |
| 16 | {{{ |
| 17 | # Comment |
| 18 | ; Another commentaire |
| 19 | [section] |
| 20 | key1 = value1 |
| 21 | key2 = value2 |
| 22 | key3 = multi-line |
| 23 | value, subsequent lines to |
| 24 | concatenate must begin with a |
| 25 | whitespace character. |
| 26 | |
| 27 | [another-section] |
| 28 | key = val |
| 29 | }}} |
| 30 | |
| 31 | Parser has a great feature: it may extend contents of a variable within another with %(variable-name)s syntax: |
| 32 | |
| 33 | {{{ |
| 34 | [calc] |
| 35 | oper = 2x3 |
| 36 | result = 6 |
| 37 | long = the expression %(oper)s equals %(result)s |
| 38 | short = %(oper)s = %(result)s |
| 39 | }}} |
| 40 | |
| 41 | == DSX' interpretation == |
| 42 | |
| 43 | Section [defaults] describes sections to look at for project parts: |
| 44 | |
| 45 | {{{ |
| 46 | [defaults] |
| 47 | soclib = soclib-exemple |
| 48 | systemc = systemc-exemple |
| 49 | |
| 50 | [systemc-exemple] |
| 51 | dir = /users/exemple/systemc-2.1.0 |
| 52 | os = linux |
| 53 | |
| 54 | [soclib-exemple] |
| 55 | dir = /users/exemple/soclib |
| 56 | }}} |
| 57 | |
| 58 | This makes it easier to switch between different concurent configurations |
| 59 | |
| 60 | == Sections to fill == |
| 61 | |
| 62 | DSX config defines paths for your actual system configuration |
| 63 | |
| 64 | * Compilation options and paths for SystemC, SystemCASS or any other SystemC implementation |
| 65 | * Path to SoCLIB |
| 66 | * Paths and prefixes to cross compilation software suite |
| 67 | |
| 68 | === SystemC, SystemCASS === |
| 69 | |
| 70 | Mandatory configuration items for SystemC implementation are: |
| 71 | |
| 72 | * `nickname` |
| 73 | Type of implementation, possible values are: systemc, systemcass. |
| 74 | * `cflags` |
| 75 | Additionnal compile-time arguments, typically include paths, -W options, ... |
| 76 | * `libdir` |
| 77 | Additionnal link-time arguments, typically library paths |
| 78 | * `libs` |
| 79 | Libraries |
| 80 | * `cxx` |
| 81 | C++ compiler, default is g++. |
| 82 | |
| 83 | Example: |
| 84 | {{{ |
| 85 | [systemcass-labo] |
| 86 | ; Globally substitued variables |
| 87 | dir=/users/outil/systemc/systemcass/systemcass/latest |
| 88 | os=i686-Linux.SLA4x |
| 89 | |
| 90 | ; Generic declaration |
| 91 | nickname=systemcass |
| 92 | cflags=-I%(dir)s/include -O3 -rdynamic |
| 93 | libdir=%(dir)s/lib-%(os)s |
| 94 | libs=-lsystemc -ldl -rdynamic |
| 95 | cxx=g++ |
| 96 | }}} |
| 97 | |
| 98 | === Cross compilers === |
| 99 | |
| 100 | Options: |
| 101 | |
| 102 | * `cc-prefix` |
| 103 | Prefix for tools' names |
| 104 | * `cc-cflags` |
| 105 | Additionnal compile time flags |
| 106 | |
| 107 | Example: |
| 108 | {{{ |
| 109 | [mipsel] |
| 110 | cc-prefix=mipsel-unknown-elf- |
| 111 | cc-cflags=-O2 -Wall |
| 112 | |
| 113 | [ppc] |
| 114 | cc-prefix=/usr/local/cctools/ppc/bin/ppc-unknown-elf- |
| 115 | cc-cflags=-O2 -Wall |
| 116 | }}} |