Version 2 (modified by 10 years ago) (diff) | ,
---|
GIET_VM / Mapping
C mapping data structure
The C binary mapping data structure, is used by the GIET_VM in the boot phase to map one or several multi-threaded user applications on a generic multi-processors, multi-clusters architecture. The next section describes how this this C binary structure can be generated by the genmap tool from a source description using the PYTHON language.
The C mapping data structure contains the following informations:
- It contains a description of the target, clusterized, hardware architecture, with the following constraints: The clusters are identified by the (x,y) coordinates in a 2D mesh topology. The number of clusters is variable (can be one). The number of processors per cluster is variable (can be one). The number of physical memory banks is variable (up to one physical memory bank per cluster. Most peripherals are external and localized in one specific I/O cluster.
- It contains a description of the user applications to be launched on the platform. An user application is characterized by a a virtual address space, called a vspace. The number of parallel tasks per application is variable (can be one). Multi-Writer/Multi?-Reader communication channels between tasks are supported. Each vspace contains a variable number of virtual segments, called vsegs. The number of vspace can be one.
- It contains the mapping directives: The tasks are statically allocated to processors. The various software objects (user and kernel code segments, tasks stacks, tasks heaps, communication channels, etc.) are called vobjs, and are statically placed on the distributed physical memory banks (called psegs), using the page tables (one page table per vspace) that define the mapping of the vsegs on the psegs.
The C binary mapping data structure is defined in the mapping_info.h file, and is organised as the concatenation of a fixed size header, and 11 variable size arrays:
- mapping_cluster_t cluster[]
- mapping_pseg_t pseg[]
- mapping_vspace_t vspace[]
- mapping_vseg_t vseg[]
- mapping_vobj_t vobj[]
- mapping_task_t task[]
- mapping_proc_t proc[]
- mapping_irq_t irq[]
- mapping_coproc_t coproc[]
- mapping_cp_port_t cp_port[]
- mapping_periph_t periph[]
It is intended to be stored in memory in the seg_boot_mapping segment.
Python Mapping General =
A specific mapping requires at least two python files:
- The arch.py file is attached to a given hardware architecture. It describes both the (possibly generic) hardware architectures, and the mapping of the kernel software objects on this architecture.
- The appli.py file is attached to a given user application. It describes the both the application structure (tasks and communication channels), and the mapping of the application tasks and software objects on the architecture.
The various Python Classes used by these these files are defined in the mapping.py file.
Python Architecture description =
To define an architecture, you must use the following constructors:
Class Mapping
The following constructor build a mapping object and define the target architecture general parameters:
mapping = Mapping( name # mapping name
x_size # number of clusters in a row of the 2D mesh y_size # number of clusters in a column of the 2D mesh nprocs # number of processors per cluster x_width # number of bits to encode X coordinate in paddr (default = 4) y_width # number of bits to encode Y coordinate in paddr (default = 4) p_width # number of bits to encode local processor index (default = 4) paddr_width # number of bits in physical address coherence # Boolean true if hardware cache coherence irq_per_proc # number of IRQ lines between XCU and proc use_ramdisk # Boolean true if the architecture contains a RamDisk? x_io # io_cluster X coordinate y_io # io_cluster Y coordinate peri_increment # peri_increment, ram_base # Physical memory bank base address in cluster [0,0] ram_size # ram_size )
mapping = Mapping