Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • YARR YARR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 67
    • Issues 67
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • YARR
  • YARRYARR
  • Issues
  • #12

Closed
Open
Created Jul 09, 2018 by Hideyuki Oide@hoideDeveloper

Rd53a::writeRegister() not calling Rd53aDiffReg::write()

I'm quite confused with the behavior of lin_thresholdscan.json with the Rd53a emulator test which results in segfault at its parameter loop of InjVcalDiff. (note that Rd53aEmu is sort of working for std_digitalscan.json and lin_analogscan.json so far).

If I understand correctly, InjVcalDiff is a special "virtual" register for the sake of simplifying writing the scan config. For this purpose, Rd53aRegDiff, a derived class of Rd53aReg is specially created, and it overrides write() function.

When the Rd53a::writeRegister() is called, the segfault is happening for InjVcalDiff.

void Rd53a::writeRegister(Rd53aReg Rd53aGlobalCfg::*ref, uint32_t value) {
	(this->*ref).write(value);
	wrRegister(m_chipId, (this->*ref).addr(), m_cfg[(this->*ref).addr()]);
}

Print debug showed that, in the above call of write(), instead of Rd53aRegDiff::write(), Rd53aReg::write() is called and it makes segfault at the line

            *m_cfg = (*m_cfg&(~(mask<<m_bOffset))) | ((value&mask)<<m_bOffset);

What I don't really understand is why overriding is not working... the way that Rd53aDiffReg::write() is called is that the member pointer is passed to Rd53a::writeRegister() as Rd53aReg and not as Rd53aRegDiff, but the usual mechanism of virtual function table should point to Rd53aDiff::write() and overriding is expected to work.

Apparently the current scan configs in devel is expected to be working in other environment with real Rd53a chips, I'm wondering if this may be just my env problem of using Apple LLVM version 9.0.0 (clang-900.0.39.2)??

Tagging @theim for discussion.

Assignee
Assign to
Time tracking