mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
emulation: timer0: adapt timer0 to custom precursor
Precursor has a custom TIMER0 module that is different from other LiteX timers. Adapt the Renode model to match the hardware. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
8875d9b4b4
commit
d645f00d5b
1 changed files with 3 additions and 25 deletions
|
|
@ -90,25 +90,6 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
|
|
||||||
Registers.TimerUpdateValue.Define32(this)
|
|
||||||
.WithFlag(0, FieldMode.WriteOneToClear, name: "UPDATE_VALUE", writeCallback: (_, val) =>
|
|
||||||
{
|
|
||||||
if(val)
|
|
||||||
{
|
|
||||||
latchedValue = (uint)innerTimer.Value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
;
|
|
||||||
|
|
||||||
// VALUE0 contains most significant 8 bits
|
|
||||||
// VALUE3 contains least significant 8 bits
|
|
||||||
Registers.Value.Define32(this)
|
|
||||||
.WithValueField(0, 32, FieldMode.Read, name: "VALUE", valueProviderCallback: _ =>
|
|
||||||
{
|
|
||||||
return latchedValue;
|
|
||||||
});
|
|
||||||
;
|
|
||||||
|
|
||||||
Registers.EventStatus.Define32(this)
|
Registers.EventStatus.Define32(this)
|
||||||
.WithFlag(0, FieldMode.Read, name: "EV_STATUS", valueProviderCallback: _ => innerTimer.Value == 0)
|
.WithFlag(0, FieldMode.Read, name: "EV_STATUS", valueProviderCallback: _ => innerTimer.Value == 0)
|
||||||
;
|
;
|
||||||
|
|
@ -144,13 +125,10 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted
|
||||||
Reload = 0x04,
|
Reload = 0x04,
|
||||||
|
|
||||||
TimerEnable = 0x08,
|
TimerEnable = 0x08,
|
||||||
TimerUpdateValue = 0x0C,
|
|
||||||
|
|
||||||
Value = 0x10,
|
EventStatus = 0x0c,
|
||||||
|
EventPending = 0x10,
|
||||||
EventStatus = 0x14,
|
EventEnable = 0x14
|
||||||
EventPending = 0x18,
|
|
||||||
EventEnable = 0x1C
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue