From a0015a2c208ab3e544b41e38ad1b9505d9d2ecc0 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 24 Aug 2001 00:31:50 +0000 Subject: [PATCH] * duh bug fixes 2001-08-23 Frank Ch. Eigler * lib/monkey.exp (monkey_stop): New routine. (monkey_test): Upon failure in test loop, break out, to always call `monkey_stop'. (monkey_test_pin): Don't mistakenly return "eof". --- sid/component/testsuite/ChangeLog | 7 +++++++ sid/component/testsuite/lib/monkey.exp | 18 +++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/sid/component/testsuite/ChangeLog b/sid/component/testsuite/ChangeLog index dbf9d1a303..37f9f1dbed 100644 --- a/sid/component/testsuite/ChangeLog +++ b/sid/component/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2001-08-23 Frank Ch. Eigler + + * lib/monkey.exp (monkey_stop): New routine. + (monkey_test): Upon failure in test loop, break out, to always + call `monkey_stop'. + (monkey_test_pin): Don't mistakenly return "eof". + 2001-08-22 Ben Elliston * config/default.exp (sid_assert): New proc. diff --git a/sid/component/testsuite/lib/monkey.exp b/sid/component/testsuite/lib/monkey.exp index 97132c90c6..e0ffccdd82 100644 --- a/sid/component/testsuite/lib/monkey.exp +++ b/sid/component/testsuite/lib/monkey.exp @@ -92,6 +92,7 @@ proc monkey_test {type sym lib {iterations 30s}} { # (e.g. m => minutes), then run the tests for the specified # duration, rather than as a fixed number of iterations. + set condition "pass" if {[regexp {[smhd]$} $iterations]} { regexp {([0-9]+)[smhd]$} $iterations ignore units set now [clock seconds] @@ -106,15 +107,15 @@ proc monkey_test {type sym lib {iterations 30s}} { note "Testing $type until [clock format $finishtime]" } while {[clock seconds] < $finishtime} { - if {[do_one_test] == 0} then return + if {[do_one_test] == 0} then {set condition "fail"; break} } } else { for {set i 0} {$i < $iterations} {incr i} { - if {[do_one_test] == 0} then return + if {[do_one_test] == 0} then {set condition "fail"; break} } } - sid_stop - pass "$test ($iterations iterations)" + monkey_stop + $condition "$test ($iterations iterations)" catch {unset pins buses attributes} @@ -175,6 +176,11 @@ proc monkey_start {type sym lib} { return 0 } +proc monkey_stop {} { + sid_stop +} + + # Monkey test a pin (decided at runtime). proc monkey_test_pin {} { global pins victim @@ -193,7 +199,9 @@ proc monkey_test_pin {} { # Value-carrying pin. set value [random [expr int(pow(2,16))]] set result [sid_cmd [list sid::pin::driven_h4 $handle $value]] - if [string match "" $result] then { return "eof" } + + # sid::pin::driven_h4 returns nothing! + # if [string match "" $result] then { return "eof" } } # Monkey test a bus (transaction type and width decided at runtime). -- 2.11.0