Connect dramcore to SoC bus in ECPIX-5 example
[gram.git] / libgram / README.md
1 # libgram, the C companion for gram
2
3 libgram is the C library for gram core initialization.
4
5 ## HowTo
6
7 Provide the CSV file from your LambdaSoC build to the Makefile:
8
9 ```bash
10 make CSR_CSV_FILE=$SOC_BUILD/soc/soc_resources.csv
11 ```
12
13 In your firmware:
14
15 ```C
16 #include <gram.h>
17
18 int main(void) {
19 int err = gram_init();
20
21 /* insert something meaningful here */
22
23 return 0;
24 }
25 ```
26
27 Link it to this library and you should be good to go!
28
29 ## Error handling
30
31 ```
32 GRAM_ERR_NONE: No error happened (hardcoded to zero)
33 GRAM_ERR_UNDOCUMENTED: Undocumented error, shame on us lazy coders (take a look at the code)
34 GRAM_ERR_MEMTEST: Memtest failed
35 ```