mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
aurora_axis: add two functions to reset counters and configure loopback mode
This commit is contained in:
parent
1596208bb6
commit
3b28eea7d2
2 changed files with 29 additions and 1 deletions
|
@ -69,10 +69,17 @@ public:
|
|||
|
||||
std::string
|
||||
getDescription() const
|
||||
{ return "Aurora 8B/10B and additional support modules, like, communication with NovaCor and read/write status/control registers."; }
|
||||
{ return "Aurora 8B/10B and additional support modules, like an AXI4-Lite register interface."; }
|
||||
|
||||
Vlnv getCompatibleVlnv() const
|
||||
{ return {"acs.eonerc.rwth-aachen.de:user:aurora_axis:"}; }
|
||||
|
||||
void
|
||||
setLoopback(bool state);
|
||||
|
||||
void
|
||||
resetFrameCounters();
|
||||
|
||||
};
|
||||
|
||||
} // namespace ip
|
||||
|
|
|
@ -98,6 +98,27 @@ void Aurora::dump()
|
|||
logger->info("Aurora frames sent: {}", outCnt);
|
||||
}
|
||||
|
||||
void Aurora::setLoopback(bool state)
|
||||
{
|
||||
auto cr = readMemory<uint32_t>(registerMemory, AURORA_AXIS_CR_OFFSET);
|
||||
|
||||
if (state)
|
||||
cr |= AURORA_AXIS_CR_LOOPBACK;
|
||||
else
|
||||
cr &= ~AURORA_AXIS_CR_LOOPBACK;
|
||||
|
||||
writeMemory<uint32_t>(registerMemory, AURORA_AXIS_CR_OFFSET, cr);
|
||||
}
|
||||
|
||||
void Aurora::resetFrameCounters()
|
||||
{
|
||||
auto cr = readMemory<uint32_t>(registerMemory, AURORA_AXIS_CR_OFFSET);
|
||||
|
||||
cr |= AURORA_AXIS_CR_RST_CTRS;
|
||||
|
||||
writeMemory<uint32_t>(registerMemory, AURORA_AXIS_CR_OFFSET, cr);
|
||||
}
|
||||
|
||||
AuroraFactory::AuroraFactory() :
|
||||
IpNodeFactory(getName())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue