Mappers / DynamicMapper
Code File Location: VisualSim/actor/lib/Task_Software
o This block enables the mapping of behavior, task or function on a target processor, SystemResource or SystemResource_Extend.
This block accepts a data structure on the input and sends this along with the information in block parameters to the target resource (processor or SystemResource). When the resource completes the processing, the data structure is returned to this block, which places it on the output port. The Task_Destination determines the target resource. The Task_Destination, Task_Number, Task_Time and Task_Priority are used for the Scheduler. The Task_Destination, Task_Number, Task_Instruction, Task_Priority are used for the Processor. The Task_Plot_ID is used to plot the activity for this block on the plot output port.
The Destination, Instruction, Time and Priority can be accessed from the Database or the field content. If the Database Name is the Linking_Name of a block, then a database is available. The database row to use is matched with the Task_Name from this block. The Database block must have a column called Task_Name.
If the Database field has a name, this is the database to use. If the value is "None" or default, then no database is available. The task_instruction, task_time, task_priority and task_destination fields can have either a value (integer, double or array), field name or a database column name.
The Task_Time field can use the RegEx language for a calculation within the field. This calculation can contain any column of the matched row in the database, memory, parameters and all the functions of the RegEx.
There is a Database_Expression field that enables a standard RegEx function to be defined using the content of the entire Database, if named, variable, parameters and field names. The result of this expression can be used in any of the DynamicMapper fields by entering Database for the field value.
Refer Co_Processor and Auto_sh Demo Model.
The Task_Destination can have a string name or a Database field. Alternately, the function getNextDestination("Database_Name","Column_Name") can be specified in the Database_Expression and this field can call Database. This operates as a first order Real-Time Dispatcher. This will select the currently free resource as the destination from all the names in that column. If no resource is currently free, the function will return none. Hence the Database_Expression must do a test to provide a default resource, if all resources are busy.
The function would look like this:
((getNextDestination("Database_name,"Destination_Column"))=="none")?"Default_Resource within double
quotes":(getNextDestination("Database_name,"Destination_Column")))
Parameter | Explanation | Type | Example |
Block_Name | The Block_Name is used internally to identify this block as a return point for a completed task. This is used at the SystemResource and Processor to return the Data Structure to the output port of this block. | String | "FFT_Mapping" |
Database_Lookup | The
Database_Lookup field is used to list the name of the Database block
that contain the following information; Task_Name (this is field to be
matched in the database lookup), Task_Number (optional ID assignment),
Destination (required Processor or SystemResource or SystemResource_Extend name),
Min_Address (optional minimum address associated with task),
Max_Address (optional maximum address associated with task),
Task_Instruction {Array containing the list of instructions associated
with the Task} and Task_Priority (integer). |
String (String, or none) | "Processor_Mapping" |
Task_Name | This is a unique name to identify the Task. | String or Field name | "FFT" |
Task_Destination | Task_Destination is used to identify the SystemResource, SystemResource_Extend or Processor. The incoming Data Structure is sent to the matched destination along with the Task name, ID, time or instruction and priority. If the Task_Destination does not match a SystemResource, then an exception will be generated. This can be a string, reference to a field or a parameter or a database column name. In addition, it can also reference the Database_Expression. The database column is referenced by the column heading. | String | "ARM926" |
Task_Instruction | It
is
an array containing a list of instructions. This can be an array,
reference to a field or a parameter or a database column name. The database column is referenced by the column heading. |
Array of strings |
{"ADD","MOV"} |
Task_Number | Task_Number is used for plotting states in SystemResource or SystemResource_Extend. It is desireable to keep Task_Number is unique. | Integer or String (field) | 1 |
Task_Plot_ID | Parameter to Plot overall task operation. | Integer | 1 |
Task_Priority | Task_Priority is used to set the priority of the Task. The priority is passed to SystemResource, SystemResource_Extend and Processor. This effect scheduling of tasks. The possible values here are integer, field name string or database column name string. The database column is referenced by the column heading. | Integer or String (field) | A_Priority |
Task_Time | Task_Time is used to pass the time (cycles or events) to the SystemResources. The Task_Time field can use the RegEx language for doing calculations in this field. This can combine the values of the matched database row, parameters, incoming data structure fields and the full extent of the RegEx language. The database column is referenced by the database.column_name. | Double, or String (field) | (A_Priority>1)?1.0:DELTA |
Port | Explanation |
input | The input port. |
output | The output port. |
plot | The plot port. |