n + 4
It was missing a callback that check the validity of the immediate value.I've added it now.
Hum !!!You "just need" that I can't give you the source code of the cycle counter but I can explain how it's work.There Is two part:- the general case- the specific case (register restriction, shortcuts, ...)You are at cycle #101 - The ARM check before starting an instruction that all the registers will be available when the instruction will need them.For example:you want to execute a MUL Rd, Rm, RsRm must be available at cycle #11 (#10 + 1 see MUL cycle table http://infocenter.ar...ch16s02s03.html)If at least 1 register is not avalable, then the ARM do not start the instruction and you have a stall cycle.
I need something like thishttp://pulsar.websha...sult.php?lng=fr
Do you need to handle then in a cycle counter ???
Hum. you start with very complex questions !!!First I do not understand what you say about "static scheduling scoreboard, replay and pending queue"But I do not really understand what ARM call "data hazard" ;(What I can say is that if you apply the stage rules describe into the ARM documentation to count cycle, you'll have a "quite" correct result.After that there is a lot of special case (and they are not always documented) that can improve the quality of the counting process.shortcut (or fast forward) for example.
Branch mispredict penality : you can't handle this kind of stall cycles because you can't know when the ARM will have a mispredict branch. It's the same problem with memory read outside the cache !So you can just expect that most of case you don't have those stall cycle and then ignore those case.
The Cortex "can start" 4 instructions in the same cycle.Don't believe you'll be able to execute 4 instructions at each cycle! that's wrong !But in some case, in some cycle, the Cortex Can start 4 instructions (2 ARM and 2 NEON) in the same cycle.
I do not handle the 13 pipelines stages. I handle instructions when they enter into a functional unit.The cycle counter is not so complex (in fact decode step are not usefull to count cycle (I guess)).