#!/usr/bin/perl -w
-# Copyright (c) 2003 University of Utah and the Flux Group.
+# Copyright (c) 2003-2009 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify, distribute, and sell this software
# Author: John Regehr (regehr@cs.utah.edu)
# Revised by: Xuejun Yang on 01/10/2009
+# For more information:
+# http://docs.tinyos.net/index.php/Stack_Analysis
+
use strict;
use warnings;
use Getopt::Long;
# TODO:
-# tighten results by keeping track of atomic sections
-# support overriding the default heuristic for detecting atomic vectors
-# get rid of hard-coded non-terminating functions, just derive this
-# when no "ret" is executed
-# test for tightness / soundness using randprog
-# read config info from a file
-# chip parameters
-# libc information
-# recursion and interrupt info
-# support TOSThreads
-# support msp430
-# enumerate soundness requirements
-# stores to SP are direct and use "out"
-# no indirect stores to registers
-# no reentrant interrupts
-# outs to 0x3f are ending atomic blocks, seis are enabling interrupts for real
-# return instructions go back to their callers' successors
+#
+# support TOSThreads
+#
+# support msp430
+#
+# optionally don't do recursion checking
+#
+# print path to WC stack depth, perhaps graphically
+#
+# make it possible to specify chips individually
+#
+# make it possible to explicitly specify which interrupts are atomic
+# or not
+#
+# tighten results by keeping track of depths inside and out of
+# atomic sections
+#
+# print stack used at thread blocking points
+#
+# support overriding the default heuristic for detecting atomic
+# interrupts
+#
+# get rid of hard-coded non-terminating functions, just derive this
+# when no "ret" is executed
+#
+# test for tightness / soundness using randprog + Avrora
+#
+# read config info from a file
+# chip parameters
+# libc information
+# recursion and interrupt info
##########################################################################
# also look below for __prologue_saves__ and __epilogue_restores__
my %SPECIAL = (
+ "TinyThreadSchedulerP__switchThreads" => 10,
+
# these have icalls
#"__eewr_block" => 35,
#"__eerd_block" => 35,
}
if ($insn eq "ijmp") {
- $diehere{$addr} = "cannot process raw ijmp at $hex_addr";
+ $diehere{$addr} = "cannot process raw indirect jump at $hex_addr";
} elsif ($insn eq "ret" || $insn eq "reti") {
# no control flow from here in our model
} elsif (is_branch ($addr) || is_skip ($addr) || is_jmp ($addr)) {
$target = $label_to_addr{$target_func};
die "tos-ramsize FAIL" if (!defined($target));
} else {
- $diehere{$addr} = "cannot process raw icall at $hex_addr";
+ $diehere{$addr} = "cannot process raw indirect call at $hex_addr";
}
}
if (defined($target)) {