43 #include "debug/RVCTRL.hh"
72 pkt->
set((uint32_t)(clk));
77 pkt->
set((uint32_t)(clk100));
80 pkt->
set<uint32_t>(0);
83 pkt->
set<uint32_t>(0x00001F00);
86 pkt->
set<uint32_t>(0x00012C5C);
89 pkt->
set<uint32_t>(0x00002CC0);
92 pkt->
set<uint32_t>(0x00002C75);
95 pkt->
set<uint32_t>(0x00020211);
98 pkt->
set<uint32_t>(0x00002C75);
110 pkt->
set<uint32_t>(1);
117 pkt->
set<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->
set<uint32_t>(0);
162 CfgCtrlReg req = pkt->
get<uint32_t>();
164 DPRINTF(RVCTRL,
"SCReg: write %#x to ctrl but not starting\n",
169 auto it_dev(
devices.find(req & CFG_CTRL_ADDR_MASK));
171 warn_once(
"SCReg: Access to unknown device "
172 "dcc%d:site%d:pos%d:fn%d:dev%d\n",
173 req.dcc, req.site, req.pos, req.func, req.dev);
181 DPRINTF(RVCTRL,
"SCReg: Writing %#x (ctrlWr %#x)\n",
187 DPRINTF(RVCTRL,
"SCReg: Reading %#x (ctrlRd %#x)\n",
193 warn(
"Tried to write RVIO at offset %#x (data %#x) that doesn't exist\n",
194 daddr, pkt->
get<uint32_t>());
215 uint8_t dcc, uint16_t dev,
226 fatal(
"Platform device dcc%d:site%d:pos%d:fn%d:dev%d "
227 "already registered.",
228 addr.dcc, addr.site, addr.pos, addr.func, addr.dev);
238 p->site, p->position, p->dcc, p->device)
241 fatal(
"Oscillator frequency out of range: %f\n",
253 m->updateClockPeriod();
271 panic_if(clock_period == 0,
"%s has a clock period of zero\n",
name());
275 m->updateClockPeriod();
281 m->updateClockPeriod();
288 DPRINTF(RVCTRL,
"Reading OSC frequency: %f MHz\n", freq / 1E6);
295 DPRINTF(RVCTRL,
"Setting new OSC frequency: %f MHz\n", freq / 1E6);
307 warn(
"Temperature below zero!\n");
308 return fmax(0, t) * 1000000;
316 RealViewCtrlParams::create()
322 RealViewOscParams::create()
328 RealViewTemperatureSensorParams::create()
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
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.
panic_if(!root,"Invalid expression\n")
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.
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
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.
const Params * params() const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
System * system
The system this RV device belongs to.
void registerDevice(DeviceFunc func, uint8_t site, uint8_t pos, uint8_t dcc, uint16_t dev, Device *handler)
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.
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
ThermalModel * getThermalModel() const
The thermal model used for this system (if any).
void unserialize(CheckpointIn &cp) override
Unserialize an object.
virtual const std::string name() const
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.
Tick _clockPeriod
Pre-computed clock period in ticks.
uint32_t scData
This register contains the result from a system control reg access.
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.
A ThermalModel is the element which ties all thermal objects together and provides the thermal solver...