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

Subversion Repositories t400

[/] [t400/] [trunk/] [sw/] [run_regression.pl] - Blame information for rev 116

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

Line No. Rev Author Line
1 61 arniml
#!/usr/bin/perl -w
2
#
3
##############################################################################
4
#
5
# run_regression.pl
6
#
7 116 arniml
# $Id: run_regression.pl,v 1.3 2006-06-05 21:03:05 arniml Exp $
8 61 arniml
#
9
# Copyright (c) 2006, Arnim Laeuger (arniml@opencores.org)
10
#
11
# All rights reserved
12
#
13
# ############################################################################
14
#
15
# Purpose:
16
# ========
17
#
18
# Runs regression suite over all testcells found in $PROJECT_DIR/sw/verif.
19
#
20
# The testcells are identified by searching for the testbench identifiers
21
# as defined below for %testbenches.
22
# Then each testcell is built and executed with the specified testcells.
23
#
24
 
25
use strict;
26
 
27
 
28
my $project_dir = $ENV{'PROJECT_DIR'};
29
my $verif_dir   = $project_dir.'/sw/verif';
30
my $sim_dir     = $project_dir.'/sim/rtl_sim';
31
 
32
# the testbenches and their identifiers
33
my %testbenches = ('t41x' => './tb_t411_behav_c0',
34 74 arniml
                   't42x' => './tb_t420_behav_c0',
35 116 arniml
                   'int'  => './tb_int_behav_c0',
36
                   'mb'   => './tb_microbus_behav_c0');
37 61 arniml
my ($tb_name, $tb_exec);
38
 
39
# identify the directories below $verif_dir containing test classes
40 116 arniml
my @classes_dirs = ('black_box', 'int', 'system');
41 61 arniml
 
42
my $dir;
43
my %testdirs;
44
 
45
# common GHDL options
46
my $ghdl_options = '--assert-level=error';
47
 
48
 
49
##############################################################################
50
# find all test directories for all the testbenches
51
#
52
foreach $dir (@classes_dirs) {
53
    $dir = $verif_dir.'/'.$dir;
54
 
55
    while (($tb_name, $tb_exec) = each(%testbenches)) {
56
        my $elem;
57 74 arniml
        my @dirs = `find $dir -type f -name $tb_name`;
58 61 arniml
 
59
        foreach $elem (@dirs) {
60
            $elem =~ s/\/[^\/]+$//;
61
            $testdirs{$elem} = 1;
62
        }
63
    }
64
}
65
 
66
 
67
##############################################################################
68
# run through all tests and execute the enabled testbenches
69
#
70
chdir($sim_dir);
71
while (($dir, $tb_exec) = each(%testdirs)) {
72
    # remove all previous hex files
73
    system('rm -f *.hex');
74
 
75
    chdir($dir);
76
    print("Building $dir\n");
77
    if (system('make all clean') == 0) {
78
        my @execute_tbs;
79
 
80
        # collect the testbenches to be executed
81
        while (($tb_name, $tb_exec) = each(%testbenches)) {
82 74 arniml
            if (-f $tb_name) {
83 61 arniml
                push(@execute_tbs, $tb_name);
84
            }
85
        }
86
 
87
        # and finally execute them
88
        chdir($sim_dir);
89
        foreach $tb_name (@execute_tbs) {
90
            print("Executing for $tb_name\n");
91
            system("$testbenches{$tb_name} $ghdl_options");
92
        }
93
    } else {
94
        print("Build failed\n");
95
    }
96
}

powered by: WebSVN 2.1.0

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