Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Conversation

mexanick
Copy link
Contributor

Description

Implements GE2/1 compatibility. All new parameters are backed with default values set to GE1/1 defaults. Thus the rest of the software should be able to work unchanged. Requires cms-gem-daq-project/ctp7_modules#132 to work with GE2/1

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context

Need to be able to use the current legacy software for GE2/1 integration stand

How Has This Been Tested?

Tested with GE2/1 integration stand.

Screenshots (if appropriate):

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Contributor

@jsturdy jsturdy left a comment

Choose a reason for hiding this comment

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

please rebase

@bdorney
Copy link
Contributor

bdorney commented Jun 14, 2019

In the CTP7 modules PR we added things like NUM_OH_PER_AMC. This is covered in HwAMC by a read of the register that says how many OH's are in the FW but one thing that's potentially overlooked are these lines:

https://github.com/mexanick/cmsgemos/blob/4cc3741fae8358643c885443a674c694686775ec/gempython/tools/amc_user_functions_xhal.py#L409-L411

e.g. the 0xfff bit mask used in this operation is specific to 12 OH case...should this also be protected by a per gemType constant?

@bdorney
Copy link
Contributor

bdorney commented Jun 14, 2019

In the CTP7 modules PR we added things like NUM_OH_PER_AMC. This is covered in HwAMC by a read of the register that says how many OH's are in the FW but one thing that's potentially overlooked are these lines:

https://github.com/mexanick/cmsgemos/blob/4cc3741fae8358643c885443a674c694686775ec/gempython/tools/amc_user_functions_xhal.py#L409-L411

e.g. the 0xfff bit mask used in this operation is specific to 12 OH case...should this also be protected by a per gemType constant?

Same question here:

https://github.com/mexanick/cmsgemos/blob/4cc3741fae8358643c885443a674c694686775ec/gempython/tools/amc_user_functions_xhal.py#L464-L470

@bdorney
Copy link
Contributor

bdorney commented Jun 14, 2019

@bdorney
Copy link
Contributor

bdorney commented Jun 14, 2019

Probably change how mask in broadcast methods works:

https://github.com/mexanick/cmsgemos/blob/4cc3741fae8358643c885443a674c694686775ec/gempython/tools/optohybrid_user_functions_xhal.py#L106-L141

Propose to add to HwOptohybrid:

  • self.defaultVFATMask as a per gemType parameter in the __init__() method
  • Broadcast methods then have mask argument default to None
  • If mask argument is None in broadcast methods the method will use self.defaultVFATMask which is the gemType specific usage; otherwise it uses the input mask argument.

Otherwise I think you'll run into bus errors at some point.

If above solution is adopted then the following method would also need a similar modification:

@bdorney
Copy link
Contributor

bdorney commented Jun 14, 2019

Looks like no changes to this method, e.g. documentation illustrates that outData should be of a size that expects 24 VFATs and 12 OHs. Do we want to have unused memory like this?

Same question for the below:

Copy link
Contributor

@bdorney bdorney left a comment

Choose a reason for hiding this comment

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

Outstanding questions and/or clarification needed. Some additional compatibility issues raised.

@bdorney
Copy link
Contributor

bdorney commented Jun 14, 2019

I'm not sure I caught everything...

@mexanick
Copy link
Contributor Author

In the CTP7 modules PR we added things like NUM_OH_PER_AMC. This is covered in HwAMC by a read of the register that says how many OH's are in the FW but one thing that's potentially overlooked are these lines:
https://github.com/mexanick/cmsgemos/blob/4cc3741fae8358643c885443a674c694686775ec/gempython/tools/amc_user_functions_xhal.py#L409-L411
e.g. the 0xfff bit mask used in this operation is specific to 12 OH case...should this also be protected by a per gemType constant?

Same question here:

https://github.com/mexanick/cmsgemos/blob/4cc3741fae8358643c885443a674c694686775ec/gempython/tools/amc_user_functions_xhal.py#L464-L470

I don't think a protections is needed here

@@ -185,6 +185,12 @@ def __init__(self, cardName, debug=False, gemType="ge11"):
else:
raise KeyError("Unrecognized gemType {0}".format(gemType))

#Determine the number of VFATs per geb based on the gemType
if gemType in vfatsPerGemVariant.keys():
self.NVFAT = vfatsPerGemVariant[gemType]
Copy link
Contributor

Choose a reason for hiding this comment

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

we won't have a situation where detType has a different number of VFATs correct?
e.g. {M1,...,M8} all have 12 VFATs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also in HwOptohybrid this is self.nVFATs vs. self.NVFAT.

Should we keep both these data members...in retrospect probably the better way to go would have been to have:

HwOptohybrid inherit from HwAMC and HwVFAT inherit from HwOptohybrid. Then all this parentX crap which is, admittedly, messy could disappear. Although whether that type of change is appropriate for this PR (or ever given this is #legacy) is unclear. Alas...my programming skills have improved since the original design...

Copy link
Contributor

Choose a reason for hiding this comment

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

I would caution against making API changes at this point, since this legacy stuff is supposed to be frozen anyway...
We will have to potentially think of how to map this in the updated API, where currently there is not going to be a HwVFAT, though it could be added if deemed absolutely critical (would just have to think of how best to do so...)

Copy link
Contributor

@bdorney bdorney Jun 26, 2019

Choose a reason for hiding this comment

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

I would caution against making API changes at this point, since this legacy stuff is supposed to be frozen anyway...

Indeed. For this PR then I would suggest we keep both data members but just standardized the data member name in both classes for QOL; so it should be either self.NVFAT or self.nVFATs with a slight preference for self.nVFATs simply because it pre-dates this PR in HwOptohybrid.

Copy link
Contributor

@bdorney bdorney left a comment

Choose a reason for hiding this comment

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

some typos in function documentation and one spot where I think an AttributeError will be raised at runtime.

@jsturdy
Copy link
Contributor

jsturdy commented Jun 27, 2019

If @bdorney is satisfied with changes, please rebase to clean up the commits (not before as it will make the review more difficult)

@bdorney
Copy link
Contributor

bdorney commented Jun 28, 2019

If @bdorney is satisfied with changes, please rebase to clean up the commits (not before as it will make the review more difficult)

My only outstanding comment was here.

@mexanick
Copy link
Contributor Author

mexanick commented Jul 3, 2019

I believe all the comments has been addressed now

Copy link
Contributor

@jsturdy jsturdy left a comment

Choose a reason for hiding this comment

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

OK from my side

@jsturdy
Copy link
Contributor

jsturdy commented Jul 8, 2019

@mexanick, merging this wouldn't break backwards compatibility (GE1/1) until cms-gem-daq-project/xhal#119 and cms-gem-daq-project/ctp7_modules#132 are merged, right?

@mexanick
Copy link
Contributor Author

mexanick commented Jul 8, 2019

It should not break GE1/1 compatibility at all

@mexanick mexanick merged commit 0dedd40 into cms-gem-daq-project:generic-amc-RPC-v3-short-term Jul 8, 2019
@jsturdy
Copy link
Contributor

jsturdy commented Jul 8, 2019

Grrr, @mexanick you merged... (I was going to squash)

@mexanick
Copy link
Contributor Author

mexanick commented Jul 8, 2019

ups. We can rewind if you insist

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants