Cosmological simulation with dust formation and destruction