Skip to content

Conversation

@jjin62
Copy link

@jjin62 jjin62 commented Oct 9, 2025

  1. Add a new precision attribute flag for optical analog values (e.g., gain, tilt, power), instead of using double/float point type which would introduce NaN issue.
  2. Add support for optical attenuator in experimental extensions, derived from openconfig-optical-attenuator.yang.
  3. Add support for optical amplifier in experimental extensions, derived from openconfig-optical-amplifier.yang.

@jjin62
Copy link
Author

jjin62 commented Oct 9, 2025

  1. Introducing two new SAI objects OTN-OA and OTN-ATTENUATOR using SAI experimental extension mechanism. OA and ATTENUATOR are optical modules which can form a simplest optical amplifier.
  2. Gauged/Analog values (optical power, gain, attenuation etc..) are usually represented in a float point format (double or float). However, double/float data type is prohibited in SAI to avoid NaN issue (see meta/Makefile compile flag "-Wfloat-equal"). Therefore, a @precision tag is introduced to represent the number of digits after the decimal point. Any integer type with a @precision tag can be used to represent a decimal type.
    Ref SAI Support optical transport device - proposed by sonic-wg-otn #2216

@jjin62 jjin62 closed this Oct 9, 2025
@jjin62 jjin62 reopened this Oct 9, 2025
@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 2217 in repo opencomputeproject/SAI

meta/parse.pl Outdated
return 0 unless defined $precision;

# Must be an integer >= 0
if ($precision =~ /^\d+$/) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ to new line, and add empty libe before return same in line 434

Copy link
Author

@jjin62 jjin62 Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

WriteSource ".iscustom = ($attr >= 0x10000000) && ($attr < 0x20000000),";
WriteSource ".apiversion = $apiversion,";
WriteSource ".nextrelease = $nextrelease,";
WriteSource ".valueprecision = $precision,";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be test in saisanitycheck.c for that value if it's in reasonable range, like 0..18 etc since you can put number like 23423542542 and it will be cast as int, truncated, to some absurd value which will make no sense

Copy link
Author

@jjin62 jjin62 Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. check precision range [0..18], 18 is the max precision used in transponder.

image

1. Add a new precision attribute flag for optical analog values (e.g., gain, tilt, power), instead of using double/float point type which would introduce NaN issue.
2. Add support for optical attenuator in experimental extensions, derived from openconfig-optical-attenuator.yang.
3. Add support for optical amplifier in experimental extensions, derived from openconfig-optical-amplifier.yang.

Signed-off-by: Lu.Mao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants