This patch converts the vhdl_table.cc file to C code and adds code to free the allocated memory at the end of simulation to make valgrind happy.