43 #include "debug/RVCTRL.hh" 72 pkt->
setLE((uint32_t)(clk));
77 pkt->
setLE((uint32_t)(clk100));
80 pkt->
setLE<uint32_t>(0);
83 pkt->
setLE<uint32_t>(0x00001F00);
86 pkt->
setLE<uint32_t>(0x00012C5C);
89 pkt->
setLE<uint32_t>(0x00002CC0);
92 pkt->
setLE<uint32_t>(0x00002C75);
95 pkt->
setLE<uint32_t>(0x00020211);
98 pkt->
setLE<uint32_t>(0x00002C75);
110 pkt->
setLE<uint32_t>(1);
117 pkt->
setLE<uint32_t>(0);
118 DPRINTF(RVCTRL,
"Read 0 from CfgCtrl\n");
121 warn(
"Tried to read RealView I/O at offset %#x that doesn't exist\n",
123 pkt->
setLE<uint32_t>(0);
151 warn_once(
"Ignoring write to reset control\n");
166 CfgCtrlReg req = pkt->
getLE<uint32_t>();
168 DPRINTF(RVCTRL,
"SCReg: write %#x to ctrl but not starting\n",
173 auto it_dev(
devices.find(req & CFG_CTRL_ADDR_MASK));
175 warn_once(
"SCReg: Access to unknown device " 176 "dcc%d:site%d:pos%d:fn%d:dev%d\n",
177 req.dcc, req.site, req.pos, req.func, req.dev);
185 DPRINTF(RVCTRL,
"SCReg: Writing %#x (ctrlWr %#x)\n",
191 DPRINTF(RVCTRL,
"SCReg: Reading %#x (ctrlRd %#x)\n",
197 warn(
"Tried to write RVIO at offset %#x (data %#x) that doesn't exist\n",
198 daddr, pkt->
getLE<uint32_t>());
219 uint8_t
dcc, uint16_t
dev,
230 fatal(
"Platform device dcc%d:site%d:pos%d:fn%d:dev%d " 231 "already registered.",
232 addr.dcc, addr.site, addr.pos, addr.func, addr.dev);
242 p->
site, p->position, p->
dcc, p->device)
245 fatal(
"Oscillator frequency out of range: %f\n",
257 m->updateClockPeriod();
275 panic_if(clock_period == 0,
"%s has a clock period of zero\n",
name());
279 m->updateClockPeriod();
285 m->updateClockPeriod();
292 DPRINTF(RVCTRL,
"Reading OSC frequency: %f MHz\n", freq / 1E6);
299 DPRINTF(RVCTRL,
"Setting new OSC frequency: %f MHz\n", freq / 1E6);
311 warn(
"Temperature below zero!\n");
312 return fmax(0, t) * 1000000;
320 RealViewCtrlParams::create()
326 RealViewOscParams::create()
332 RealViewTemperatureSensorParams::create()
#define fatal(...)
This implements a cprintf based fatal() function.
void serialize(CheckpointOut &cp) const override
Serialize an object.
This device implements the temperature sensor used in the RealView/Versatile Express platform...
Tick write(PacketPtr pkt) override
All writes are simply ignored.
uint32_t flags
This register is used for smp booting.
uint32_t read() const override
This is an implementation of a programmable oscillator on the that can be configured through the Real...
double s
These variables equal the number of ticks in the unit of time they're named after in a double...
std::map< uint32_t, Device * > devices
void startup() override
startup() is the final initialization call before simulation.
void setLE(T v)
Set the value in the data pointer to v as little endian.
Tick read(PacketPtr pkt) override
Handle a read to the device.
This implements the simple real view registers on a PBXA9.
#define UNSERIALIZE_SCALAR(scalar)
Tick curTick()
The current simulated tick.
Addr pioSize
Size that the device's address range.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void registerDevice(DeviceFunc func, uint8_t site, uint8_t pos, uint8_t dcc, uint16_t dev, Device *handler)
const Params * params() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual const std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void write(uint32_t freq) override
RealViewCtrlParams Params
#define SERIALIZE_SCALAR(scalar)
virtual void write(uint32_t value)=0
void unserialize(CheckpointIn &cp) override
Unserialize an object.
std::vector< DerivedClockDomain * > children
Pointers to potential derived clock domains so we can propagate changes.
virtual uint32_t read() const =0
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
std::vector< Clocked * > members
Pointers to members of this clock domain, so that when the clock period changes, we can update each m...
Declaration of the Packet class.
std::ostream CheckpointOut
RealViewOsc(RealViewOscParams *p)
uint32_t read() const override
Tick pioDelay
Delay that the device experinces on an access.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Tick _clockPeriod
Pre-computed clock period in ticks.
uint32_t scData
This register contains the result from a system control reg access.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Addr pioAddr
Address that the device listens to.
RealViewCtrl(Params *p)
The constructor for RealView just registers itself with the MMU.
Tick clockPeriod() const
Get the clock period.