mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
emulation: update trng peripherals
The register mapping for the TRNG has changed. Update these peripherals to reflect the latest shuffle. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
4864d6bae7
commit
4b619bb0a9
2 changed files with 10 additions and 11 deletions
|
|
@ -23,10 +23,9 @@ namespace Antmicro.Renode.Peripherals.Miscellaneous
|
|||
private void DefineRegisters()
|
||||
{
|
||||
Registers.STATUS.Define(this) // RDY is set on reset
|
||||
.WithValueField(0, 32, FieldMode.Read, valueProviderCallback: _ =>
|
||||
{
|
||||
return 3;
|
||||
}, name: "STATUS");
|
||||
.WithFlag(0, name: "ready", valueProviderCallback: _ => true)
|
||||
.WithFlag(1, name: "avail", valueProviderCallback: _ => true)
|
||||
;
|
||||
|
||||
Registers.DATA.Define(this)
|
||||
.WithValueField(0, 32, FieldMode.Read, valueProviderCallback: _ =>
|
||||
|
|
@ -40,7 +39,7 @@ namespace Antmicro.Renode.Peripherals.Miscellaneous
|
|||
return (uint)rng.Next();
|
||||
}, name: "URANDOM");
|
||||
Registers.URANDOM_VALID.Define(this)
|
||||
.WithFlag(0, FieldMode.Read, valueProviderCallback: _ => { return true; }, name: "URANDOM_VALID");
|
||||
.WithFlag(0, FieldMode.Read, valueProviderCallback: _ => true, name: "URANDOM_VALID");
|
||||
}
|
||||
|
||||
private readonly PseudorandomNumberGenerator rng = EmulationManager.Instance.CurrentEmulation.RandomGenerator;
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ namespace Antmicro.Renode.Peripherals.Miscellaneous
|
|||
AV_CONFIG = 0xc,
|
||||
RO_CONFIG = 0x10,
|
||||
|
||||
READY = 0xd8,
|
||||
EV_STATUS = 0xdc,
|
||||
EV_PENDING = 0xe0,
|
||||
EV_ENABLE = 0xe4,
|
||||
URANDOM = 0xf0,
|
||||
URANDOM_VALID = 0xf4,
|
||||
READY = 0xc4,
|
||||
EV_STATUS = 0xc8,
|
||||
EV_PENDING = 0xcc,
|
||||
EV_ENABLE = 0xd0,
|
||||
URANDOM = 0xdc,
|
||||
URANDOM_VALID = 0xe0,
|
||||
TEST = 0xf8,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue