our first interrupt

cpu/exetrace.cc:
    added looking for symbols at PC+4 and PC+8 thanks to gcc skiping
    setting the gp where it can and jumping <func>+8
dev/console.cc:
    commented out weird interrupt per nate's suggestion
dev/tsunami_cchip.cc:
    moved rtc flag to correct bit
dev/tsunami_io.cc:
    time interrupt will be 1024Hz and at some point be configurable by
    linux
dev/tsunami_io.hh:
    Timer interrupt will be 1024hz for now and in the future be
    configurable by linux

--HG--
extra : convert_revision : 2fcc924c8848eb3c6166d9d517617ed193a2b89a
This commit is contained in:
Ali Saidi 2004-01-28 18:12:52 -05:00
parent 3ccc0b1f96
commit b6fba57065
5 changed files with 20 additions and 18 deletions

View file

@ -67,8 +67,12 @@ Trace::InstRecord::dump(ostream &outs)
std::string str;
if(debugSymbolTable->findSymbol(data.as_int, str))
if(debugSymbolTable->findSymbol(PC, str))
outs << "@" << setw(17) << str << " : ";
else if(debugSymbolTable->findSymbol(PC - 4, str))
outs << "@" << setw(15) << str << "+4 : ";
else if(debugSymbolTable->findSymbol(PC - 8, str))
outs << "@" << setw(15) << str << "+8 : ";
else
outs << "0x" << hex << PC << " : ";

View file

@ -388,8 +388,8 @@ CREATE_SIM_OBJECT(SimConsole)
SimConsole *console = new SimConsole(getInstanceName(), filename, number);
((ConsoleListener *)listener)->add(console);
((SimConsole *)console)->initInt(intr_control);
((SimConsole *)console)->setInt(SimConsole::TransmitInterrupt |
SimConsole::ReceiveInterrupt);
// ((SimConsole *)console)->setInt(SimConsole::TransmitInterrupt |
// SimConsole::ReceiveInterrupt);
return console;
}

View file

@ -148,10 +148,11 @@ TsunamiCChip::write(MemReqPtr req, const uint8_t *data)
return No_Fault;
case TSDEV_CC_MISC:
//If it is the seventh bit, clear the RTC interrupt
if ((*(uint64_t*) data) & (1<<7)) {
if ((*(uint64_t*) data) & (1<<4)) {
RTCInterrupting = false;
tsunami->intrctrl->clear(0, TheISA::INTLEVEL_IRQ2, 0);
misc &= ~(1<<7);
DPRINTF(Tsunami, "clearing rtc interrupt\n");
misc &= ~(1<<4);
} else panic("TSDEV_CC_MISC write not implemented\n");
return No_Fault;
case TSDEV_CC_AAR0:

View file

@ -25,8 +25,6 @@ using namespace std;
#define UNIX_YEAR_OFFSET 52
//This will have to be dynamic if we want support usermode access of the RTC
#define RTC_RATE 1024
// Timer Event for Periodic interrupt of RTC
TsunamiIO::RTCEvent::RTCEvent(Tsunami* t)
@ -39,7 +37,7 @@ TsunamiIO::RTCEvent::RTCEvent(Tsunami* t)
void
TsunamiIO::RTCEvent::process()
{
DPRINTF(MC146818, "Timer Interrupt\n");
DPRINTF(MC146818, "RTC Timer Interrupt\n");
schedule(curTick + ticksPerSecond/RTC_RATE);
//Actually interrupt the processor here
if (!tsunami->cchip->RTCInterrupting) {
@ -105,8 +103,8 @@ TsunamiIO::ClockEvent::Status()
TsunamiIO::TsunamiIO(const string &name, Tsunami *t, time_t init_time,
Addr addr, Addr mask, uint32_t f, MemoryController *mmu)
: MmapDevice(name, addr, mask, mmu), tsunami(t), rtc(t), freq(f)
Addr addr, Addr mask, MemoryController *mmu)
: MmapDevice(name, addr, mask, mmu), tsunami(t), rtc(t)
{
timerData = 0;
set_time(init_time == 0 ? time(NULL) : init_time);
@ -300,7 +298,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiIO)
SimObjectParam<MemoryController *> mmu;
Param<Addr> addr;
Param<Addr> mask;
Param<uint32_t> frequency;
END_DECLARE_SIM_OBJECT_PARAMS(TsunamiIO)
@ -311,15 +308,14 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(TsunamiIO)
"(0 for actual time, default is 1/1/06", ULL(1136073600)),
INIT_PARAM(mmu, "Memory Controller"),
INIT_PARAM(addr, "Device Address"),
INIT_PARAM(mask, "Address Mask"),
INIT_PARAM(frequency, "clock interrupt frequency")
INIT_PARAM(mask, "Address Mask")
END_INIT_SIM_OBJECT_PARAMS(TsunamiIO)
CREATE_SIM_OBJECT(TsunamiIO)
{
return new TsunamiIO(getInstanceName(), tsunami, time, addr,
mask, frequency, mmu);
mask, mmu);
}
REGISTER_SIM_OBJECT("TsunamiIO", TsunamiIO)

View file

@ -27,12 +27,14 @@
*/
/* @file
* Tsunnami Fake DMA memory map
* Tsunami Fake I/O Space mapping including RTC/timer interrupts
*/
#ifndef __TSUNAMI_DMA_HH__
#define __TSUNAMI_DMA_HH__
#define RTC_RATE 1024
#include "mem/functional_mem/mmap_device.hh"
#include "dev/tsunami.hh"
@ -107,13 +109,12 @@ class TsunamiIO : public MmapDevice
uint32_t timerData;
uint32_t freq;
public:
uint32_t frequency() const { return freq; }
uint32_t frequency() const { return RTC_RATE; }
TsunamiIO(const std::string &name, Tsunami *t, time_t init_time,
Addr addr, Addr mask, uint32_t f, MemoryController *mmu);
Addr addr, Addr mask, MemoryController *mmu);
void set_time(time_t t);