Text Generation
PEFT
Safetensors
English
fpga
bitstream-decompiler
verilog
hardware-eda
7series
zynq-7000
artix-7
kintex-7
codev-r1
formal-verification
graph-neural-network
conversational
Instructions to use nhz-io/7series-bitstream-decompiler with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nhz-io/7series-bitstream-decompiler with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("zhuyaoyu/CodeV-R1-RL-Qwen-7B") model = PeftModel.from_pretrained(base_model, "nhz-io/7series-bitstream-decompiler") - Notebooks
- Google Colab
- Kaggle
7-Series Bitstream Decompiler (7series-bitstream-decompiler)
AI-Powered Hardware Decompiler & Semantic Verilog RTL Lifter for AMD / Xilinx 7-Series FPGAs
7series-bitstream-decompiler is a hybrid Graph Neural Network (GNN) and Hardware-LLM reasoning engine engineered to decompile raw, anonymized Xilinx / AMD 7-Series FPGA gate netlists and physical CRAM frames (.bit / BOOT.bin) back into clean, synthesizable behavioral Verilog RTL (IEEE 1364-2001).
Architecture & Model Components
This repository contains the complete multimodal decompiler suite:
- LoRA Adapter (
adapter_model.safetensors):- Fine-tuned on
zhuyaoyu/CodeV-R1-RL-Qwen-7Bacross 44,698 7-Series netlists (134,094 steps). - Generates behavioral Verilog RTL directly from circuit graph prefix embeddings and prompt anchors.
- Fine-tuned on
- GNN Prefix Encoder (
gnn_prefix_encoder.safetensors/.pt):- Encodes NetTAG 100-dimensional circuit node features (LUT6 truth tables, FDREs, CARRY4s, clock domains, and board pin anchors) into 8 virtual prompt prefix tokens (3584 dimensions).
- 12 Auxiliary Perception Heads (
joint_auxiliary_heads.safetensors/production_12heads.pt):- Continuous Bitwidth Regression Head: Predicts bus bitwidths across 1 to 65,536 bits.
- Clock & CDC Head: Discovers clock domains and asynchronous resets.
- FSM Analysis Head: Extracts state count, one-hot vs gray encoding, and trap states.
- Pin Role Classifier: Maps package-agnostic pins (UART TX/RX, HDMI, SPI, LEDs, Buttons).
- Homoscedastic Multi-Task Balancer (
homoscedastic_loss.pt):- Learned Kendall & Gal task variances balancing LM loss with auxiliary hardware perception heads.
Release Versioning
v0.1.0-45k-baseline(Current):- Baseline production checkpoint trained on 44,698 netlists for 3 epochs (134,094 iterations) on NVIDIA GeForce RTX 4090.
- Mean Kendall & Gal Multi-Task Loss:
-1.8236. - LM Loss:
0.2830.
Quickstart & Inference
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "zhuyaoyu/CodeV-R1-RL-Qwen-7B"
decompiler_adapter_id = "nhz-io/7series-bitstream-decompiler"
tokenizer = AutoTokenizer.from_pretrained(decompiler_adapter_id, trust_remote_code=True)
base = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, decompiler_adapter_id)
model.eval()
prompt = "<|im_start|>system
You are a world-class hardware EDA engineer specializing in FPGA bitstream decompilation.<|im_end|>
<|im_start|>user
Recover behavioral Verilog for netlist sample_00000<|im_end|>
<|im_start|>thought
Verifying circuit topology...<|im_end|>
```verilog
"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, temperature=0.1)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Citation & License
- License: Apache-2.0
- Developed by: Nanohertz (nhz-io)
- Downloads last month
- 36
Model tree for nhz-io/7series-bitstream-decompiler
Base model
Qwen/Qwen2.5-7B Finetuned
Qwen/Qwen2.5-Coder-7B Finetuned
Qwen/Qwen2.5-Coder-7B-Instruct Finetuned
zhuyaoyu/CodeV-R1-RL-Qwen-7B