Part 1 - Foundation Example

Parent Previous Next

Tutorial Goals

This tutorial teaches you to use the basic concepts of system modeling including traffic, behavior, queues, delays and analysis.  This Tutorial also covers the use of the Block Diagram Editor (BDE), construct models out of the blocks contained in the VisualSim libraries, run dynamic simulations, combine different outputs, and interpret the simulation results.


The following summarizes the concepts and tasks that you learn in this session.

Block Diagram Overview

We use the model to study the performance of a system that has a priority-based FIFO/Queue. The block diagram is shown in Figure 1.

A traffic generator sends data packets or transactions or data structure to the FIFO. The FIFO outputs the next transaction after the previous transaction is processed.


Foundation Example Block Diagram

Figure 1: Foundation Example Block Diagram


The implementation of Figure 1 in VisualSim is shown in Figure 2.


Foundation Example VisualSim Model

Figure 2: Foundation Example VisualSim Model

VisualSim Tutorial Model Location

The following location contains the completed model to be built at the end of this tutorial.

VisualSim Library Blocks

The following table provides details of the VisualSim library blocks.


S.No.
Library Block
Description
1
Digital Simulator

Digital Block


The Digital Simulator implements the discrete-event Model of Computation (MoC). The simulator maintains a notion of current time, and processes events chronologically in this time. Used to model elements that change with time such as hardware, software and networks.




2
Traffic

Traffic block
Outputs a new Data Structure (DS) at time intervals specified by the "Time_Distribution" setting.
A Data Structure is also knowns as a transaction and contains a list of Field Names + Values.


3
ExpressionList

ExpressionList Block
Executes a sequence of expressions in order.

The default block contains one input and one output. The user can add multiple input and output ports. The graphic shown here is customized to have two output ports.


4
Queue

Queue Block

Defines multiple independent parallel queues. Each queue orders the incoming data structures from highest to the lowest priority.



5
Const

Const Block

Generates a constant value on the output port every time there is a trigger on the input port.


6
Text_Display

Text Display Block

Displays the values arriving on the input port in a text display dialog.


7
TimeDataPlotter

TimeDataPlotter Block

Plots the incoming data on the Y-Axis against the current simulation time on the X-axis. Every wire connected to this block input is considered a separate dataset and plotted separately.



   Note: Listen-to-Port feature can be selected by right clicking on any of the input/output port that you want to debug. After selecting the Listen-to-Port feature, a blank white window will pop up. Run the model to see the values at the port. For Listen to Block  feature, Right-Click on the block to debug and select "Kisten to Block". Listen to Block feature cannot be used for debugging heirarchical blocks as those blocks are used to hold many different blocks.

Construction Steps

The construction of the model shown in Figure 2 is described below.

Foundation Example Transaction Source
Figure 3: Transaction Source

Foundation Example ExpressionList
Figure 4: ExpressionList

Note that the purpose of using expression input.Priority = irand(1,5) is to assign a random value between 1 and 5 to the Data Structure field Priority. "input" identifies the data structure and is the name of the block port through which the data structure enters. If the block has multiple input ports, then the user must use the name of the respective port to identify the data structure that will be used in the Expression List block. Two new fields called Priority and Execution_Length are added to the Data Structure called input.

The Parameter Output_Ports is a list of all the output ports. The block can have multiple output ports.The Parameters Output_Values and Output_Conditions must match the same number of items as Output_Ports. The corresponding value is sent out on the respective output port.

The parameter Output_Conditions defines whether the data in Output_Values must be sent out on the port listed in Output_Ports. The Condition can be true or false, which is evaluated from an Expression.

Foundation Example Queue
Figure 5: Queue

Foundation Example Delay
Figure 6: Delay

Foundation Example ExpressionList2
Figure 7: Foundation Example ExpressionList2


Note that the expression TNow - input.TIME returns the end-to-end latency in the system. TNow is the current simulation time stamp and input.TIME is the time at which the transaction was generated by the Traffic block. When a Traffic block generates a data structure, it places the current time in the TIME field. The Expression_List parameter does not contain any expressions. The Output_Values can be an expression containing equations, transaction if-else, parameters and variables.


Results

Plot of the transaction latency vs. simulation time

Foundation Example Latency Report
Figure 8: Plot of the Transaction Latency vs. Simulation Time

Foundation Example Transaction Flow
Figure 9: Transaction after the flow has completed

A few things to note.

FAQ


You have just created the first model in VisualSim!!!
Review this model and proceed to Part 2.
Now, we can move to Part 2 of this Lab.