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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [dejagnu/] [baseboards/] [basic-sim.exp] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# find_sim -- find a usable simulator
2
# This proc is local to this file and is used to locate a simulator to use.
3
# First we see if SIM=foo was specified on the command line.
4
# Otherwise we search the build tree, then $PATH.
5
 
6
proc find_sim { target_alias sim_dir sim_name } {
7
    global tool_root_dir;
8
    global SIM
9
 
10
    if [info exists SIM] {
11
        return $SIM
12
    }
13
 
14
    if [is_remote host] {
15
        if ![board_info host exists no_transform_name] {
16
            return ${target_alias}-${sim_name};
17
        } else {
18
            return ${sim_name};
19
        }
20
    }
21
 
22
    # We have to search because tool_root_dir may actually point to that blasted
23
    # "target" subdirectory.
24
    set try [lookfor_file ${tool_root_dir} sim/${sim_dir}/${sim_name}];
25
    if { $try != "" } {
26
        return $try;
27
    }
28
    return ${target_alias}-${sim_name};
29
}
30
 
31
proc setup_sim { subdir_name } {
32
    global target_alias;
33
    global tool_root_dir;
34
    global board;
35
 
36
    if [info exists target_alias] {
37
        set tmp $target_alias;
38
    } else {
39
        if [board_info $board exists target_install] {
40
            set tmp [lindex [board_info $board target_install] 0];
41
        }
42
    }
43
 
44
    if ![board_info $board exists sim] {
45
        set_board_info sim [find_sim $tmp $subdir_name run];
46
    }
47
 
48
    verbose "Using simulator [board_info $board sim]\n"
49
}
50
 
51
set_board_info is_simulator 1;

powered by: WebSVN 2.1.0

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