HeMPS  8.0
Functions | Variables
kernel_master.c File Reference

Kernel master is the system manager kernel. More...

#include "kernel_master.h"
#include "../../modules/utils.h"
#include "../../include/plasma.h"
#include "../../include/services.h"
#include "../../modules/packet.h"
#include "../../modules/new_task.h"
#include "../../modules/cluster_scheduler.h"
#include "../../modules/reclustering.h"
#include "../../modules/applications.h"
#include "../../modules/processors.h"
Include dependency graph for kernel_master.c:

Functions

int get_cluster_ID (int x, int y)
 
int get_master_address (int slave_address)
 
void send_app_terminated (Application *app, unsigned int *terminated_task_list)
 
void send_task_allocation (NewTask *new_t)
 
void send_task_release (Application *app)
 
void send_app_allocation_request (Application *app, unsigned int *task_info)
 
int send_task_migration (int task_ID, int new_proc)
 
void request_application (Application *app)
 
void handle_pending_application ()
 
void handle_app_terminated (int appID, unsigned int app_task_number, unsigned int app_master_addr)
 
void handle_packet ()
 
void initialize_cluster_load ()
 
void initialize_slaves ()
 
void initialize_clusters ()
 
void handle_new_app (int app_ID, volatile unsigned int *ref_address, unsigned int app_descriptor_size)
 
void handle_app_request ()
 
int main ()
 

Variables

unsigned int pending_app_to_map = 0
 Controls the number of pending applications already handled by not completely mapped.
 
unsigned char is_global_master
 Defines if this kernel is at global or local operation mode.
 
unsigned int global_master_address
 Used to stores the global master address, is useful in local operation mode.
 
unsigned int terminated_task_master [MAX_TASKS_APP]
 Auxiliary array that stores the terminated task list.
 
unsigned int total_mpsoc_resources = (MAX_LOCAL_TASKS * MAX_SLAVE_PROCESSORS)
 Controls the number of total slave processors pages available. Is the admission control variable.
 
unsigned int cluster_load [CLUSTER_NUMBER]
 Keep the cluster load, updated at every applications start and finish.
 
unsigned int terminated_app_count = 0
 Used to fires the END OF ALL APPLIATIONS.
 
unsigned int waiting_app_allocation = 0
 Signal that an application is not fully mapped.
 

Detailed Description

Kernel master is the system manager kernel.

HEMPS VERSION - 8.0 - support for RT applications

Distribution: June 2016

Created by: Marcelo Ruaro - contact: marce.nosp@m.lo.r.nosp@m.uaro@.nosp@m.acad.nosp@m..pucr.nosp@m.s.br

Research group: GAPH-PUCRS - contact: ferna.nosp@m.ndo..nosp@m.morae.nosp@m.s@pu.nosp@m.crs.b.nosp@m.r

kernel_master is the core of the OS running into the managers processors (local and global). It assumes two operation modes: global or local. The operation modes is defined by the global variable is_global_master. Local operation mode: runs into local managers. Manage the applications and task mapping. Global operation mode: runs into global manager. Runs all functions of the local operation mode, further the applications admission control. The kernel_master file uses several modules that implement specific functions

Function Documentation

int get_cluster_ID ( int  x,
int  y 
)

Receive a address and return the cluster index of array cluster_info[]

Parameters
xAddress x of the manager processor
yAddress y of the manager processor
Returns
Index of array cluster_info[]
int get_master_address ( int  slave_address)

Receives a slave address and tells which is its master address

Parameters
slave_addressThe XY slave address
Returns
The master address of the slave. Return -1 if there is no master (ERROR situation)
void handle_app_request ( )

Handles a new application request triggered by test_bench (repository)

void handle_app_terminated ( int  appID,
unsigned int  app_task_number,
unsigned int  app_master_addr 
)

Handles an application which terminated its execution

Parameters
appIDApplication ID of the terminated app
app_task_numberApplication task number
app_master_addrApplication master XY address
void handle_new_app ( int  app_ID,
volatile unsigned int *  ref_address,
unsigned int  app_descriptor_size 
)

Handles a new application incoming from the global manager or by repository

Parameters
app_IDApplication ID to be handled
ref_addressPointer to the application descriptor. It can point to a array (local manager) or the repository directly (global manager)
app_descriptor_sizeSize of the application descriptor
void handle_packet ( )

Handles a new packet from NoC

void handle_pending_application ( )

Handles a pending application. A pending application it the one which there is some task to be inserted into reclustering

void initialize_cluster_load ( )

Initializes the cluster load by zeroing the cluster_load[] array

void initialize_clusters ( )

Initializes all local managers by sending a INITIALIZE_CLUSTER packet to each one

void initialize_slaves ( )

Initializes all slave processor by sending a INITIALIZE_SLAVE packet to each one

void request_application ( Application app)

Requests a new application to the global master kernel

Parameters
appApplication to be requested
void send_app_allocation_request ( Application app,
unsigned int *  task_info 
)

Assembles and sends a APP_ALLOCATION_REQUEST packet to the global master

Parameters
appThe Application instance
task_infoAn array containing relevant task informations
void send_app_terminated ( Application app,
unsigned int *  terminated_task_list 
)

Assembles and sends a APP_TERMINATED packet to the global master

Parameters
appThe Applications address
terminated_task_listThe terminated task list of the application
void send_task_allocation ( NewTask new_t)

Assembles and sends a TASK_ALLOCATION packet to a slave kernel

Parameters
new_tThe NewTask instance
int send_task_migration ( int  task_ID,
int  new_proc 
)

Assembles and sends a TASK_MIGRATION packet to a slave kernel

Parameters
task_IDThe task ID to be migrated
new_procThe new processor address of task_ID
void send_task_release ( Application app)

Assembles and sends a TASK_RELEASE packet to a slave kernel

Parameters
appThe Application instance