OpenCores
URL https://opencores.org/ocsvn/radiohdl/radiohdl/trunk

Subversion Repositories radiohdl

[/] [radiohdl/] [trunk/] [base/] [hdl_configfile.py] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 danv
###############################################################################
2
#
3
# Copyright (C) 2014-2018
4
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
6
#
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
#
20
# $Id: hdl_configfile.py 19237 2018-12-10 16:01:11Z overeem $
21
#
22
###############################################################################
23
 
24
from configfile import ConfigFile
25
 
26
__all__ = [ 'HdlTool', 'HdlBuildset', 'HdlLib']
27
 
28
 
29
class HdlTool(ConfigFile):
30
    """
31
    Class the represents the content of a hdltool_<tool>.cfg configuration file.
32
    """
33
    _HDLTOOL_ATTRIBUTES = []
34
 
35
    def __init__(self, filename, sections=None):
36
        """
37
        Read the hdltoolset configuration file and check presence of the required keys.
38
        :raise ConfigFileException
39
        """
40
        super(HdlTool, self).__init__(filename, sections, required_keys=self._HDLTOOL_ATTRIBUTES)
41
 
42
 
43
class HdlBuildset(ConfigFile):
44
    """
45
    Class the represents the content of a hdl_buildset_<buildset>.cfg configuration file.
46
    """
47
    _HDLBUILDSET_ATTRIBUTES = [ 'buildset_name', 'technology_names', 'family_names', 'block_design_names',
48
                               'lib_root_dirs', 'sim_tool_name', 'sim_tool_version',
49
                               'synth_tool_name', 'synth_tool_version' ]
50
 
51
    def __init__(self, filename, sections=None):
52
        """
53
        Read the hdlbuildset configuration file and check presence of the required keys.
54
        :raise ConfigFileException
55
        """
56
        super(HdlBuildset, self).__init__(filename, sections, required_keys=self._HDLBUILDSET_ATTRIBUTES)
57
 
58
    @property
59
    def ID(self):
60
        "Returns uniq ID (string) to identify this particular file."
61
        return self.buildset_name
62
 
63
 
64
class HdlLib(ConfigFile):
65
    """
66
    Class the represents the content of a hdllib.cfg configuration file.
67
    """
68
    _HDLLIB_ATTRIBUTES = [ 'hdl_lib_name', 'hdl_library_clause_name', 'hdl_lib_uses_synth',
69
                           'hdl_lib_uses_sim', 'hdl_lib_technology', 'synth_files',
70
                           'test_bench_files' ]
71
 
72
    def __init__(self, filename, sections=None):
73
        """
74
        Read the hdllib configuration file and check presence of the required keys.
75
        :raise ConfigFileException
76
        """
77
        super(HdlLib, self).__init__(filename, sections, required_keys=self._HDLLIB_ATTRIBUTES)
78
 
79
    @property
80
    def ID(self):
81
        "Returns uniq ID (string) to identify this particular file."
82
        return self.hdl_lib_name
83
 
84
 
85
 

powered by: WebSVN 2.1.0

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.