Hw access optimization #327
Hw access optimization #327
Conversation
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.
Just a few quick comments before it's ready for reveiw:
- would be better to replace all the
// Deprecated
comments with[[deprecated]]
or__attribute__((__deprecated__))
(if the functions themselves aren't going to be removed in this rework) - why are we reintroducing the duplication of remote vs local function calls? if the method in the CTP7 modules is desired outside of the modules themselves, then why not just export it directly, i.e., why duplicate
readReg
with thereadRemoteReg
wrapper, when the templating was introduced with one of the intended goals of removing this duplication?
I think everything else can wait for proper review
👍 I would even remove the deprecated placeholder functions since they can lead to unexpected misbehavior (if
Wouldn't these remote RPC methods be only temporary until we no longer need raw register accesses from |
I don't know, either there's a use case for having these low level functions exposed on on the PC side, in which case I'd just export them as is and do a refactor in |
I think the use case is only a temporary compatibility layer for migration purposes. I prefer to see multiple easily reviewable small PR rather than one huge PR with many changes. The mid-term goal could be like:
For now, at least, they are in the same namespace, in this case, |
…roducing [[deprecated]] attributes
…resent in xml configurations as it relates to base class GEMApplication. Not sure what to do with it right now
…removing obsolete GLIB-related functionality, obsolete register access methods and HwGlib device class
71bbaee
to
3b2e2f5
Compare
…package. Lots of dirty hacks which won't be fixed in the current PR in order to keep it compact. Notably: * namespaces accross the and has to be uniformized * Compile-time definition for added to makefiles of and * must be fixed with new build system. Eventually has to be converted into a runtime constant as we want the same backend software to work with different generation front-ends * lots of obsolete functions which require interface redesign * argument passing between and has to be uniformized - see cms-gem-daq-project#173 of Code compiles and this is IMHO enough for the current PR
please check updated PR description |
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.
Nothing outstanding, can be compiled. Should be good for hardware tests. I would be careful where and how the INPUT_ENABLE_MASK
is set.
|
||
// FIXME make me more streamlined | ||
// this maybe shouldn't be done? Commenting out for now, but needs testing | ||
//info.slotID = slot+1; |
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.
To be tested. A changelog, or announcement, is required if the configuration has to be changed somehow.
// FIXME should not need this here? | ||
amc->disableDAQLink(); |
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.
To be tested, since it changes the behavior.
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.
Indeed, but the main purpose if this PR is to have something which uses the templated RPC framework and can cycle through the FSM states. Proper implementation of the state transitions IMHO deserves another PR (and at the moment it has to be also chained with the corresponding changes of the ctp7_modules
). As a lot of things are candidates for refactoring, simply making it work "as is but without uHAL" doesn't appeal too much to me
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.
In general, I believe that regressions should not be allowed in PR. However, this PR as well as the next round of PR are kind of special due to the huge refactoring in progress. But what about the other developments which happen in parallel? Once this PR gets merged, how would the calibration suite be tested, for example?
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'd say there's more to the calibration suite tests... The system also can't be easily recovered from cold boot state. But if you insist, I can retrofit this back. However I can't test the real data taking until we fix the cooling
…the cmsgemos side, I make it compliant with the corresponding method of ctp7_modules
…faces (candidates for refactoring in base class) and linking issues against xhal-base (temporary hacks)
Test report:
Following this I'd propose to merge this PR and address remaining and future issues in separate PRs. As a proof of concept, the system can work without |
gemhardware/devices/Makefile
Outdated
@@ -55,7 +59,8 @@ LibraryDirs+=$(BUILD_HOME)/gemutils/lib/$(XDAQ_OS)/$(XDAQ_PLATFORM) | |||
LibraryDirs+=$(uHALROOT)/lib |
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.
is this still needed?
gemhardware/devices/Makefile
Outdated
@@ -44,6 +47,7 @@ IncludeDirs+=$(BUILD_HOME)/gemhardware/utils/include | |||
IncludeDirs+=$(BUILD_HOME)/gemutils/include | |||
IncludeDirs+=$(uHALROOT)/include |
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.
Likewise, still refs uhal
} | ||
|
||
uint32_t gem::hw::HwGenericAMC::getTTCCounter(AMCTTCCommandT const& cmd) | ||
uint32_t gem::hw::amc::HwGenericAMC::getTTCCounter(AMCTTCCommandT const& cmd) |
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.
but in cases like this, where there is much more than just a single (read|write)Reg
it would have made sense to use the ctp7_modules
functor call
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.
yes, but this is out of the scope of the current PR
} | ||
|
||
uint32_t gem::hw::HwGenericAMC::getOptoHybridTriggerLinkCount(uint8_t const& oh, uint8_t const& link, AMCOHLinkCountT const& count) | ||
uint32_t gem::hw::amc::HwGenericAMC::getOptoHybridTriggerLinkCount(uint8_t const& oh, uint8_t const& link, AMCOHLinkCountT const& count) |
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.
likewise here i guess not, as i see this one was not ported over...
gemhardware/managers/src/common/optohybrid/OptoHybridManager.cc
Outdated
Show resolved
Hide resolved
Test update |
…cludes in hw devices
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.
Approved as a technical PR. I prefer to see all new developments use the templated RPC and run into easily fixable issues rather than waiting months for the perfect PR; all issues from such a large change cannot be discovered by simple testing.
Description
This PR brings:
gemhardware
exceptamc13
-related codeRPC
calls ingemhardware
to templated onesThe quality of the code is not up to industrial standards, but this is one more technical stop on the way to a better structured clean project. A number of issues were spotted during the work on this PR which have to be fixed before we can advance.
Notably:
GEM_VARIANT
added to makefiles ofgemhardware/managers
andgemhardware/devices
ctp7_modules
Cleaning the FSM transition, getting rid of
uhal
library.Types of changes
Motivation and Context
How Has This Been Tested?
Not yet tested on the hardware. Help is needed on building/deployment instructions for
ctp7_modules
. So far build system is unclear. However the code compiles and in general should run. Would also prefer a code review before stepping into testing phase.Screenshots (if appropriate):
Checklist: