TimedQueue

Parent Previous Next

Full Library / Resource / Timed-Queue / TimedQueue
Block Name: TimedQueue

Code File Location: VisualSim/actor/lib/Resource_FCFS

Note:  If you have purchased the Smart_Resource package, use the Smart_Timed_Resource block and not this one.

Block Overview

  o  TimedQueue is used in place of a Queue when the processing duration can be calculated before the transaction enters the block.  

  o  It can define hardware or software resources as a queuing entity with a variable but pre-calculated timed delay. 

  o   Example of applications includes Processor, Bus transactions or Memory requests.

  o    It can be used to order transactions/data structure that have variable delays.

Timed_Queue

Description

The following is a block diagram that illustrates the operation of the TimedQueue block.

Timed_Queue

This TimedQueue (First-Come, First-Server) block contains one set of Queue + Server Resource. Each incoming Data Structure is first placed in the Queue. The Queue is ordered in the order of arrival of the data structure. The Server Resource is a timed resource that delays the incoming data structure before placing it on the output port.

When the Server Resource is free, the token or Data Structure at the head of the queue is sent to the server resource. The server resource holds the token for the time_input period and then places it on the output port. If the queue is full, then the incoming Data Structure or token is sent to the reject_output port. Both the input and time_input must arrive for the transaction to be placed in the queue.

To compute the throughput through this block, multiply the utilization by the Speed used to compute the Server Resource delay.

To illustrate the usage, look at the following Examples in the BDE.


Statistic Name

Value

Explanation

Mathematical Equation

Type

Number_Entered   

100

Number of transactions entering the queue.

-

int

Number_Exited 

25

Number of transactions that left the queue.

-

int

Number_Rejected

10

Number of transactions rejected and output to reject port.

-

int

Queue_Number

1

Queue Number. Queue number start at 1.

-

int

Occupancy_Min

4.0

Minimum queue size during the simulation.

// Obtain Min for X, where X0 = Double.MAX_VALUE

if (Xn < Xn – 1) Xmin = Xn

double

Occupancy_Min

8.0

Mean/Average queue size during the simulation.

// Obtain Min for X, where X0 = Double.MAX_VALUE

if (Xn < Xn – 1) Xmin = Xn

double

Occupancy_StDev 

3.0

Standard Deviation from the Mean queue size during the simulation.

// Obtain Standard Deviation for X

Xσ = Math.sqrt ((1 / n) * ((X1 - Xµ)2 + (X2 - Xµ)2  + … + (Xn - Xµ)2))

STDEV_90_PCT = 1.6448530004790

STDEV_95_PCT = 1.9599610823207

STDEV_99_PCT = 2.5758345145732

double

Occupancy_Max

25.0

Maximum queue size consumed during the simulation.

// Obtain Max for X, where X0 = Double.MIN_VALUE      

    if (Xn > Xn – 1) Xmax = Xn

double

Total_Delay_Min

1.3

In seconds. Least time through the queue among all transactions.

// Obtain Min for X, where X0 = Double.MAX_VALUE

if (Xn < Xn – 1) Xmin = Xn

double

Total_Delay_Mean

1.3

In seconds. Mean/Average time through the queue among all transactions.

// Obtain Mean for X

Xµ  = (1 / n) * (X1 + X2 + … + Xn)

double

Total_Delay_StDev

1.3

In seconds. Standard Deviation from the Mean time through the queue among all transactions.

// Obtain Standard Deviation for X

Xσ = Math.sqrt ((1 / n) * ((X1 - Xµ)2 + (X2 - Xµ)2  + … + (Xn - Xµ)2))

STDEV_90_PCT = 1.6448530004790

STDEV_95_PCT = 1.9599610823207

STDEV_99_PCT = 2.5758345145732

double

Total_Delay_Max

1.3

In seconds. Maximum time through the queue among all transactions.

// Obtain Max for X, where X0 = Double.MIN_VALUE      

    if (Xn > Xn – 1) Xmax = Xn

double

Utilization_Pct_Mean 

0.0

Mean/Average utilization of the server portion only.  Queue utilization not considered. Units are in Percentage.

// Obtain Mean for X

Xµ  = (1 / n) * (X1 + X2 + … + Xn)

double


Where n is the number of samples and X is occupancy or delay.



Parameter

Explanation

Type

Example

Max_FCFS_Length

This is the maximum number of tokens or data structures that can be in the queue at any instance of time. All items above this limit will be send to the reject_output port.

String

30 (Default)

FCFS_Type

This is the ordering of the tokens in the queue, either First-In, First-Out or Last-In, Last-Out.

String

"FIFO," or "LIFO." The default is "FIFO."



Port

Explanation

FCFS_input

This is the input to the block for data tokens or transactions. In order for the data token or data structure to enter the queue properly, the 'FCFS_input' and 'time_input' must be entered at the same time.  

time_input

This is used for setting the time delay of the incoming data tokens or transactions. In order for the data token or data structure to enter the queue properly, the 'FCFS_input' and 'time_input' must be entered at the same time.  

stats_input

This triggers the statistics output on stats_output.  The statistics can be cleared by (-1), or generated by (1).

FCFS_output

Data Structure that have completed the Server Resource processing are sent out through this port.

FCFS_length_output

Output port sending the length of the FCFS Queue. This is generated everytime a Data Structure arrives at the input port or departs on the output port.

FCFS_reject_output

When the queue is full, the next arriving data structures is placed on this output port and is not queued.

stats_output

Output port sending Queue statistics when a trigger arrives on the stats_input port. 




 

Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites