I put phase detector code in an S-function because I thought that would be faster than a sub-system. I guess thats a wrong assumption ;) I wrote the phase detector code with "if - else" structures paralleling closely the verilog code I used to implement it in an FPGA. If the boolean clock does not transition high the majority of the code in the 'update' is not executed.
Do you think execution would be faster if I 1) Generated a C compiled S-function or 2) Implement the phase detector using logic gates & counters in a sub-system ?
Thanks for your helpful advice,
Brian