Functions

/home/sindre/dev_uclinux/suzaku_shared/hwos_sw/libhwos/hplacer.h File Reference

[Hardware OS Placer Interface] Responsible for interrupting and replacing a running process on the FPGA. More...

#include "hstructures.h"

Go to the source code of this file.

Functions

int hplacer_set_icapdevice (const char *device)
 Set the full filename of the ICAP device.
int hplacer_set_bitfilespath (const char *path)
 Set the path of the bitfiles.
char * hplacer_create_full_bitfilename (struct hprocess *process)
 Create full bitfilename.
int hplacer_interrupt_process (struct hprocess *process)
 Interrupt a process running on the FPGA.
int hplacer_start_process (struct hprocess *process)
 Start a process running on the FPGA.
int hplacer_save_state (struct hprocess *process)
 Communicate with the running FPGA-process and make it send the state information back to the HWOS.
int hplacer_load_state (struct hprocess *process)
 Load state information from memory/disk into the running process on the FPGA.
int hplacer_load_process (struct hprocess *process)
 Load process into FPGA area.

Detailed Description

[Hardware OS Placer Interface] Responsible for interrupting and replacing a running process on the FPGA.

Author (2011): Sindre Hansen

Definition in file hplacer.h.


Function Documentation

char* hplacer_create_full_bitfilename ( struct hprocess process  ) 

Create full bitfilename.

This will allocate a string containing the path of the bitfiles and the file name of the given process' bitfilename.

Parameters:
process Take bitfilename from this process.

Definition at line 45 of file hplacer.c.

{
        if (process == NULL)
                return NULL;

        // Enough memory for the strings + null-char + '/'.
        char* full_filename = calloc(1, strlen(get_bitfilespath_()) + strlen(hprocess_get_bitfilename(process)) + 2);
        strcpy(full_filename, get_bitfilespath_());
        strcat(full_filename, "/");
        strcat(full_filename, hprocess_get_bitfilename(process));
        
        return full_filename;
}

int hplacer_interrupt_process ( struct hprocess process  ) 

Interrupt a process running on the FPGA.

This assumes that the process is already placed on the FPGA and is running.

Definition at line 60 of file hplacer.c.

{
        return 0;
}

int hplacer_load_process ( struct hprocess process  ) 

Load process into FPGA area.

This will place the given process on the FPGA.

Definition at line 66 of file hplacer.c.

{
        char* filename_full = hplacer_create_full_bitfilename(process);
        int device_handle = hicap_open((char*)get_icap_device_(), "XC4VFX12");
        if (device_handle < 0)
                return -1;
        
        hicap_close(device_handle);
        free(filename_full);
        return 0;
}

int hplacer_load_state ( struct hprocess process  ) 

Load state information from memory/disk into the running process on the FPGA.

This version of the HWOS will always fetch the state information from a file on disk.

int hplacer_save_state ( struct hprocess process  ) 

Communicate with the running FPGA-process and make it send the state information back to the HWOS.

This assumes that the process is already placed on the FPGA and is stopped. This version of the HWOS will always store the state information in a file.

int hplacer_set_bitfilespath ( const char *  path  ) 

Set the path of the bitfiles.

Sets the path to the files where the process bitfiles are located.

Parameters:
path The path without the '/' at the end.

Definition at line 37 of file hplacer.c.

{
       bitfilespath = realloc(bitfilespath, strlen(path) + 1);
       strcpy(bitfilespath, path);
       return 0;
}

int hplacer_set_icapdevice ( const char *  device  ) 

Set the full filename of the ICAP device.

Example: "/dev/icap"

Parameters:
device The full filename to the device.

Definition at line 29 of file hplacer.c.

{
       icap_device = realloc(icap_device, strlen(device) + 1);
       strcpy(icap_device, device);
       return 0;
}

int hplacer_start_process ( struct hprocess process  ) 

Start a process running on the FPGA.

This assumes that the process is already placed on the FPGA, but not running.

 All Data Structures Files Functions Variables Enumerations Enumerator Defines