Skip to content

Add ability to compare the top N bits of fractional time

What this MR does / why we need it:

This adds the ability for the ocpi_testing comparison classes to only compare only the top N bits of fractional time.

Adds a new configurable TIME_FRACTIONAL_BITS_PRECISION setting, which defaults to 64 - which means comparing the all 64 fractional bits of the UQ32.64 values.

Ideally a component's test should match the full values, but if desired the new python bit comparison field can be changed in the verify.py file using:

verifier.comparison[<output_port_number>].TIME_FRACTIONAL_BITS_PRECISION = <desired_bit_precision>

For example, to only honour the previous UQ32.40 expectations:

verifier.comparison[0].TIME_FRACTIONAL_BITS_PRECISION = 40

Tests have been added within the ocpi_protocols module to confirm decimal values (used for Time and Sample Interval data) can be written to file in UQ32.64 format and read back as the same values. There is then a change to the precision used by the ocpi_protocols module when working with python decimal values to ensure these tests pass.

Also ensures the tools/python/opencpi/ocpi_testing/ocpi_testing/_comparison_methods/*.py files pass ocpilint.

Steps to complete before submitting MR:

  • I have read Contribution guidelines

  • I have ensured I have a changelog written in the imperative form that is meaningful and accurately summarizes the work done

  • I have added the release notes label if applicable (more information below)

  • I have ensured the workflow labels are up to date and will continue to do so up until this work is merged into develop

  • I have added a category, type, and target release label along with all other labels needed

  • My branch is up to date with develop. If it is not, then I have ensured my work does not conflict with other work

  • I agree my bugfix MR does not include new features/enhancements

  • I represent that bugfixes have been locally tested against the most recent major.minor release in which the bug exists

  • (REVIEWER ONLY) I have thoroughly gone through the above steps to ensure that they have been followed

Release Notes

N/A

Changelog

  • feat(component,tests): add ability to compare top N bits of fractional time in ocpi_testing

Which issue(s) this MR closes

N/A

Edited by Aaron Olivarez

Merge request reports