EcoLogic ๐ŸŒ

January 7, 2026 ยท View on GitHub

Demo GIF

Real-Time, Energy-Efficient AI with DiffLogic on FPGA

EcoLogic is a neurosymbolic AI solution that leverages the DiffLogic architecture on an FPGA to achieve high-speed, low-power inference, ideal for real-time applications like disaster response. EcoLogic combines the efficiency of FPGA technology with IBMโ€™s watsonx.ai platform to provide a scalable, sustainable AI model that addresses the energy demands of data centers and supports climate goals.


Features โšก๏ธ

  • DiffLogic Model Training: Optimized model training with differentiable logic gates, enabling faster inference while maintaining a sparse, energy-efficient structure.
  • FPGA Implementation: First-of-its-kind hardware adaptation of DiffLogic on the DE10-Lite FPGA for even faster inference.
  • IBM watsonx.ai Integration: Utilizes IBMโ€™s generative AI platform for real-time analysis in AI-driven disaster response.

Repository Structure ๐Ÿ“

  • ModelSim/: Contains the latest testbench HDL files for simulation.
  • Quartus/: Houses the most recent Quartus project files for FPGA synthesis and implementation.
  • config/: Configuration files, including support for 16x16 image inputs, allowing flexible input sizes.
  • trained_models/: Pre-trained DiffLogic models ready for FPGA deployment.
  • verilog/: Verilog files for model deployment on the FPGA (16x16 and 32x32 input sizes).
  • vhdl/: Reserved for future VHDL implementations (currently Verilog-only).
  • watson ai/: Scripts for IBM watsonx.ai integration, including data generation and DAD (Data Analyzer and Debugger) logic analyzer.

Setup and Installation ๐Ÿš€

  1. Clone the Repository

    git clone https://github.com/matheusmaldaner/EcoLogic.git
    cd EcoLogic
    
  2. Install Dependencies
    Install the required Python packages:

    pip install -r requirements.txt
    

2.1 Install DiffLogic Refer to DiffLogic's official implementation for directions on how to install it.

  1. FPGA Synthesis
    Open the Quartus project file (.qpf) in the Quartus/ directory and follow the instructions in the README.md file there to compile and deploy to the DE10-Lite.

Usage ๐Ÿ’ป

  1. Model Training
    Run Main.ipynb to train DiffLogic models on your dataset. The notebook allows customization of hyperparameters and visualizes training metrics.

  2. Hardware Implementation
    The verilog/ and vhdl/ directories contain files for deploying trained models onto the FPGA. Use ModelSim and Quartus for simulation and synthesis.

  3. IBM watsonx.ai Integration
    The watson ai/ directory includes a script for watsonx.ai data analysis and inference testing. Run the integration script to connect EcoLogic with IBMโ€™s platform.


Example Input and Datasets ๐Ÿ“Š

  • mnist_dataset.py: Script to prepare and preprocess the MNIST dataset for DiffLogic training.
  • mnist_input.mif: Memory initialization file for FPGA ROM setup.

Results and Benchmarks ๐Ÿ“ˆ

NodesDiffLogic (ยตs)FPGA (ยตs)% Decrease
512000365.7139.4662%
3584000537.89177.967%
6144000724.20186.7674%
8704000907.78202.5478%
112640001086.52239.1878%

inference times comparison


Contributing ๐Ÿค

Contributions are welcome! Please fork this repository and submit a pull request. Ensure that your code passes all tests and adheres to our style guide.