Text this: Code generation and simulation of an automatic, flexible QC-LDPC hardware decoder