How akhilt2/bharat-ai-soc-challenge works
The repository is a collection of implementations and experiments for CNN inference on embedded and FPGA hardware, rather than one integrated runtime. The documented target workflow is image or dataset input, Arm-side preprocessing/control, FPGA acceleration of CNN operations, and inference results with CPU-versus-hardware performance comparison. FINN provides a substantial dataflow build/runtime stack; the tree also includes manual HLS simulation artifacts and Keras-to-C conversion variants. Relationships among these branches are not assumed. Evidence is limited to the README, tree, and sampled excerpts/index references.
Main entry points: __init__.py Keras2C API · fpgadataflow FPGA accelerator · validate.py Inference results · apatb_cifar10_infer.cpp HLS testbench
Components 25
Zynq inference
- Image or dataset
- Arm preprocessing
brevitas-finn/finn/finn_zybo_project/output_hardware/driver - CNN model
models/CIFAR_BREVITAS/new_res_brevitas/export_model.py - FPGA accelerator
brevitas-finn/finn/src/finn/custom_op/fpgadataflow - Zynq board
- Inference results
brevitas-finn/finn/finn_zybo_project/output_hardware/driver/validate.py
FINN dataflow
- Dataflow builder
brevitas-finn/finn/src/finn/builder/build_dataflow.py - Model transformations
brevitas-finn/finn/src/finn/transformation/fpgadataflow/convert_to_hw_layers.py - FPGA operators
brevitas-finn/finn/src/finn/custom_op/fpgadataflow/matrixvectoractivation.py - HLS backend
brevitas-finn/finn/src/finn/custom_op/fpgadataflow/hlsbackend.py - RTL backend
brevitas-finn/finn/src/finn/custom_op/fpgadataflow/rtlbackend.py - PYNQ driver
brevitas-finn/finn/finn_zybo_project/output_hardware/driver/driver.py
Manual HLS
- HLS testbench
hls-manual/cifar10_hls/solution1/sim/wrapc/apatb_cifar10_infer.cpp - Fixed-point types
hls4ml/hls4ml_prj/firmware/ap_types/ap_fixed.h - Arbitrary integers
hls4ml/hls4ml_prj/firmware/ap_types/ap_int.h - HLS streams
hls4ml/hls4ml_prj/firmware/ap_types/hls_stream.h
Keras to C
- Keras converter
keras2c/convert.py - Keras2C API
keras2c/c_model/src/keras2c/__init__.py - Weight generation
keras2c/c_model/src/keras2c/weights2c.py - Embedding operation
keras2c/c_model/include/k2c_embedding_layers.c - Optimized variants
keras2c/c_model_optm/src/keras2c/weights2c.py - Additional variant
keras2c/c_model_optm_2/src/keras2c/weights2c.py
Evaluation
- Performance analysis
brevitas-finn/finn/src/finn/analysis/fpgadataflow/dataflow_performance.py - Resource analysis
brevitas-finn/finn/src/finn/analysis/fpgadataflow/res_estimation.py - CPU baseline
pynq-runs-pure-sw/benchmark_inference.py
Connections 22
- Image or dataset → Arm preprocessing: feeds images
- Arm preprocessing → FPGA accelerator: sends workload
- CNN model → FPGA accelerator: maps CNN compute
- FPGA accelerator → Zynq board: executes on fabric
- Arm preprocessing → Inference results: controls inference
- Zynq board → Inference results: produces results
- Dataflow builder → Model transformations: applies transformations
- Model transformations → FPGA operators: converts hardware layers
- FPGA operators → HLS backend: supports HLS implementation
- FPGA operators → RTL backend: supports RTL implementation
- PYNQ driver → Zynq board: controls board
- Inference results → CPU baseline: compares against
- Performance analysis → Inference results: measures latency
- Resource analysis → FPGA accelerator: estimates resources
- HLS testbench → Fixed-point types: includes fixed types
hls-manual/cifar10_hls/solution1/sim/wrapc/apatb_cifar10_infer.cpp - HLS testbench → Arbitrary integers: includes integer types
hls-manual/cifar10_hls/solution1/sim/wrapc/apatb_cifar10_infer.cpp - HLS testbench → HLS streams: uses streams
hls-manual/cifar10_hls/solution1/sim/wrapc/apatb_cifar10_infer.cpp - Keras converter → Keras2C API: calls converter API
keras2c/convert.py - Keras2C API → Weight generation: exports weights
- Weight generation → Embedding operation: generates layer parameters
- Keras2C API → Optimized variants: has optimized counterpart
- Keras2C API → Additional variant: has another variant