TaskGenerator

Parent Previous Next

Processor Generator / TaskGenerator
Block NameTaskGenerator

Code File Location: VisualSim\actor\arch\SoftGen

Block Overview

o       It generates instruction sequence to represent one or multiple tasks. This is used to emulate the operation of a software task on the processor.

o       This block can be used in the model and can dynamically generate the sequences.

SoftGen

Description

TaskGenerator is located in Processor Generator. Examples of usage are located in Pre-Built Models->Using Hardware Architecture Blocks.

The TaskGenerator block is used to generate tasks containing a profile- based sequence of instructions to execute on the processor. The mix of instructions in the task is read from the file that is referenced by the parameter Read_My_Instruction_Mix_Table.

The instructions are placed in the A_Instruction field of the Processor_DS template Data Structure and sent on the output port.

The generated instruction assumes that each instruction takes exactly one cycle to execute for the purpose of generating the tasks. The actual execution will depend on the Instruction_Mix_Table.

The Read_My_Instruction_Mix_Table file has two parts. The first Part defines a type, abbreviation used in the lower part and a list of instruction mnemonics for each type. There is a line delimiter ';' at the end of every line.  Each section must start with a comment.  The first part must have a comment that ends wit- /* Mnemonic List */ and the second part must end with- /* Task_Name */.  An example of this file is shown below.  

/* My Instruction Mix Table -- First Part defines instruction mnemonics for each type, line delimiter ';'
   these instructions will be randomly selected based on the Percentage (Pct) in second half of table
 
Desription         Type (used below)        Mnemonic List   */

Integer            INT                      MV_MOV MV_MVN MV_MRS MV_MSR ;

ARITHMETIC        FP                       ART_ADD ART_ADC ART_SBC ART_MLAS ;

/* -- Second Part defines individual tasks, and the mix within each task, starts with the task name,
      and either relative time (convert to number of instructions) or number of Instructions that
      will be used by the percent entries line delimiter ';'  The number of types just needs to match
      the list above and there is a column for each type, plus the Pct cannot exceed 100%.....

      Note:        The Number_Instructions assumes one instruction per cycle of the Processor,
                   which may be optimisitic for multi-cycle instructions.

                   Relative_Time(double)_or
A_Task_Name        Number_Instructions(int) Type Pct   Type Pct   Type Pct   Type Pct   Type Pct   */

My_Task_1          500                      INT  10    FP   48    LOG  10    IO   7     BRCH   25  ;                   

My_Task_2          700                      INT  15    FP   25    LOG  60    IO   0     BRCH   0   ;

My_Task_3          100                      INT  40    FP   38    LOG  10    IO   7     BRCH    5  ;

To view a more extensive file, go to VS_AR\doc\Training_Material\Architecture\Software_Generation directory and select- Instruction_Mix_Table.txt.

The second Part of the file defines individual tasks, and the mix within each task. Each line starts with the task name and is followed by the number of instructions. This generator assumes that each task has an execution time of 1 cycle. This will be followed by the Type Name and Percentage for each of the types in Part One. Each task line must end with the line delimiter ';' The number of types must match the number of items in Part One. The total percentages of all types cannot exceed 100%.

There are three modes of operation. This determines which tasks are generated.

The three options are- Field, Random and Loop.

Field: The task name can be looked up in the A_Task_Name field of the incoming Data Structure (Field). This will be appended to the A_Instruction field of the incoming data structure and sends on the output port.

Random: This picks one of the tasks based on a random number. It also creates a new data structure and sends on the output port.

Loop: This generates the tasks in the order listed in the instruction_mix_table. In the option 2 and 3, the TIME and ID field are updated. 

Refer Using TaskGenerator to generate profile-based synthetic instructions for the Processor Demo Model.


Parameter

Explanation

Type

Example

Block_Name

Unique name for this block. This must be different from all Global memories, SystemResource, Scripts, Queues and Hardware blocks.

String

“ARM9_Instructions_Generator”

My_Path

This is the path to the input file.

String

“C:/VisualSim/VS_AR”

Read_My_Instruction_Mix_Table

Input file name containing the instruction mix and the task information.

Concatenation of Strings

My_Path + “/Files1.txt”

Mode_of_Operation

Field gets task name from A_Task_Name of input Data Structure, Random selects a random Task from the list and Loop is sequential ordering of the task as listed in the mix table.

String

“Loop”, “Field” or “Random”

DEBUG

"true" to view the generated sequence on the Command Window and "false" if no DEBUG data required.

Boolean

True or False

Sim_Time

Link this to the Simulation Time of the model.

Double

parameters (SimTime) or value 2.0e-6



 

Parameter

Explanation

port

This input port receives a data structure that triggers the block to generate a sequence of instructions in an array.

port2

This output port takes the incoming data structure, adds the instruction array into a field called A_Instruction and send it out on this port.

Debug

The status and debug information are output on this port.

 

Created with the Personal Edition of HelpNDoc: News and information about help authoring tools and software