A Hardware Generator For Factor Graph Applications