NXP i.MX7D счётчик машинных циклов

Все кортексы имеют встроенный счётчик машинных циклов. Например M4.

В ядрах Cortex-A7 он прячется в Performance Monitor.

	@ Включить счётчик машинных циклов

	@ Performance Monitors User Enable Register
	MOV R1, 1 @ 1 = User mode access to the Performance Monitors enabled
	MCR p15, 0, R1, c9, c14, 0 @ Write PMUSERENR Register

	@ Performance Monitors Interrupt Enable Clear register
	SER R1 @ Запретить все прерывания
	MCR p15, 0, R1, c9, c14, 2 @ Write PMINTENCLR Register

	@ Performance Monitor Control Register
	MOV R1, 1 @ All counters are enabled.
	MCR p15, 0, R1, c9, c12, 0 @ Write PMCR

	@ Performance Monitors Count Enable Set register
	MOV32 R1, 1 << 31 @ Enable the PMCCNTR cycle counter
	MCR p15, 0, R1, c9, c12, 1 @ Write PMCNTENSET Register

	@ Уже тикает!

	@ Прочитать счётчик машинных циклов в R5
	MRC p15, 0, R5, c9, c13, 0

	@ На чтение уходит 1 машинный цикл
	@ Не забывайте вычесть его из результата
	

Так как этот счётчик встроен в ядро, в референсе на камень вы не найдёте о нём ни слова.
Смотрите "Cortex-A7 MPCore Technical Reference Manual".

Там ещё много интересных штучек есть!