# Virtual memory checker

## Introduction

This file is responsible for checking that there is no overlapp between virtual pages range defined in `shelter/lib/include/memory/vmem_layout.h`. For the full documentation about this file, please see [virtual memory layout documentation](../shelter/memory/vmemlayout.md).

## Usage

The script is located inside `shelter/tools/checker/vmem_layout_checker.py`.

It can be used like that:
``` bash
python shelter/tools/checker/vmem_layout_checker.py <path to header file>
```

## Detailled processus

1) Open provided file, parse it and print the list of valid regions.
2) Generate `cfile.c` to let the compiler do the hard work of parsing macro declaration
3) Compile (the `gcc` compiler must be accessible inside the path) and run the generated C program
4) Recover the output of the program, parse it to obtain start and size of each virtual region
5) Check for overlaps and return an error if something went bad during the processus

The compiled program and the C file are deleted afterward.
