Bipolar resistive switching of bi-layered Pt/Ta2O5/TaOx/Pt RRAM : physics-based modelling, circuit design and testing