Skip to content

Commit

Permalink
run_sanity: add sanity run and log check in run_sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Zhang authored and jwise committed Nov 1, 2017
1 parent 3ca7a8e commit 0dcdbd9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
1 change: 0 additions & 1 deletion spec/defs/projects.spec
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@

#if defined(CBUF_BANK_DEPTH_512)
%define NVDLA_CBUF_BANK_DEPTH 512
#elif
#else
#error "only NVDLA_CBUF_BANK_DEPTH_512 can be set"
#endif
Expand Down
43 changes: 42 additions & 1 deletion tools/bin/run_sanity
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
#!/usr/bin/env perl

exit 0;
use strict;
use Getopt::Long;
use Data::Dumper;
use YAML qw(LoadFile);
use IO::Tee;
use Carp qw(croak);

my $run = 1;
my $debug = 1;

my $tot = `tools/bin/depth -abs_tot`;

my $tree_make_vm = "$tot/tools/make/tree.make.vm";
croak "$tree_make_vm does not exists" unless -e $tree_make_vm;

system ("chmod +w $tot/tree.make") if $run;
system ("cp $tree_make_vm $tot/tree.make") if $run;
system ("$tot/tools/bin/tmake -project nv_large") if $run;

my $log = "$tot/outdir/build.log";
open(L, "<${log}") or die("ERROR: Can't read log file $log\n");

my $fail = 0;
while (my $line = <L>) {
chomp $line;
next unless $line =~ m/^checktest/;
print "line=$line\n" if $debug;
$line =~ s/\s//g;
my (undef,$result,$testname,$desc) = split(':',$line);
print "result=$result\n" if $debug;
$fail ||= ($result ne "PASSED") ? 1 : 0;
print "fail=$fail\n" if $debug;
}
close(L);

if ($fail) {
print "ERROR: simulation failed -> $log\n";
}

print "final=$fail\n" if $debug;

exit ($fail);
23 changes: 23 additions & 0 deletions tools/make/tree.make.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## ================================================================
## NVDLA Open Source Project
##
## Copyright(c) 2016 - 2017 NVIDIA Corporation. Licensed under the
## NVDLA Open Hardware License; Check "LICENSE" which comes with
## this distribution for more information.
## ================================================================
##
## set the chip you want to build
PROJECTS := nv_large nv_small

#=================
# ENV TOOL setup
#=================
# c pre-processor
CPP := /usr/bin/cpp

# used in ordt to generate reigster, need be newer than 1.7
JAVA := /usr/bin/java

# used in ordt to generate reigster, need be newer than 1.7
PERL := /usr/bin/perl

0 comments on commit 0dcdbd9

Please sign in to comment.