2004-01-22 02:14:10 +01:00
|
|
|
/*
|
2005-06-05 11:16:00 +02:00
|
|
|
* Copyright (c) 2004-2005 The Regents of The University of Michigan
|
2004-01-22 02:14:10 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met: redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer;
|
|
|
|
* redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution;
|
|
|
|
* neither the name of the copyright holders nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2005-06-05 05:56:53 +02:00
|
|
|
/** @file
|
|
|
|
* Tsunami I/O Space mapping including RTC/timer interrupts
|
2004-01-22 02:14:10 +01:00
|
|
|
*/
|
|
|
|
|
2005-02-21 23:32:57 +01:00
|
|
|
#ifndef __DEV_TSUNAMI_IO_HH__
|
|
|
|
#define __DEV_TSUNAMI_IO_HH__
|
2004-01-22 02:14:10 +01:00
|
|
|
|
2004-06-10 19:30:58 +02:00
|
|
|
#include "dev/io_device.hh"
|
|
|
|
#include "base/range.hh"
|
2004-01-22 02:14:10 +01:00
|
|
|
#include "dev/tsunami.hh"
|
2004-06-27 03:26:28 +02:00
|
|
|
#include "sim/eventq.hh"
|
2004-01-22 02:14:10 +01:00
|
|
|
|
2005-06-05 05:56:53 +02:00
|
|
|
/**
|
2004-05-30 23:45:46 +02:00
|
|
|
* Tsunami I/O device is a catch all for all the south bridge stuff we care
|
|
|
|
* to implement.
|
2004-01-22 02:14:10 +01:00
|
|
|
*/
|
2004-06-10 19:30:58 +02:00
|
|
|
class TsunamiIO : public PioDevice
|
2004-01-22 02:14:10 +01:00
|
|
|
{
|
2004-01-26 19:26:34 +01:00
|
|
|
private:
|
2004-05-30 23:45:46 +02:00
|
|
|
/** The base address of this device */
|
2004-02-10 06:19:43 +01:00
|
|
|
Addr addr;
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/** The size of mappad from the above address */
|
2004-02-10 06:19:43 +01:00
|
|
|
static const Addr size = 0xff;
|
|
|
|
|
2004-01-26 19:26:34 +01:00
|
|
|
struct tm tm;
|
|
|
|
|
2004-01-22 02:14:10 +01:00
|
|
|
protected:
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Real-Time Clock (MC146818) */
|
2005-08-23 17:45:52 +02:00
|
|
|
class RTC
|
2004-01-23 01:02:07 +01:00
|
|
|
{
|
2005-08-23 17:45:52 +02:00
|
|
|
private:
|
|
|
|
/** Event for RTC periodic interrupt */
|
|
|
|
struct RTCEvent : public Event
|
|
|
|
{
|
|
|
|
/** A pointer back to tsunami to create interrupt the processor. */
|
|
|
|
Tsunami* tsunami;
|
|
|
|
Tick interval;
|
|
|
|
|
|
|
|
RTCEvent(Tsunami* t, Tick i);
|
|
|
|
|
|
|
|
/** Schedule the RTC periodic interrupt */
|
|
|
|
void scheduleIntr();
|
|
|
|
|
|
|
|
/** Event process to occur at interrupt*/
|
|
|
|
virtual void process();
|
|
|
|
|
|
|
|
/** Event description */
|
|
|
|
virtual const char *description();
|
|
|
|
};
|
2005-08-15 22:59:58 +02:00
|
|
|
|
|
|
|
private:
|
2005-08-23 17:45:52 +02:00
|
|
|
std::string _name;
|
|
|
|
const std::string &name() const { return _name; }
|
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** RTC periodic interrupt event */
|
|
|
|
RTCEvent event;
|
|
|
|
|
|
|
|
/** Current RTC register address/index */
|
|
|
|
int addr;
|
|
|
|
|
|
|
|
/** Data for real-time clock function */
|
|
|
|
union {
|
|
|
|
uint8_t clock_data[10];
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint8_t sec;
|
|
|
|
uint8_t sec_alrm;
|
|
|
|
uint8_t min;
|
|
|
|
uint8_t min_alrm;
|
|
|
|
uint8_t hour;
|
|
|
|
uint8_t hour_alrm;
|
|
|
|
uint8_t wday;
|
|
|
|
uint8_t mday;
|
|
|
|
uint8_t mon;
|
|
|
|
uint8_t year;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/** RTC status register A */
|
|
|
|
uint8_t stat_regA;
|
|
|
|
|
|
|
|
/** RTC status register B */
|
|
|
|
uint8_t stat_regB;
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2004-02-06 00:23:16 +01:00
|
|
|
public:
|
2005-08-23 17:45:52 +02:00
|
|
|
RTC(const std::string &name, Tsunami* t, Tick i);
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Set the initial RTC time/date */
|
|
|
|
void set_time(time_t t);
|
2004-05-30 23:45:46 +02:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** RTC address port: write address of RTC RAM data to access */
|
|
|
|
void writeAddr(const uint8_t *data);
|
2004-05-30 23:45:46 +02:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** RTC write data */
|
|
|
|
void writeData(const uint8_t *data);
|
2004-05-30 23:45:46 +02:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** RTC read data */
|
|
|
|
void readData(uint8_t *data);
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2004-06-17 00:20:10 +02:00
|
|
|
/**
|
2005-08-15 22:59:58 +02:00
|
|
|
* Serialize this object to the given output stream.
|
|
|
|
* @param os The stream to serialize to.
|
|
|
|
*/
|
2005-08-23 17:45:52 +02:00
|
|
|
void serialize(const std::string &base, std::ostream &os);
|
2004-06-17 00:20:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reconstruct the state of this object from a checkpoint.
|
|
|
|
* @param cp The checkpoint use.
|
|
|
|
* @param section The section name of this object
|
|
|
|
*/
|
2005-08-23 17:45:52 +02:00
|
|
|
void unserialize(const std::string &base, Checkpoint *cp,
|
|
|
|
const std::string §ion);
|
2005-08-15 22:59:58 +02:00
|
|
|
};
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Programmable Interval Timer (Intel 8254) */
|
2005-08-23 17:45:52 +02:00
|
|
|
class PITimer
|
2004-01-23 19:01:32 +01:00
|
|
|
{
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Counter element for PIT */
|
2005-08-23 17:45:52 +02:00
|
|
|
class Counter
|
2005-08-15 22:59:58 +02:00
|
|
|
{
|
|
|
|
/** Event for counter interrupt */
|
|
|
|
class CounterEvent : public Event
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
/** Pointer back to Counter */
|
|
|
|
Counter* counter;
|
|
|
|
Tick interval;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CounterEvent(Counter*);
|
|
|
|
|
|
|
|
/** Event process */
|
|
|
|
virtual void process();
|
|
|
|
|
|
|
|
/** Event description */
|
|
|
|
virtual const char *description();
|
|
|
|
|
|
|
|
friend class Counter;
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2005-08-23 17:45:52 +02:00
|
|
|
std::string _name;
|
|
|
|
const std::string &name() const { return _name; }
|
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
CounterEvent event;
|
|
|
|
|
|
|
|
/** Current count value */
|
|
|
|
uint16_t count;
|
|
|
|
|
|
|
|
/** Latched count */
|
|
|
|
uint16_t latched_count;
|
|
|
|
|
|
|
|
/** Interrupt period */
|
|
|
|
uint16_t period;
|
|
|
|
|
|
|
|
/** Current mode of operation */
|
|
|
|
uint8_t mode;
|
|
|
|
|
|
|
|
/** Output goes high when the counter reaches zero */
|
|
|
|
bool output_high;
|
|
|
|
|
|
|
|
/** State of the count latch */
|
|
|
|
bool latch_on;
|
|
|
|
|
|
|
|
/** Set of values for read_byte and write_byte */
|
|
|
|
enum {LSB, MSB};
|
|
|
|
|
|
|
|
/** Determine which byte of a 16-bit count value to read/write */
|
|
|
|
uint8_t read_byte, write_byte;
|
|
|
|
|
|
|
|
public:
|
2005-08-23 17:45:52 +02:00
|
|
|
Counter(const std::string &name);
|
2005-08-15 22:59:58 +02:00
|
|
|
|
|
|
|
/** Latch the current count (if one is not already latched) */
|
|
|
|
void latchCount();
|
|
|
|
|
|
|
|
/** Set the read/write mode */
|
|
|
|
void setRW(int rw_val);
|
|
|
|
|
|
|
|
/** Set operational mode */
|
|
|
|
void setMode(int mode_val);
|
|
|
|
|
|
|
|
/** Set count encoding */
|
|
|
|
void setBCD(int bcd_val);
|
|
|
|
|
|
|
|
/** Read a count byte */
|
|
|
|
void read(uint8_t *data);
|
|
|
|
|
|
|
|
/** Write a count byte */
|
|
|
|
void write(const uint8_t *data);
|
|
|
|
|
|
|
|
/** Is the output high? */
|
|
|
|
bool outputHigh();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serialize this object to the given output stream.
|
|
|
|
* @param os The stream to serialize to.
|
|
|
|
*/
|
2005-08-23 17:45:52 +02:00
|
|
|
void serialize(const std::string &base, std::ostream &os);
|
2005-08-15 22:59:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reconstruct the state of this object from a checkpoint.
|
|
|
|
* @param cp The checkpoint use.
|
|
|
|
* @param section The section name of this object
|
|
|
|
*/
|
2005-08-23 17:45:52 +02:00
|
|
|
void unserialize(const std::string &base, Checkpoint *cp,
|
|
|
|
const std::string §ion);
|
2005-08-15 22:59:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2005-08-23 17:45:52 +02:00
|
|
|
std::string _name;
|
|
|
|
const std::string &name() const { return _name; }
|
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** PIT has three seperate counters */
|
2005-08-23 17:45:52 +02:00
|
|
|
Counter *counter[3];
|
Make the notion of a global event tick independent of the actual
CPU cycle ticks. This allows the user to have CPUs of different
frequencies, and also allows frequencies and latencies that are
not evenly divisible by the CPU frequency. For now, the CPU
frequency is still set to the global frequency, but soon, we'll
hopefully make the global frequency fixed at something like 1THz
and set all other frequencies independently.
arch/alpha/ev5.cc:
The cycles counter is based on the current cpu cycle.
cpu/base_cpu.cc:
frequency isn't the cpu parameter anymore, cycleTime is.
cpu/base_cpu.hh:
frequency isn't the cpu parameter anymore, cycleTime is.
create several public functions for getting the cpu frequency
and the numbers of ticks for a given number of cycles, etc.
cpu/memtest/memtest.cc:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
cpu/trace/trace_cpu.cc:
Now that ticks aren't cpu cycles, fixup code to advance
by the proper number of ticks.
cpu/memtest/memtest.hh:
cpu/trace/trace_cpu.hh:
Provide a function to get the number of ticks for a given
number of cycles.
dev/alpha_console.cc:
Update for changes in the way that frequencies and latencies are
accessed. Move some stuff to init()
dev/alpha_console.hh:
Need a pointer to the system and the cpu to get the frequency
so we can pass the info to the console code.
dev/etherbus.cc:
dev/etherbus.hh:
dev/etherlink.cc:
dev/etherlink.hh:
dev/ethertap.cc:
dev/ide_disk.hh:
dev/ns_gige.cc:
dev/ns_gige.hh:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
dev/ide_disk.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
Add some extra debugging printfs
dev/platform.cc:
dev/sinic.cc:
dev/sinic.hh:
outline the constructor and destructor
dev/platform.hh:
outline the constructor and destructor.
don't keep track of the interrupt frequency. Only provide the
accessor function.
dev/tsunami.cc:
dev/tsunami.hh:
outline the constructor and destructor
Don't set the interrupt frequency here. Get it from the actual device
that does the interrupting.
dev/tsunami_io.cc:
dev/tsunami_io.hh:
Make the interrupt interval a configuration parameter. (And convert
the interval to the new latency/frequency stuff in the python)
kern/linux/linux_system.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
kern/tru64/tru64_system.cc:
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
python/m5/config.py:
Fix support for cycle_time relative latencies and frequencies.
Add support for getting a NetworkBandwidth or a MemoryBandwidth.
python/m5/objects/BaseCPU.mpy:
All CPUs now have a cycle_time. The default is the global frequency,
but it is now possible to set the global frequency to some large value
(like 1THz) and set each CPU frequency independently.
python/m5/objects/BaseCache.mpy:
python/m5/objects/Ide.mpy:
Make this a Latency parameter
python/m5/objects/BaseSystem.mpy:
We need to pass the boot CPU's frequency to the system
python/m5/objects/Ethernet.mpy:
Update parameter types to use latency and bandwidth types
python/m5/objects/Platform.mpy:
this frequency isn't needed. We get it from the clock interrupt.
python/m5/objects/Tsunami.mpy:
The clock generator should hold the frequency
sim/eventq.hh:
Need to remove this assertion because the writeback event
queue is different from the CPU's event queue which can cause
this assertion to fail.
sim/process.cc:
Fix comment.
sim/system.hh:
Struct member to hold the boot CPU's frequency.
sim/universe.cc:
remove unneeded variable.
--HG--
extra : convert_revision : 51efe4041095234bf458d9b3b0d417f4cae16fdc
2005-04-11 21:32:06 +02:00
|
|
|
|
2004-01-23 19:01:32 +01:00
|
|
|
public:
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Public way to access individual counters (avoid array accesses) */
|
2005-08-23 17:45:52 +02:00
|
|
|
Counter counter0;
|
|
|
|
Counter counter1;
|
|
|
|
Counter counter2;
|
2005-02-21 23:32:57 +01:00
|
|
|
|
2005-08-23 17:45:52 +02:00
|
|
|
PITimer(const std::string &name);
|
2005-02-21 23:32:57 +01:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Write control word */
|
|
|
|
void writeControl(const uint8_t* data);
|
2005-02-21 23:32:57 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Serialize this object to the given output stream.
|
|
|
|
* @param os The stream to serialize to.
|
|
|
|
*/
|
2005-08-23 17:45:52 +02:00
|
|
|
void serialize(const std::string &base, std::ostream &os);
|
2005-02-21 23:32:57 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reconstruct the state of this object from a checkpoint.
|
|
|
|
* @param cp The checkpoint use.
|
|
|
|
* @param section The section name of this object
|
|
|
|
*/
|
2005-08-23 17:45:52 +02:00
|
|
|
void unserialize(const std::string &base, Checkpoint *cp,
|
|
|
|
const std::string §ion);
|
2005-02-21 23:32:57 +01:00
|
|
|
};
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/** Mask of the PIC1 */
|
2004-02-06 00:23:16 +01:00
|
|
|
uint8_t mask1;
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/** Mask of the PIC2 */
|
2004-02-06 00:23:16 +01:00
|
|
|
uint8_t mask2;
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/** Mode of PIC1. Not used for anything */
|
2004-02-06 00:23:16 +01:00
|
|
|
uint8_t mode1;
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/** Mode of PIC2. Not used for anything */
|
2004-02-06 00:23:16 +01:00
|
|
|
uint8_t mode2;
|
2004-01-22 06:08:48 +01:00
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/** Raw PIC interrupt register before masking */
|
|
|
|
uint8_t picr; //Raw PIC interrput register
|
|
|
|
|
|
|
|
/** Is the pic interrupting right now or not. */
|
2004-01-29 01:18:29 +01:00
|
|
|
bool picInterrupting;
|
|
|
|
|
Make the notion of a global event tick independent of the actual
CPU cycle ticks. This allows the user to have CPUs of different
frequencies, and also allows frequencies and latencies that are
not evenly divisible by the CPU frequency. For now, the CPU
frequency is still set to the global frequency, but soon, we'll
hopefully make the global frequency fixed at something like 1THz
and set all other frequencies independently.
arch/alpha/ev5.cc:
The cycles counter is based on the current cpu cycle.
cpu/base_cpu.cc:
frequency isn't the cpu parameter anymore, cycleTime is.
cpu/base_cpu.hh:
frequency isn't the cpu parameter anymore, cycleTime is.
create several public functions for getting the cpu frequency
and the numbers of ticks for a given number of cycles, etc.
cpu/memtest/memtest.cc:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
cpu/trace/trace_cpu.cc:
Now that ticks aren't cpu cycles, fixup code to advance
by the proper number of ticks.
cpu/memtest/memtest.hh:
cpu/trace/trace_cpu.hh:
Provide a function to get the number of ticks for a given
number of cycles.
dev/alpha_console.cc:
Update for changes in the way that frequencies and latencies are
accessed. Move some stuff to init()
dev/alpha_console.hh:
Need a pointer to the system and the cpu to get the frequency
so we can pass the info to the console code.
dev/etherbus.cc:
dev/etherbus.hh:
dev/etherlink.cc:
dev/etherlink.hh:
dev/ethertap.cc:
dev/ide_disk.hh:
dev/ns_gige.cc:
dev/ns_gige.hh:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
dev/ide_disk.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
Add some extra debugging printfs
dev/platform.cc:
dev/sinic.cc:
dev/sinic.hh:
outline the constructor and destructor
dev/platform.hh:
outline the constructor and destructor.
don't keep track of the interrupt frequency. Only provide the
accessor function.
dev/tsunami.cc:
dev/tsunami.hh:
outline the constructor and destructor
Don't set the interrupt frequency here. Get it from the actual device
that does the interrupting.
dev/tsunami_io.cc:
dev/tsunami_io.hh:
Make the interrupt interval a configuration parameter. (And convert
the interval to the new latency/frequency stuff in the python)
kern/linux/linux_system.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
kern/tru64/tru64_system.cc:
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
python/m5/config.py:
Fix support for cycle_time relative latencies and frequencies.
Add support for getting a NetworkBandwidth or a MemoryBandwidth.
python/m5/objects/BaseCPU.mpy:
All CPUs now have a cycle_time. The default is the global frequency,
but it is now possible to set the global frequency to some large value
(like 1THz) and set each CPU frequency independently.
python/m5/objects/BaseCache.mpy:
python/m5/objects/Ide.mpy:
Make this a Latency parameter
python/m5/objects/BaseSystem.mpy:
We need to pass the boot CPU's frequency to the system
python/m5/objects/Ethernet.mpy:
Update parameter types to use latency and bandwidth types
python/m5/objects/Platform.mpy:
this frequency isn't needed. We get it from the clock interrupt.
python/m5/objects/Tsunami.mpy:
The clock generator should hold the frequency
sim/eventq.hh:
Need to remove this assertion because the writeback event
queue is different from the CPU's event queue which can cause
this assertion to fail.
sim/process.cc:
Fix comment.
sim/system.hh:
Struct member to hold the boot CPU's frequency.
sim/universe.cc:
remove unneeded variable.
--HG--
extra : convert_revision : 51efe4041095234bf458d9b3b0d417f4cae16fdc
2005-04-11 21:32:06 +02:00
|
|
|
Tick clockInterval;
|
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/** A pointer to the Tsunami device which be belong to */
|
2004-01-28 03:36:46 +01:00
|
|
|
Tsunami *tsunami;
|
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
/** Intel 8253 Periodic Interval Timer */
|
|
|
|
PITimer pitimer;
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2005-08-15 22:59:58 +02:00
|
|
|
RTC rtc;
|
2004-01-26 19:26:34 +01:00
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/** The interval is set via two writes to the PIT.
|
|
|
|
* This variable contains a flag as to how many writes have happened, and
|
|
|
|
* the time so far.
|
|
|
|
*/
|
2005-08-15 22:59:58 +02:00
|
|
|
uint16_t timerData;
|
2004-01-23 01:02:07 +01:00
|
|
|
|
2004-01-22 02:14:10 +01:00
|
|
|
public:
|
2004-06-01 23:36:38 +02:00
|
|
|
/**
|
|
|
|
* Return the freqency of the RTC
|
|
|
|
* @return interrupt rate of the RTC
|
|
|
|
*/
|
Make the notion of a global event tick independent of the actual
CPU cycle ticks. This allows the user to have CPUs of different
frequencies, and also allows frequencies and latencies that are
not evenly divisible by the CPU frequency. For now, the CPU
frequency is still set to the global frequency, but soon, we'll
hopefully make the global frequency fixed at something like 1THz
and set all other frequencies independently.
arch/alpha/ev5.cc:
The cycles counter is based on the current cpu cycle.
cpu/base_cpu.cc:
frequency isn't the cpu parameter anymore, cycleTime is.
cpu/base_cpu.hh:
frequency isn't the cpu parameter anymore, cycleTime is.
create several public functions for getting the cpu frequency
and the numbers of ticks for a given number of cycles, etc.
cpu/memtest/memtest.cc:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
cpu/trace/trace_cpu.cc:
Now that ticks aren't cpu cycles, fixup code to advance
by the proper number of ticks.
cpu/memtest/memtest.hh:
cpu/trace/trace_cpu.hh:
Provide a function to get the number of ticks for a given
number of cycles.
dev/alpha_console.cc:
Update for changes in the way that frequencies and latencies are
accessed. Move some stuff to init()
dev/alpha_console.hh:
Need a pointer to the system and the cpu to get the frequency
so we can pass the info to the console code.
dev/etherbus.cc:
dev/etherbus.hh:
dev/etherlink.cc:
dev/etherlink.hh:
dev/ethertap.cc:
dev/ide_disk.hh:
dev/ns_gige.cc:
dev/ns_gige.hh:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
dev/ide_disk.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
Add some extra debugging printfs
dev/platform.cc:
dev/sinic.cc:
dev/sinic.hh:
outline the constructor and destructor
dev/platform.hh:
outline the constructor and destructor.
don't keep track of the interrupt frequency. Only provide the
accessor function.
dev/tsunami.cc:
dev/tsunami.hh:
outline the constructor and destructor
Don't set the interrupt frequency here. Get it from the actual device
that does the interrupting.
dev/tsunami_io.cc:
dev/tsunami_io.hh:
Make the interrupt interval a configuration parameter. (And convert
the interval to the new latency/frequency stuff in the python)
kern/linux/linux_system.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
kern/tru64/tru64_system.cc:
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
python/m5/config.py:
Fix support for cycle_time relative latencies and frequencies.
Add support for getting a NetworkBandwidth or a MemoryBandwidth.
python/m5/objects/BaseCPU.mpy:
All CPUs now have a cycle_time. The default is the global frequency,
but it is now possible to set the global frequency to some large value
(like 1THz) and set each CPU frequency independently.
python/m5/objects/BaseCache.mpy:
python/m5/objects/Ide.mpy:
Make this a Latency parameter
python/m5/objects/BaseSystem.mpy:
We need to pass the boot CPU's frequency to the system
python/m5/objects/Ethernet.mpy:
Update parameter types to use latency and bandwidth types
python/m5/objects/Platform.mpy:
this frequency isn't needed. We get it from the clock interrupt.
python/m5/objects/Tsunami.mpy:
The clock generator should hold the frequency
sim/eventq.hh:
Need to remove this assertion because the writeback event
queue is different from the CPU's event queue which can cause
this assertion to fail.
sim/process.cc:
Fix comment.
sim/system.hh:
Struct member to hold the boot CPU's frequency.
sim/universe.cc:
remove unneeded variable.
--HG--
extra : convert_revision : 51efe4041095234bf458d9b3b0d417f4cae16fdc
2005-04-11 21:32:06 +02:00
|
|
|
Tick frequency() const;
|
2004-01-28 03:36:46 +01:00
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/**
|
|
|
|
* Initialize all the data for devices supported by Tsunami I/O.
|
|
|
|
* @param name name of this device.
|
|
|
|
* @param t pointer back to the Tsunami object that we belong to.
|
|
|
|
* @param init_time Time (as in seconds since 1970) to set RTC to.
|
|
|
|
* @param a address we are mapped at.
|
|
|
|
* @param mmu pointer to the memory controller that sends us events.
|
|
|
|
*/
|
2004-01-28 03:36:46 +01:00
|
|
|
TsunamiIO(const std::string &name, Tsunami *t, time_t init_time,
|
2004-07-13 04:58:22 +02:00
|
|
|
Addr a, MemoryController *mmu, HierParams *hier, Bus *bus,
|
Make the notion of a global event tick independent of the actual
CPU cycle ticks. This allows the user to have CPUs of different
frequencies, and also allows frequencies and latencies that are
not evenly divisible by the CPU frequency. For now, the CPU
frequency is still set to the global frequency, but soon, we'll
hopefully make the global frequency fixed at something like 1THz
and set all other frequencies independently.
arch/alpha/ev5.cc:
The cycles counter is based on the current cpu cycle.
cpu/base_cpu.cc:
frequency isn't the cpu parameter anymore, cycleTime is.
cpu/base_cpu.hh:
frequency isn't the cpu parameter anymore, cycleTime is.
create several public functions for getting the cpu frequency
and the numbers of ticks for a given number of cycles, etc.
cpu/memtest/memtest.cc:
cpu/simple_cpu/simple_cpu.cc:
cpu/simple_cpu/simple_cpu.hh:
cpu/trace/trace_cpu.cc:
Now that ticks aren't cpu cycles, fixup code to advance
by the proper number of ticks.
cpu/memtest/memtest.hh:
cpu/trace/trace_cpu.hh:
Provide a function to get the number of ticks for a given
number of cycles.
dev/alpha_console.cc:
Update for changes in the way that frequencies and latencies are
accessed. Move some stuff to init()
dev/alpha_console.hh:
Need a pointer to the system and the cpu to get the frequency
so we can pass the info to the console code.
dev/etherbus.cc:
dev/etherbus.hh:
dev/etherlink.cc:
dev/etherlink.hh:
dev/ethertap.cc:
dev/ide_disk.hh:
dev/ns_gige.cc:
dev/ns_gige.hh:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
dev/ide_disk.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
Add some extra debugging printfs
dev/platform.cc:
dev/sinic.cc:
dev/sinic.hh:
outline the constructor and destructor
dev/platform.hh:
outline the constructor and destructor.
don't keep track of the interrupt frequency. Only provide the
accessor function.
dev/tsunami.cc:
dev/tsunami.hh:
outline the constructor and destructor
Don't set the interrupt frequency here. Get it from the actual device
that does the interrupting.
dev/tsunami_io.cc:
dev/tsunami_io.hh:
Make the interrupt interval a configuration parameter. (And convert
the interval to the new latency/frequency stuff in the python)
kern/linux/linux_system.cc:
update for changes in the way bandwidths are passed from
python to C++ to accomidate the new way that ticks works.
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
kern/tru64/tru64_system.cc:
For now, we must get the boot cpu's frequency as a parameter
since allowing the system to have a pointer to the boot cpu would
cause a cycle.
python/m5/config.py:
Fix support for cycle_time relative latencies and frequencies.
Add support for getting a NetworkBandwidth or a MemoryBandwidth.
python/m5/objects/BaseCPU.mpy:
All CPUs now have a cycle_time. The default is the global frequency,
but it is now possible to set the global frequency to some large value
(like 1THz) and set each CPU frequency independently.
python/m5/objects/BaseCache.mpy:
python/m5/objects/Ide.mpy:
Make this a Latency parameter
python/m5/objects/BaseSystem.mpy:
We need to pass the boot CPU's frequency to the system
python/m5/objects/Ethernet.mpy:
Update parameter types to use latency and bandwidth types
python/m5/objects/Platform.mpy:
this frequency isn't needed. We get it from the clock interrupt.
python/m5/objects/Tsunami.mpy:
The clock generator should hold the frequency
sim/eventq.hh:
Need to remove this assertion because the writeback event
queue is different from the CPU's event queue which can cause
this assertion to fail.
sim/process.cc:
Fix comment.
sim/system.hh:
Struct member to hold the boot CPU's frequency.
sim/universe.cc:
remove unneeded variable.
--HG--
extra : convert_revision : 51efe4041095234bf458d9b3b0d417f4cae16fdc
2005-04-11 21:32:06 +02:00
|
|
|
Tick pio_latency, Tick ci);
|
2004-01-22 02:14:10 +01:00
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/**
|
|
|
|
* Process a read to one of the devices we are emulating.
|
|
|
|
* @param req Contains the address to read from.
|
|
|
|
* @param data A pointer to write the read data to.
|
|
|
|
* @return The fault condition of the access.
|
|
|
|
*/
|
2004-02-03 22:59:40 +01:00
|
|
|
virtual Fault read(MemReqPtr &req, uint8_t *data);
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process a write to one of the devices we emulate.
|
|
|
|
* @param req Contains the address to write to.
|
|
|
|
* @param data The data to write.
|
|
|
|
* @return The fault condition of the access.
|
|
|
|
*/
|
2004-02-03 22:59:40 +01:00
|
|
|
virtual Fault write(MemReqPtr &req, const uint8_t *data);
|
2004-01-22 02:14:10 +01:00
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/**
|
|
|
|
* Post an PIC interrupt to the CPU via the CChip
|
|
|
|
* @param bitvector interrupt to post.
|
|
|
|
*/
|
2004-01-29 01:18:29 +01:00
|
|
|
void postPIC(uint8_t bitvector);
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear a posted interrupt
|
|
|
|
* @param bitvector interrupt to clear
|
|
|
|
*/
|
2004-01-29 01:18:29 +01:00
|
|
|
void clearPIC(uint8_t bitvector);
|
|
|
|
|
2004-05-30 23:45:46 +02:00
|
|
|
/**
|
|
|
|
* Serialize this object to the given output stream.
|
|
|
|
* @param os The stream to serialize to.
|
|
|
|
*/
|
2004-01-22 02:14:10 +01:00
|
|
|
virtual void serialize(std::ostream &os);
|
2004-05-30 23:45:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reconstruct the state of this object from a checkpoint.
|
|
|
|
* @param cp The checkpoint use.
|
|
|
|
* @param section The section name of this object
|
|
|
|
*/
|
2004-01-22 02:14:10 +01:00
|
|
|
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
2004-06-10 19:30:58 +02:00
|
|
|
|
|
|
|
Tick cacheAccess(MemReqPtr &req);
|
2004-01-22 02:14:10 +01:00
|
|
|
};
|
|
|
|
|
2005-02-21 23:32:57 +01:00
|
|
|
#endif // __DEV_TSUNAMI_IO_HH__
|