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

Subversion Repositories t400

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

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

powered by: WebSVN 2.1.0

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