about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStephen Malina <stephenmalina@gmail.com>2016-07-17 16:50:17 -0700
committerStephen Malina <stephenmalina@gmail.com>2016-07-17 17:32:10 -0700
commitbd3d6c9e8314bc31cb294ba321b9513842eef120 (patch)
treedbd2f1d1ec40455ee85f9759530e57b4cef3caef
parent8ee533693acdea45ff9baae3ca0c5b3e0c43de7a (diff)
downloadmu-bd3d6c9e8314bc31cb294ba321b9513842eef120.tar.gz
3112
Fix routine instruction count assignment to handle multi-slice scheduled
routines in the sandbox.
-rw-r--r--071scheduler.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/071scheduler.cc b/071scheduler.cc
index c9e81030..b675883c 100644
--- a/071scheduler.cc
+++ b/071scheduler.cc
@@ -537,7 +537,7 @@ int ninstrs;
 :(before "End routine Constructor")
 ninstrs = 0;
 :(after "stop_running_current_routine:")
-Current_routine->ninstrs = ninstrs;
+Current_routine->ninstrs = Current_routine->ninstrs + ninstrs;
 :(before "End Primitive Recipe Declarations")
 NUMBER_OF_INSTRUCTIONS,
 :(before "End Primitive Recipe Numbers")
@@ -590,6 +590,7 @@ def f2 [
 +mem: storing 0 in location 3
 
 :(scenario number_of_instructions)
+% Scheduling_interval = 1;
 def f1 [
   10:number/child-id <- start-running f2
   {
@@ -598,10 +599,13 @@ def f1 [
   11:number <- number-of-instructions 10:number
 ]
 def f2 [
-  # 2 instructions worth of work
-  11:number <- copy 34
+  # 4 instructions worth of work
+  # Should take 2 scheduling intervals
+  1:number <- copy 34
+  2:number <- copy 1
+  2:number <- copy 3
   20:number <- copy 1
 ]
 # f2 runs an extra instruction for the implicit return added by the
 # fill_in_reply_ingredients transform
-+mem: storing 3 in location 11
++mem: storing 5 in location 11