A Flexible Simulation Methodology and Tool for Nanoarray-based Architectures