rv_ctrl.cc (11011:2ca6c68fdd6c) rv_ctrl.cc (11421:74c1e6513bd0)
1/*
2 * Copyright (c) 2010,2013,2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 23 unchanged lines hidden (view full) ---

32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * Authors: Ali Saidi
38 */
39
1/*
2 * Copyright (c) 2010,2013,2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 23 unchanged lines hidden (view full) ---

32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * Authors: Ali Saidi
38 */
39
40#include "dev/arm/rv_ctrl.hh"
41
40#include "base/trace.hh"
41#include "debug/RVCTRL.hh"
42#include "base/trace.hh"
43#include "debug/RVCTRL.hh"
42#include "dev/arm/rv_ctrl.hh"
43#include "mem/packet.hh"
44#include "mem/packet_access.hh"
44#include "mem/packet.hh"
45#include "mem/packet_access.hh"
46#include "sim/power/thermal_model.hh"
47#include "sim/system.hh"
45#include "sim/voltage_domain.hh"
46
47RealViewCtrl::RealViewCtrl(Params *p)
48 : BasicPioDevice(p, 0xD4), flags(0), scData(0)
49{
50}
51
52Tick

--- 235 unchanged lines hidden (view full) ---

288
289void
290RealViewOsc::write(uint32_t freq)
291{
292 DPRINTF(RVCTRL, "Setting new OSC frequency: %f MHz\n", freq / 1E6);
293 clockPeriod(SimClock::Float::s / freq);
294}
295
48#include "sim/voltage_domain.hh"
49
50RealViewCtrl::RealViewCtrl(Params *p)
51 : BasicPioDevice(p, 0xD4), flags(0), scData(0)
52{
53}
54
55Tick

--- 235 unchanged lines hidden (view full) ---

291
292void
293RealViewOsc::write(uint32_t freq)
294{
295 DPRINTF(RVCTRL, "Setting new OSC frequency: %f MHz\n", freq / 1E6);
296 clockPeriod(SimClock::Float::s / freq);
297}
298
299uint32_t
300RealViewTemperatureSensor::read() const
301{
302 // Temperature reported in uC
303 ThermalModel * tm = system->getThermalModel();
304 if (tm) {
305 double t = tm->getTemp();
306 if (t < 0)
307 warn("Temperature below zero!\n");
308 return fmax(0, t) * 1000000;
309 }
296
310
311 // Report a dummy 25 degrees temperature
312 return 25000000;
313}
297
298RealViewCtrl *
299RealViewCtrlParams::create()
300{
301 return new RealViewCtrl(this);
302}
303
304RealViewOsc *
305RealViewOscParams::create()
306{
307 return new RealViewOsc(this);
308}
314
315RealViewCtrl *
316RealViewCtrlParams::create()
317{
318 return new RealViewCtrl(this);
319}
320
321RealViewOsc *
322RealViewOscParams::create()
323{
324 return new RealViewOsc(this);
325}
326
327RealViewTemperatureSensor *
328RealViewTemperatureSensorParams::create()
329{
330 return new RealViewTemperatureSensor(this);
331}