Download presentation
Presentation is loading. Please wait.
1
Turing Machine based Script Language Turing Machine Background 1936-7 Paper “On computable numbers with an application to the Entscheidungsproblem” –Theory of Turing Machines –Definition of Computability –Turing Test Theoretical Computing Machine –“Tape” – back and forth –“State”, “Color”, “Direction” –Wolfram 2002, pp. 78-81, p.888 “Computing Machinery and Intelligence” Alan Turing, 1950 VisualSim Architect Script Language Overview Small Instruction Set Just-In-Time Compiler 10 RISC like Instructions vs. 3 in Turing Machine Execute at Model Level Concept of Global, Local, and Block Memory Ability to Declare Modeling Elements Virtual Execution within Modeling Environment Powerful, yet Fast Execution Several Million Instructions per Second Modeling Uses Ease in defining behavioral algorithms and text- based flow diagrams Ease in defining architectural (processing) execution Concurrent Threads easier than C++ Threads
2
Custom DE Domain Block - uEngine Other Script Languages or C/C++ lack Block Level integration, or similar abstraction with the Modeling Environment.
3
Script Language – Ten Instructions Mnemonic Description DEF Define or declare a memory LBL Label used by other instructions END Stops current thread, removes from Thread Queue ACT Action instruction, with expressions and modifiers for input, output, wait, scheduling JIT Jump if True, if expression is true, then jump based on LBL, +/- integer (relative), or absolute JIF Jump if False, if expression is false, then jump based on LBL, +/- integer (relative), or absolute WHL While (true), execute next set of instructions till RTN command reached, else jump LBL, +/- integer (relative) SBR Execute Subroutine, jump based on LBL, +/- integer (relative) RTN Return from SBR or WHL statement, 32 levels supported GTO GOTO specific address, based on LBL, +/- integer (relative), also generate model threads
4
M/G/2 Queueing Model
5
M/G/2 Queueing Model Script INSTR OP_X OP OP_Y OP OP_Z ----- -------------- ----- ------ ----- ------------- ; DEF Cust_1 block Generic_Class ; DEF Cust_2 block Generic_Class ; DEF Serv_1 block 0.0 ; DEF Serv_2 block 0.0 ; DEF Queue_Len block 0.0 ; DEF Queue_Stats block stats ; DEF Queue_Stats_DS block Basic_Stats ; ACT Trace = true ; GTO Thread_2 thread Teller_2 ; LBL Teller_1 ; ACT input wait ; ACT Cust_1 = Input_Queue ; JIF Dist_Type_Param == "exp" +3 ; ACT Serv_1 = exp(MTBC) ; GTO Send_Cust_1_Out ; JIF Dist_Type_Param == "norm" +3 ; ACT Serv_1 = norm(MTBC, 15.0) ; GTO Send_Cust_1_Out ; JIF Dist_Type_Param == "rand" +3 ; ACT Serv_1 = rand(MinSvcTime, MaxSvcTime) ; GTO Send_Cust_1_Out ; LBL Send_Cust_1_Out ; ACT Serv_1 wait ; ACT Time_in_Queue send TNow - Cust_1.TIME ; ACT output send Cust_1 ; SBR Queue_Statistics ; GTO Teller_1 ; LBL Teller_2 ; ACT input wait ; ACT Cust_2 = Input_Queue ; JIF Dist_Type_Param == "exp" +3 ; ACT Serv_2 = exp(MTBC) ; GTO Send_Cust_2_Out ; JIF Dist_Type_Param == "norm" +3 ; ACT Serv_2 = norm(MTBC, 15.0) ; GTO Send_Cust_2_Out ; JIF Dist_Type_Param == "rand" +3 ; ACT Serv_2 = rand(MinSvcTime, MaxSvcTime) ; GTO Send_Cust_2_Out ; LBL Send_Cust_2_Out ; ACT Serv_2 wait ; ACT Time_in_Queue send TNow - Cust_2.TIME ; ACT output send Cust_2 ; SBR Queue_Statistics ; GTO Teller_2 ; LBL Queue_Statistics ; ACT Queue_Len = Input_Queue_Length ; ACT Queue_Stats = Queue_Len ; ACT Queue_Stats_DS.Number_Values = Queue_Stats.length ; ACT Num_in_Queue send Queue_Len ; ACT Queue_Stats_DS.Min_Value = Queue_Stats.min ; ACT Queue_Stats_DS.Mean_Value = Queue_Stats.mean ; ACT Queue_Stats_DS.StDev_Value = Queue_Stats.stdev ; ACT Queue_Stats_DS.Max_Value = Queue_Stats.max ; ACT Stats_in_Queue send Queue_Stats_DS ; RTN ; Script FileScript File (cont.)
6
M/G/2 Queueing Model Output ExponentialUniform RandomGaussian
7
Summary of Turing Machine based Script Language Script Language Summary JIT Compiler: Text-Window, File, or EXCEL Input, Fast Execution DEF instructions for declaring Memories, Arrays, Queues, Statistics ACT commands for Input, Output, Wait, Schedule instructions ACT, JIT, JIF, WHL command integration with Ptolemy expression language SBR command supports Thread Level Semaphore or Mutex for multiple threads Script Language Assertions: Ability to set High, Low values Script Language Exceptions, Command Line Interface uEngine: Support for multiple Input, Output or Virtual ports uEngine: 1024 uCode Lines per Block, 32 Threads, 32 Subroutine Levels uEngine Debugging : uCode enabled Trace Mode, Single Step mode with breakpoint on postfire() method. www.mirabilisdesign.comwww.mirabilisdesign.com www.mirabilisdesign.com www.mirabilisdesign.comwww.mirabilisdesign.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.