Go to the documentation of this file.
41 #include "debug/RVCTRL.hh"
70 pkt->
setLE((uint32_t)(clk));
75 pkt->
setLE((uint32_t)(clk100));
78 pkt->
setLE<uint32_t>(0);
81 pkt->
setLE<uint32_t>(0x00001F00);
84 pkt->
setLE<uint32_t>(0x00012C5C);
87 pkt->
setLE<uint32_t>(0x00002CC0);
90 pkt->
setLE<uint32_t>(0x00002C75);
93 pkt->
setLE<uint32_t>(0x00020211);
96 pkt->
setLE<uint32_t>(0x00002C75);
108 pkt->
setLE<uint32_t>(1);
115 pkt->
setLE<uint32_t>(0);
116 DPRINTF(RVCTRL,
"Read 0 from CfgCtrl\n");
119 warn(
"Tried to read RealView I/O at offset %#x that doesn't exist\n",
121 pkt->
setLE<uint32_t>(0);
149 warn_once(
"Ignoring write to reset control\n");
164 CfgCtrlReg req = pkt->
getLE<uint32_t>();
166 DPRINTF(RVCTRL,
"SCReg: write %#x to ctrl but not starting\n",
171 auto it_dev(
devices.find(req & CFG_CTRL_ADDR_MASK));
173 warn_once(
"SCReg: Access to unknown device "
174 "dcc%d:site%d:pos%d:fn%d:dev%d\n",
175 req.dcc, req.site, req.pos, req.func, req.dev);
183 DPRINTF(RVCTRL,
"SCReg: Writing %#x (ctrlWr %#x)\n",
189 DPRINTF(RVCTRL,
"SCReg: Reading %#x (ctrlRd %#x)\n",
195 warn(
"Tried to write RVIO at offset %#x (data %#x) that doesn't exist\n",
196 daddr, pkt->
getLE<uint32_t>());
217 uint8_t dcc, uint16_t dev,
228 fatal(
"Platform device dcc%d:site%d:pos%d:fn%d:dev%d "
229 "already registered.",
240 p->site,
p->position,
p->dcc,
p->device)
243 fatal(
"Oscillator frequency out of range: %f\n",
255 m->updateClockPeriod();
273 panic_if(clock_period == 0,
"%s has a clock period of zero\n",
name());
277 m->updateClockPeriod();
283 m->updateClockPeriod();
290 DPRINTF(RVCTRL,
"Reading OSC frequency: %f MHz\n", freq / 1E6);
297 DPRINTF(RVCTRL,
"Setting new OSC frequency: %f MHz\n", freq / 1E6);
309 warn(
"Temperature below zero!\n");
310 return fmax(0,
t) * 1000000;
318 RealViewCtrlParams::create()
324 RealViewOscParams::create()
330 RealViewTemperatureSensorParams::create()
#define fatal(...)
This implements a cprintf based fatal() function.
void registerDevice(DeviceFunc func, uint8_t site, uint8_t pos, uint8_t dcc, uint16_t dev, Device *handler)
void makeAtomicResponse()
This device implements the temperature sensor used in the RealView/Versatile Express platform.
double s
These variables equal the number of ticks in the unit of time they're named after in a double.
Addr pioAddr
Address that the device listens to.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define UNSERIALIZE_SCALAR(scalar)
RealViewCtrl(Params *p)
The constructor for RealView just registers itself with the MMU.
const Params * params() const
RealViewCtrlParams Params
uint64_t Tick
Tick count type.
uint32_t read() const override
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain.
uint32_t flags
This register is used for smp booting.
void startup() override
startup() is the final initialization call before simulation.
std::vector< Clocked * > members
Pointers to members of this clock domain, so that when the clock period changes, we can update each m...
uint32_t scData
This register contains the result from a system control reg access.
Tick read(PacketPtr pkt) override
Handle a read to the device.
Addr pioSize
Size that the device's address range.
ThermalModel * getThermalModel() const
The thermal model used for this system (if any).
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
RealViewOsc(RealViewOscParams *p)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
#define SERIALIZE_SCALAR(scalar)
Tick write(PacketPtr pkt) override
All writes are simply ignored.
void write(uint32_t freq) override
virtual const std::string name() const
System * system
The system this RV device belongs to.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
std::vector< DerivedClockDomain * > children
Pointers to potential derived clock domains so we can propagate changes.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::map< uint32_t, Device * > devices
Tick pioDelay
Delay that the device experinces on an access.
void setLE(T v)
Set the value in the data pointer to v as little endian.
std::ostream CheckpointOut
This is an implementation of a programmable oscillator on the that can be configured through the Real...
uint32_t read() const override
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick clockPeriod() const
Get the clock period.
Tick _clockPeriod
Pre-computed clock period in ticks.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:10 for gem5 by doxygen 1.8.17