Skip to content
Snippets Groups Projects

Draft: Resolve "Add more Documentation"

Open Hangzhi Yu requested to merge 5-add-more-documentation into master
+ 43
8
# FPGA Device Manager
# Smart Home Solution
A GUI for managing device configurations for a Smart Home FPGA solution that was created as part of a Bachelor's thesis.
This is a Smart Home Solution initially created as part of a Bachelor's thesis. The product consists of three parts:
 
- FPGA boards that can take signals from switches and other physical inputs and switch lamps and other home appliances,
 
- an I²C bridge for communication of several FPGA boards with a Raspberry Pi
 
- and finally the Raspberry Pi itself, which runs HomeAssistant.
 
 
## FPGA Device Manager
 
A GUI for managing device configurations as a part of a Smart Home FPGA solution.
This application aids you in creating a device configuration for a Smart Home FPGA and automatically generates the corresponding Verilog code.
This application aids you in creating a device configuration for a Smart Home FPGA and automatically generates the corresponding Verilog code.
## Installation
### User installation
```
```
pip install fpga-device-manager
pip install fpga-device-manager
```
```
## Usage
### Developer installation
 
If you want to install a local version of the project in order to try out changes, follow these steps:
 
 
- Clone the repository
 
```
 
git clone git@edugit.org:fpga/fpga-device-manager-2.git
 
```
 
- Enter the dir, create a python virtual environment and enter it
 
```
 
cd fpga-device-manager-2
 
python -m venv env
 
source env/bin/activate
 
```
 
- Run the setup script and install the required dependencies
 
```
 
python setup.py install
 
```
 
 
Now, the local dev version of fpga-device-manager-2 is installed. Every time you want to try out some changes you have made to the program, you have to run
 
```
 
python setup.py install
 
```
 
again; then, they become live.
 
 
### Usage
To launch the GUI, execute:
To launch the GUI, execute:
```
```
python -m fpga_device_manager
python -m fpga_device_manager
```
```
- The generated Verilog `.v` files will have to be copied manually to the `smarthome/source/generated` folder of the Lattice Diamond project.
- The generated Verilog `.v` files will have to be copied manually to the `smarthome/source/generated` folder of the Lattice Diamond project (separate repo).
- The generated `smarthome.ldf` file has to be copied manually to the root folder of the Lattice Diamond project.
- The generated `smarthome.ldf` file has to be copied manually to the root folder of the Lattice Diamond project.
### Command-line generation
#### Command-line generation
Verilog code can be generated from the command line like this:
Verilog code can be generated from the command line like this:
```
```
python -m fpga_device_manager.generator --output=./generated configuration.json
python -m fpga_device_manager.generator --output=./generated configuration.json
```
```
## Valid configurations
#### Valid configurations
A valid configuration needs:
A valid configuration needs:
- at least one appliance
- at least one appliance
- at least one sensor
- at least one sensor
- every sensor to be associated with an appliance
- every sensor to be associated with an appliance
- an I2C adress between 8 and 119 which is not dividable by 4 but by 2
- an I2C adress
 
 
#### Concept
 
 
##### Banks
 
The pins on the used MachXO2 FPGA board are classified into so-called banks - groups of nearby pins that share the same I/O voltage. By now, these voltages and the assignment of banks to pins can only be changed manually in the JSON configuration.
Loading