Script

Provides a powerful programming environment for rapid model prototyping for performance, arbitration, behavior and power model construction

  • Implements the VisualSim Script language.  
  • Combines standard programming constructs with RegEx functions
  • Define resources, cycle-accurate hardware components and algorithmic behaviors. 
  • Statements include for, if, else-if, else, while, and SWITCH/CASE/BREAK.
  • Perform decode, loops, blocking waits, non-blocking waits, execution based on input transactions, and using variables
  • Define additional Input or Output ports for connectivity to other blocks.  Thee block can also be called by/call to a virtual connection in the model.
  • Event and time-based queues can be declared inside the Script blocks.
  • Events can be cancelled for TIMEQ, WAIT, using CANCEL keyword, see details below.

Protocol

  • C-like programming environment with built-in compiler. There is no need to recompile when moving from one OS to another.

Script Block

This block is used to write scripts and a set of blocks that use a C-like programming format to describe the logic or behaviors. The three supporting blocks are Smart_Controller, Script block, and Virtual_Machine_Untimed. The block can be used anywhere that detailed programming would be more suitable than using multiple blocks. This block can contain all the RegEx functions and contains standard C functions such as if, else-if, else, while, and SWITCH/CASE. RegEx algorithms can be created to perform decoding, loops, blocking waits, non-blocking waits, or execution based on input transactions, or model level variable. Input or Output ports can be added for additional functionality or virtual transactions can be sent, without ports or wires, into or out of the Script block. Event or time-based queues can be declared inside the Script. The Script block accepts data structures on the input ports, processes a sequence of C-like code, and outputs a data structure. The data structure can arrive at the ports or via virtual connections to the block. All the data structures are placed in a single non-priority input queue in the order of arrival. The data structures are executed in the order of arrival. The executions are requests using SEND to LABEL within the block and events being sent to this block. In the code, the currently executing data structure is named “port_token”. The arriving data structure can be associated with an arriving port, SystemResource (return from SystemResource) or “virtual” (virtual connection, and “event” (user event). The sequence of code can utilize the incoming data structures field, variable (local, global and variable-defined inside this block), RegEx language and parameter values. Using the RegEx functions, this block can send the Data Structures to Virtual Connection, SystemResources and other Script blocks.