-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
…tfile_versioning
Working as expected now |
@@ -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): |
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.
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.
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.
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): |
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.
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.
Add bitfile versioning functionality to
FPGA
class andDDR3.save_data
andDDR3.data_to_names
methods.GP_BITFILE_VERSION
, it will be given as a 6-digit number (e.g. 20514 -> v02.05.14)FPGA
attributebitfile_version
and printed with other initialization data whenFPGA.init_device()
is runEdit:
Later commits on this branch also add an
append
optional parameter toDDR3.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.