summaryrefslogtreecommitdiff
path: root/volk/gen/make_config_fixed.py
blob: 3fd1bdf0aa7c588972d6803ac0ec9f0b3123d75f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from xml.dom import minidom

def make_config_fixed(dom) :
    tempstring = "";
    tempstring = tempstring +'/*this file is auto generated by volk_register.py*/';
    tempstring = tempstring + '\n#ifndef INCLUDED_VOLK_CONFIG_FIXED_H';
    tempstring = tempstring + '\n#define INCLUDED_VOLK_CONFIG_FIXED_H';
    tempstring = tempstring + '\n\n';
    enum_counter = 0;
    for domarch in dom:
        arch = str(domarch.attributes["name"].value);
        tempstring = tempstring + '#define LV_' + arch.swapcase() + " " + str(enum_counter) + '\n';
        enum_counter = enum_counter + 1;
    tempstring = tempstring + '\n\n';

    tempstring = tempstring + "#endif /*INCLUDED_VOLK_CONFIG_FIXED*/\n"

    return tempstring;