Skip to content

Bitfile versioning #18

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

Merged
merged 17 commits into from
Aug 29, 2022
Merged

Bitfile versioning #18

merged 17 commits into from
Aug 29, 2022

Conversation

Ajstros
Copy link
Owner

@Ajstros Ajstros commented Aug 17, 2022

Add bitfile versioning functionality to FPGA class and DDR3.save_data and DDR3.data_to_names methods.

  • Bitfile version can be found in Endpoint GP_BITFILE_VERSION, it will be given as a 6-digit number (e.g. 20514 -> v02.05.14)
  • Bitfile version is saved to the FPGA attribute bitfile_version and printed with other initialization data when FPGA.init_device() is run

Edit:

Later commits on this branch also add an append optional parameter to DDR3.save_data() to allow the user to choose between overwriting any pre-existing file with the same name, and appending the new data to that file.

@Ajstros Ajstros self-assigned this Aug 17, 2022
@Ajstros
Copy link
Owner Author

Ajstros commented Aug 19, 2022

Working as expected now

@Ajstros Ajstros requested a review from lucask07 August 19, 2022 22:01
@@ -602,7 +602,7 @@ def deswizzle(self, d, convert_twos=True):

return chan_data

def data_to_names(self, chan_data, old=False):
def data_to_names(self, chan_data, bitfile_version=self.fpga.bitfile_version):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not certain how the default parameter self.fpga.bitfile_version will behave if DDR3 is instantiated before the FPGA is initialized. The preferred usage might be that the bitfile_version is determined from the h5 file. Doing so will allow for offline data analysis to be done without an FPGA instance.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The code has been updated, as outlined below. The idea is that we will pass in the bitfile version number from the .h5 file when we call data_to_names. This keeps data_to_names indepedent from .h5 files, so that we keep the option of reading DDR data without saving to a .h5 file open.

@@ -602,7 +600,7 @@ def deswizzle(self, d, convert_twos=True):

return chan_data

def data_to_names(self, chan_data, old=False):
def data_to_names(self, chan_data, bitfile_version=None):
Copy link
Owner Author

Choose a reason for hiding this comment

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

The code has been updated to use None as the default. This allows old code to still use DDR3.data_to_names without needing to be updated for the new parameter.

@Ajstros Ajstros requested a review from lucask07 August 29, 2022 15:11
@Ajstros Ajstros merged commit 097b3d2 into main Aug 29, 2022
@Ajstros Ajstros deleted the bitfile_versioning branch August 29, 2022 15:59
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.

2 participants