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

Subversion Repositories t400

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

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 127 arniml
# $Id: run_regression.pl,v 1.4 2006-06-10 19:38:27 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 127 arniml
                   'mb'   => './tb_microbus_behav_c0',
37
                   'prod' => './tb_prod_behav_c0');
38 61 arniml
my ($tb_name, $tb_exec);
39
 
40
# identify the directories below $verif_dir containing test classes
41 116 arniml
my @classes_dirs = ('black_box', 'int', 'system');
42 61 arniml
 
43
my $dir;
44
my %testdirs;
45
 
46
# common GHDL options
47
my $ghdl_options = '--assert-level=error';
48
 
49
 
50
##############################################################################
51
# find all test directories for all the testbenches
52
#
53
foreach $dir (@classes_dirs) {
54
    $dir = $verif_dir.'/'.$dir;
55
 
56
    while (($tb_name, $tb_exec) = each(%testbenches)) {
57
        my $elem;
58 74 arniml
        my @dirs = `find $dir -type f -name $tb_name`;
59 61 arniml
 
60
        foreach $elem (@dirs) {
61
            $elem =~ s/\/[^\/]+$//;
62
            $testdirs{$elem} = 1;
63
        }
64
    }
65
}
66
 
67
 
68
##############################################################################
69
# run through all tests and execute the enabled testbenches
70
#
71
chdir($sim_dir);
72
while (($dir, $tb_exec) = each(%testdirs)) {
73
    # remove all previous hex files
74
    system('rm -f *.hex');
75
 
76
    chdir($dir);
77
    print("Building $dir\n");
78
    if (system('make all clean') == 0) {
79
        my @execute_tbs;
80
 
81
        # collect the testbenches to be executed
82
        while (($tb_name, $tb_exec) = each(%testbenches)) {
83 74 arniml
            if (-f $tb_name) {
84 61 arniml
                push(@execute_tbs, $tb_name);
85
            }
86
        }
87
 
88
        # and finally execute them
89
        chdir($sim_dir);
90
        foreach $tb_name (@execute_tbs) {
91
            print("Executing for $tb_name\n");
92
            system("$testbenches{$tb_name} $ghdl_options");
93
        }
94
    } else {
95
        print("Build failed\n");
96
    }
97
}

powered by: WebSVN 2.1.0

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