Channel_Priority

Parent Previous Next

Full Library / Resource / Channel and Pipeline / Channel_Priority
Block Name: Channel_Priority

Code File Location: VisualSim/actor/lib/Channel_Priority

Block Overview

  o Used to model any system that requires additional processing before the resource can be released

  o  Extends the ability of the TimedQueue  

  o  Consists of a single priority-based preemptive Queue and multiple channels 

  o  Application examples include virtual channels, DMA, wireless, buses, and multiple execution step software tasks

  o  Can identify errors and lost packets and force retransmissions

Description

The channel block can be used to model a DMA channel, wireless channel or a bus. The channel block contains a single priority-based queue and multiple channels. The channels are released for the next Data Structure in the Channel_Release block. The block accepts data structures on the input port and places them in a single priority-based queue. This block orders the incoming data structures in the order from highest to the lowest priority.  When a channel becomes available, it takes the data structure in the head of the Queue and sends it out on that channel.  The data structure can go through additional processing and delays using standard VisualSim library.  When all the processing for the channel has been completed, the data structure is sent to the Channel_Release.  This block determines whether the transmission was successful (arrives on accept port) or unsuccessful (Requires retransmission and arrives on the reject port).

When a channel becomes available, it places the first data structure in the queue on the output port and record the channel to be busy. This channel number is written into the Channel_Number field of the selected Data Structure. The channel is blocked by this Data Structure until it is released by the Channel_Release block. If the Data Structure is sent to the accept_input port of the Channel_Release, a successful transmission has been made and the next Data Structure is sent on this channel. If the Data Structure is sent to the reject_output port, then the original data structure is resent on the same channel. The channel block can have multiple channels that work in parallel.

The number of channels are specified as parameters. The data structure on the accept_input port of the Channel_Complete is placed on the output for connection to other blocks. The latency through this channel is a combination of the Queue waiting time + the latency on the channel and the extra processing times. The latency is computed as a multiple of the packet data size and channel speed. The Data Structure is delayed by that many units of time in the channel block before being send on the output port. Additional latency can be added between the Channel_Priority and the Channel_Release.

The Channel_Priority block models multiple requests to a fixed number of channels ('Number_of_Channels').  The Channel_Priority block takes an incoming Data Structure and puts it on one of the channels.  It then places the assigned channel number (Integer) in the Data Structure Field identified by the 'Channel_Number'.  The Data Structure can then be sent through a series of processing blocks to emulate the channel activity. Once the processing has completed, the Channel_Release block is called to remove the packet from the channel.  If the Data Structure is sent to the 'accept_input' port, then the transmission has been successful and the Data Structure continues on it's way.  It is possible to setup retranmission of the packet through the channel by terminating the Data Structure in the channel at 'reject_input' port of the 'Channel_Release' block.  This calls back the Channel_Priority block to initiate a re-transmission of the same packet.  

The Channel_Release and the Channel_Priority blocks are linked using the 'Channel_Name' parameter.  A channel is busy between the time a Data Structure enters, till Channel_Release.   

The Channel_Name must be the same in both the Channel_Priority and the Channel_Complete blocks.  Max_Queue_Length is the maximum number of transaction that can be buffered in the input Queue of the Channel_Priority.  When this number is reached, the next packet is rejected and placed on the reject_output port.

Statistics

The statistics for the Channel_Priority are generated using the getBlockStatus RegEx function or using the Resource_Statistics_Generator block.  The Channel length is received by using the getBlockStatus while the status (Active or Free) by simply looking at the array Channel_Priority_Name + "_" + Length.  The array method is best used when the length is required during the simulation.  getBlockStatus is best used at the end of the simulation for output of the statistics. The function and array lookup can be called in either the Virtual_Machine, Processing or Decision blocks.  

          Result_B = Channel_Priority_Length(2) where the array index starts at 1 for Channel number 1.  This returns whether the Channel is busy or not.

Statistics_A = getBlockStatus(Channel_Priority_Name,"stats",Channel_Number)  -> To get the statistics.  This returns a single Data Structure for the Queue.  The Channel_Number field is ignored.

Reset_Stats_A = getBlockStatus(Channel_Priority_Name,"stats",-(Channel_Number))   -> To reset the statistics.  This resets the single Data Structure for the Channel.  The Channel_Number field is ignored.

There is a pre-created "Generator" block and is used in the Resource_Statistics Example in the BDE.

Copy_A = getBlockStatus(Channel_Priority_Name,"copy",Channel_Number, position)  -> To get the copy of the current Data Structure at any position of the Queue.  This does not include the items that are currently in the Channels.  In this case, it can take any item out of the Queue.

Length_A = getBlockStatus(Channel_Priority_Name,"length",Channel_Number)  -> To get the length of the Queue.  The Channel_Number is ignored.

Remove_A = getBlockStatus(Channel_Priority_Name,"take",Channel_Number, position)  -> To remove a transaction in any position of the Queue.  This does not include the items that are currently in the Channels.  In this case, it can take any item out of the Queue.

isAvailable =  getBlockStatus(Channel_Priority_Name,"array",Any Integer)- Returns an array of which Channel is free (true) or busy (false)

Use Model: One might model a multi communication channel, or DMA channel to memory with this block. The Channel blocks can add the effect of delay, contention and limited resources to a processor or networking model through N channels (Number_of_Channels).  The 'Channel_Release' Block can model re-tranmissions through it's two inputs: 'accept_input' for no re-transmission and 'reject_input' to calls back this block to retransmit a packet that is rejected due to noise (communication channel) or ECC bit error (memory).

Data Structure of the Statistics

{BLOCK                 = "Channel_Stop_n_Wait_Test.Channel_Priority",
DELTA                  = 0.0,
DS_NAME                = "Queue_Common_Stats",
ID                     = 2,
INDEX                  = 0,
Number_Entered         = 94,
Number_Exited          = 94,
Number_Rejected        = 0,
Occupancy_Max          = 1.0,
Occupancy_Mean         = 0.5,
Occupancy_Min          = 0.0,
Occupancy_StDev        = 0.5,
Queue_Number           = 1, 
TIME                   = 199.0000000081,
Total_Delay_Max        = 199.0000000081,
Total_Delay_Mean       = 99.3936170309085,
Total_Delay_Min        = 2.0000000081,
Total_Delay_StDev      = 58.5856743223995
Utilization            = 0.0 }


Discussion of the Statistics                  
                           
Number_Entered:    Number entering channel priority block
Number_Exited:     Number exiting channel priority block

Number_Rejected:   Number exiting channel priority block
Occupancy_Max:     Maximum statistics of the buffer occupancy
Occupancy_Mean:    Mean statistics of the buffer occupancy

Occupancy_Min:     Min statistics of the buffer occupancy
Occupancy_StDev:   Standard Deviation statistics of the buffer occupancy

Queue_Number:      Not used
Total_Delay_Max:   Maximum wait time through this channel
Total_Delay_Mean:  Mean wait time through this channel
Total_Delay_Min:   Minimum wait time through this channel

Total_Delay_StDev: Standard Deviation Maximum wait time through this channel
Utilization: Not used

Field Detail


Channel_Name

public Parameter Channel_Name


Number_of_Channels

public Parameter Number_of_Channels


Packet_Priority

public Parameter Packet_Priority


Max_Queue_Length

public Parameter Max_Queue_Length



Created with the Personal Edition of HelpNDoc: Produce Kindle eBooks easily