--- Quote Start ---
1) Implement your pulse counting logic in the FPGA (in verilog or vhdl, as you desire). Your requirements above seem pretty clear.
2) Implement a SPI interface in the FPGA (again, in your language of choice). A SPI interface is a pretty simple logic implementation.
3) Write a testbench to test your FPGA code functionality (ie, write a SPI master controller and have it read/write your FPGA registers).
4) When you are pretty confident it seems to work, compile and program into an FPGA, and then connect to your CPU board and check it.
5) Go back thru the loop to (1) when things don't seem to work.
Once you have some code written, we can comment on it and help you debug it. But we won't write it for you.
--- Quote End ---
Thank you for your guidance! It's very kind of you. I'll try it right now.:)