Skip to content
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

RFSoC unable to set NCO phase to -180.0 deg #302

Open
rikyborg opened this issue Jul 18, 2024 · 1 comment
Open

RFSoC unable to set NCO phase to -180.0 deg #302

rikyborg opened this issue Jul 18, 2024 · 1 comment

Comments

@rikyborg
Copy link

It's possible to choose the phase offset in degrees of the NCO with the field PhaseOffset in the struct XRFdc_Mixer_Settings. However, it's not possible to set the phase to either -180.0 or +180.0 degrees. That is important in some scenarios, for example when an out-of-phase relation is required between NCOs on different ports, or when the NCO phase needs to be swept around the unit circle.

The issue seems to be the check in xrfdc_mixer.c:391:

	if ((MixerSettingsPtr->PhaseOffset >= XRFDC_MIXER_PHASE_OFFSET_UP_LIMIT) ||
	    (MixerSettingsPtr->PhaseOffset <= XRFDC_MIXER_PHASE_OFFSET_LOW_LIMIT)) {
		metal_log(METAL_LOG_ERROR, "\n Invalid phase offset value (%lf) for %s %u block %u in %s\r\n",
			  MixerSettingsPtr->PhaseOffset, (Type == XRFDC_ADC_TILE) ? "ADC" : "DAC", Tile_Id, Block_Id,
			  __func__);
		Status = XRFDC_FAILURE;
		goto RETURN_PATH;
	}

I believe the second condition should be changed from <= to < to allow setting phases in the half-open interval [-180.0, +180.0).

@conallogriofaamd
Copy link
Contributor

Hi @rikyborg,

Thanks for taking the time to alert us to this issue.

I agree, we will make the necessary changes.

Thanks,
Conall.

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

No branches or pull requests

2 participants