-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add standard deviation mode for pcap captures #13
Comments
Concerning the question of capture modes, we'd like to have at least "mean stddev" mode, "min max mean stddev" mode would be a nice plus. |
I'm trying to remind myself of how the existing hardware interface to capture works. Can you please document in some detail how your new firmware implementation fits into this, please? I have the following description of the existing control interface taken from /* Macros for formatting position and extension bus entries into capture field
* values. The bit layout for each type is as follows:
*
* 32 9 8 4 2 0
* +------------+-+----------+-+------+
* Position bus | 0 |0| pos-ix |0| mode |
* +------------+-+----------+-+------+
*
* 9 7 4
* +------------+-+-+--------+--------+
* Extension bus | 0 |1|0| ext-ix | 0 |
* +------------+-+-+--------+--------+
*/
/* Definitions of position capture fields. */
#define POS_FIELD_VALUE 0
#define POS_FIELD_DIFF 1
#define POS_FIELD_SUM_LOW 2
#define POS_FIELD_SUM_HIGH 3
#define POS_FIELD_MIN 4
#define POS_FIELD_MAX 5 If I remember correctly, each selected So I think my first questions are:
|
We added 3 more fields: POS_FIELD_SUM2_LOW, POS_FIELD_SUM2_MID, POS_FIELD_SUM2_LOW
The firmware returns the sum of squares result composed of 3 registers of 32-bit words (VHDL file):
In the firmware we used principally DSP (92 used among 400) to calcul squares. We've made a firmware test by putting them in existing position fields (min, max and diff) and verify their captured values which seem to be ok.
|
This looks perfectly sensible to me, and it should be reasonably straightforward to add this functionality to the server. However, we don't want to offer "stddev" capture options when the firmware option isn't available, and I suspect we may want to conditionally include this functionality. @thomascobb , how do you want to proceed with this? I suspect if you add this firmware option to our existing FGPA builds a number of them will fail to synthesise; this certainly needs to be checked! I suggest adding register Regarding server implementation, there are a number of issues that will make it a bit tricky.
|
@shu-soleil please could you merge master into the @tomtrafford do you have time to work on this? If so, please could you check the FPGA utilization on the current 3.0a1 tag zpkgs that you made the other day, then when master is merged into the |
How does that add up? I'm guessing your POS bus wasn't fully populated, as I would have guessed your usage would be at least 4 DSPs per channel unless you're not accumulating on every tick. I'm struggling to find the implementation in your branch: can you link me to the implementation, please? |
Is it this: pcap_frame_mode.vhd lines 187-213? |
Thank you, that looks like it. I was wondering if the accumulator could be done inside the DSP, and it would be interesting to look at what fabric has been generated for that (the actual multiplication occurs on line 104). What's with the configurable 8 bit shift on the accumulator? Is that something I already take into account (I see it also applies to the sum as well as the sum of squares)? Can't say I remember that functionality. |
I've created a pull request: PandABlocks/PandABlocks-FPGA#49 |
The sample_count is a 32-bit number, so will overflow after ~30s. We put in the shift to allow frames of longer than 30s to be averaged: As we shift both the sum and the number of counts, the server doesn't need to do anything. |
@shu-soleil I have talked to @Araneidae and he is happy to do the work on the server.
I've made PandABlocks/PandABlocks-FPGA#62 with a task for this, and for you to capture the work on the FPGA side |
Hi thanks ! We'll take a look with Thierry. |
This is now implemented in commit 3fb86b6 |
Hello,
We'd like to add a new mode of pcap captures for standard deviation calculation. We implemented on the FPGA side, the capture of the sum value of input^2 (commit to "pcap_std_dev" branch on PandABlocks-FPGA repo). On the server side, we'll need to add a new mode to calculate the standard deviation with the new sum of input^2 value, and the existing mean value also the captured number:
![image](https://user-images.githubusercontent.com/10975033/124134245-ebb45600-da82-11eb-8813-2ca5fd968919.png)
Could you give some advices of adding this new capture mode on the server ?
Many thanks !
The text was updated successfully, but these errors were encountered: