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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [dejagnu/] [lib/] [targetdb.exp] - Blame information for rev 1776

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Copyright (C) 97, 98, 1999 Free Software Foundation, Inc.
2
 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
 
17
# Please email any bugs, comments, and/or additions to this file to:
18
# DejaGnu@cygnus.com
19
 
20
#
21
# Searches in the appropriate place (the board_info array) for the specified
22
# information.
23
#
24
proc board_info { machine op args } {
25
    global target_info
26
    global board_info
27
 
28
    verbose "board_info $machine $op $args" 3
29
 
30
    if [info exists target_info($machine,name)] {
31
        set machine $target_info($machine,name);
32
    }
33
    if { $op == "exists" } {
34
        if { [llength $args] == 0 } {
35
            if [info exists board_info($machine,name)] {
36
                return 1;
37
            } else {
38
                return 0;
39
            }
40
        } else {
41
            if [info exists "board_info($machine,[lindex $args 0])"] {
42
                return 1;
43
            } else {
44
                return 0;
45
            }
46
        }
47
    }
48
    if { [llength $args] == 0 } {
49
        verbose "getting $machine $op" 3
50
        if [info exists board_info($machine,$op)] {
51
            return $board_info($machine,$op);
52
        } else {
53
            return ""
54
        }
55
    }
56
    return "";
57
}
58
 
59
proc target_info { op args } {
60
    return [eval "board_info target \"$op\" $args"];
61
}
62
 
63
proc host_info { op args } {
64
    return [eval "board_info host \"$op\" $args"];
65
}
66
 
67
#
68
# Fill in ENTRY with VALUE for the current board being defined.
69
#
70
proc set_board_info { entry value } {
71
    global board_info board;
72
 
73
    if ![info exists board_info($board,$entry)] {
74
        set board_info($board,$entry) $value;
75
    }
76
}
77
 
78
#
79
# Fill in ENTRY with VALUE for the current target.
80
#
81
proc set_currtarget_info { entry value } {
82
    global board_info;
83
 
84
    set board [target_info name];
85
 
86
    if ![info exists board_info($board,$entry)] {
87
        set board_info($board,$entry) $value;
88
    }
89
}
90
 
91
#
92
# Unset ENTRY for the current board being defined.
93
#
94
proc unset_board_info { entry } {
95
    global board_info board;
96
 
97
    if [info exists board_info($board,$entry)] {
98
        unset board_info($board,$entry);
99
    }
100
}
101
 
102
#
103
# Unset ENTRY for the current board being defined.
104
#
105
proc unset_currtarget_info { entry } {
106
    global board_info;
107
 
108
    set board [target_info name];
109
 
110
    if [info exists board_info($board,$entry)] {
111
        unset board_info($board,$entry);
112
    }
113
}

powered by: WebSVN 2.1.0

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