paulscherrerinstitute/psi_common

psi_fix_debouncer rework

Closed this issue · 1 comments

@BenoitStef

One of my students informed me that the debounce is a bit suboptimal to use. He suggested the following extensions/changes:

  • Implement it in a way that the first edge is forwarded without delay (for latency sensitive applications)
    • This one I could implement easily
  • Add the capability to do edge detection (so at the output only a pulse per button-press occurs)
    • This one I would suggest to implement separately as psi_common_edge_det

When looking into the code I also found out that the current devouncer is not 100% correct. If many inputs are used and one is constantly toggling, the other ones are not updated too (because the counter never gets zero). I would suggest to fix this by implementing one counter per bit (so they are fully independent).

I would be motivated to do this, so I basically only need an OK for these changes. Do you agree to implement these cahnges? In my opinion they should not break backwards-compatibility.

sure you can do! Btw I did a small python script to create quickly the MD file table from the entity & generics if you like to use it from VHDL, let me know if you are interested