33#include "debug/LupioRNG.hh"
35#include "params/LupioRNG.hh"
38#define LUPIO_RNG_IRQE 0x1
40#define LUPIO_RNG_BUSY 0x1
47 user_seed(params.seed)
57 std::uniform_int_distribution<uint32_t> distrib(0);
77 panic(
"Unexpected read to the LupioRTC device at address %d!",
100 panic(
"Unexpected write to the LupioRTC device at address %d!",
112 "Read request - addr: %#x, size: %#x\n", rng_addr, pkt->
getSize());
Addr pioAddr
Address that the device listens to.
Tick pioDelay
Delay that the device experinces on an access.
LupioRNG: A Random Number Generator virtual device that returns either a random value,...
const ByteOrder byteOrder
uint64_t lupioRNGRead(const uint8_t addr)
Function to return a random number, the current seed, or the device status.
Tick read(PacketPtr pkt) override
Implement BasicPioDevice virtual functions.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
LupioRNG(const Params ¶ms)
void lupioRNGWrite(const uint8_t addr, const uint64_t val64)
Function to allow the user to change the current seed, and configure the device using interrupts.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.