Line 19... |
Line 19... |
static const uint32_t FSE2_STATE_WAIT_MS = (1 << 17);
|
static const uint32_t FSE2_STATE_WAIT_MS = (1 << 17);
|
static const uint32_t FSE2_STATE_IDLE = (1 << 16);
|
static const uint32_t FSE2_STATE_IDLE = (1 << 16);
|
|
|
FseV2::FseV2(const char *name) : IService(name) {
|
FseV2::FseV2(const char *name) : IService(name) {
|
registerInterface(static_cast<IMemoryOperation *>(this));
|
registerInterface(static_cast<IMemoryOperation *>(this));
|
registerAttribute("BaseAddress", &baseAddress_);
|
|
registerAttribute("Length", &length_);
|
|
|
|
baseAddress_.make_uint64(0);
|
|
length_.make_uint64(0);
|
|
|
|
memset(®s_, 0, sizeof(regs_));
|
memset(®s_, 0, sizeof(regs_));
|
regs_.hw_id = (16 << 16) | 5; // 16 msec accum, 5=id
|
regs_.hw_id = (16 << 16) | 5; // 16 msec accum, 5=id
|
for (int i = 0; i < FSE2_CHAN_MAX; i++) {
|
for (int i = 0; i < FSE2_CHAN_MAX; i++) {
|
regs_.chan[i].dopler = 1000 << 4;
|
regs_.chan[i].dopler = 1000 << 4;
|
Line 37... |
Line 32... |
// Check float comparision with threshold (=2.1*noise):
|
// Check float comparision with threshold (=2.1*noise):
|
regs_.chan[14].max = static_cast<uint32_t>(1872.0 * 2.11);
|
regs_.chan[14].max = static_cast<uint32_t>(1872.0 * 2.11);
|
regs_.chan[15].max = static_cast<uint32_t>(1872.0 * 2.09);
|
regs_.chan[15].max = static_cast<uint32_t>(1872.0 * 2.09);
|
}
|
}
|
|
|
void FseV2::b_transport(Axi4TransactionType *trans) {
|
ETransStatus FseV2::b_transport(Axi4TransactionType *trans) {
|
uint64_t mask = (length_.to_uint64() - 1);
|
uint64_t mask = (length_.to_uint64() - 1);
|
uint64_t off = ((trans->addr - getBaseAddress()) & mask);
|
uint64_t off = ((trans->addr - getBaseAddress()) & mask);
|
trans->response = MemResp_Valid;
|
trans->response = MemResp_Valid;
|
if (trans->action == MemAction_Write) {
|
if (trans->action == MemAction_Write) {
|
memcpy(&reinterpret_cast<uint8_t *>(®s_)[off], trans->wpayload.b8,
|
memcpy(&reinterpret_cast<uint8_t *>(®s_)[off], trans->wpayload.b8,
|
trans->xsize);
|
trans->xsize);
|
} else {
|
} else {
|
memcpy(trans->rpayload.b8, &reinterpret_cast<uint8_t *>(®s_)[off],
|
memcpy(trans->rpayload.b8, &reinterpret_cast<uint8_t *>(®s_)[off],
|
trans->xsize);
|
trans->xsize);
|
}
|
}
|
|
return TRANS_OK;
|
}
|
}
|
|
|
} // namespace debugger
|
} // namespace debugger
|
|
|
No newline at end of file
|
No newline at end of file
|