An enhanced Verilog-A compact model for bipolar RRAMs including transient thermal effects and series resistance