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

Subversion Repositories t400

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

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

powered by: WebSVN 2.1.0

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