clockgen: fully working