A compiler and simulator for the Hex architecture