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

Subversion Repositories t400

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

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

powered by: WebSVN 2.1.0

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