-
Notifications
You must be signed in to change notification settings - Fork 186
Adding frequency grid validation for ZR optics #466
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
Changes from 7 commits
afa88e5
d746755
6172c5e
1ebfe1d
2b7a35b
92b6736
37aeb72
653c38a
f7a1672
0f4643d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1189,15 +1189,32 @@ def configure_tx_output_power(self, api, lport, tx_power): | |
self.log_error("{} configured tx power {} > maximum power {} supported".format(lport, tx_power, max_p)) | ||
return api.set_tx_power(tx_power) | ||
|
||
def configure_laser_frequency(self, api, lport, freq, grid=75): | ||
_, _, _, lowf, highf = api.get_supported_freq_config() | ||
def config_laser_frequency_validate(self, api, lport, freq, grid=75): | ||
supported_grid, _, _, lowf, highf = api.get_supported_freq_config() | ||
if freq < lowf: | ||
self.log_error("{} configured freq:{} GHz is lower than the supported freq:{} GHz".format(lport, freq, lowf)) | ||
return False | ||
if freq > highf: | ||
self.log_error("{} configured freq:{} GHz is higher than the supported freq:{} GHz".format(lport, freq, highf)) | ||
chan = int(round((freq - 193100)/25)) | ||
if chan % 3 != 0: | ||
self.log_error("{} configured freq:{} GHz is NOT in 75GHz grid".format(lport, freq)) | ||
return False | ||
if grid == 75: | ||
if (supported_grid >> 7) & 0x1 != 1: | ||
self.log_error("{} 75GHz is not supported".format(lport)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @balram-csco log the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added freq and grid logging |
||
return False | ||
chan = int(round((freq - 193100)/25)) | ||
if chan % 3 != 0: | ||
self.log_error("{} configured freq:{} GHz is NOT in 75GHz grid".format(lport, freq)) | ||
return False | ||
elif grid == 100: | ||
if (supported_grid >> 5) & 0x1 != 1: | ||
self.log_error("{} 100GHz is not supported".format(lport)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @balram-csco also log the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added frequency |
||
return False | ||
else: | ||
self.log_error("{} {}GHz is not supported".format(lport, grid)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @balram-csco please log the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added frequency log |
||
return False | ||
return True | ||
|
||
def configure_laser_frequency(self, api, lport, freq, grid=75): | ||
if api.get_tuning_in_progress(): | ||
self.log_error("{} Tuning in progress, subport selection may fail!".format(lport)) | ||
return api.set_laser_freq(freq, grid) | ||
|
@@ -1424,11 +1441,15 @@ def task_worker(self): | |
|
||
# For ZR module, Datapath needes to be re-initlialized on new channel selection | ||
if api.is_coherent_module(): | ||
freq = self.port_dict[lport]['laser_freq'] | ||
# If user requested frequency is NOT the same as configured on the module | ||
# force datapath re-initialization | ||
if 0 != freq and freq != api.get_laser_config_freq(): | ||
need_update = True | ||
freq = self.port_dict[lport]['laser_freq'] | ||
# If user requested frequency is NOT the same as configured on the module | ||
# force datapath re-initialization | ||
if 0 != freq and freq != api.get_laser_config_freq(): | ||
if self.config_laser_frequency_validate(api, lport, freq) == True: | ||
need_update = True | ||
else: | ||
# clear setting of invalid frequency config | ||
self.port_dict[lport]['laser_freq'] = 0 | ||
|
||
if not need_update: | ||
# No application updates | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@balram-csco please rename it to ->
validate_frequency_and_grid()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed function to validate_frequency_and_grid()