# Prerequisites
After flashing the FPGA bitstream (.job file) and the envm.job in the FPGA, these are the steps that need to be followed, in order to build the embedded software:
```
cd dependencies/masterfip && make lib
cd mockturtle/software && make lib
cd kernel/ && make
cd dependencies/masterfip-init/ && sudo ./start.sh
```
Note: the last step, which is to run the start script, needs to be done everytime the installment with masterfip is power off and power on.
In this directory, the sub-directories are organized as following:
	- fip_urv/  : contains CPU management 
	- mfip_urv/ : contains masterfip management
	- plc_urv/  : the application management
To add another feature in masterfip, modify the mfip_urv.c and then modify the fip_urv.c. In plc_urv directory, there are some programs which can be compiled and used as an application (ex. app_counter.c).

In order to get started, this is a suggested work aroung:
```
cd mfip_urv/ && make
cd fip_urv/ && make
cd plc_urv/ && make
```

After generated all the binary files (.elf) then:
```
sudo ./mfip_urv --cons-vl 16 spi-load-elf ../fip_urv/fip_urv.elf 34
sudo ./mfip_urv plc 0 halt
sudo ./mfip_urv load 0 ../plc_urv/add_data_inc.elf  (or the name of the application which had been compiled)
```

 

