X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=dev%2Ftsunami_io.hh;h=d507355c353135e04569266f37c94775911ecdf3;hb=f1f85c5470c67adc5071296c53e69abb0b47b09c;hp=1dd7762e3136801ada693511fbad7f8dd5d23325;hpb=caf5cad959d8c75095590e0e6e1a9ed1f243366e;p=gem5.git diff --git a/dev/tsunami_io.hh b/dev/tsunami_io.hh index 1dd7762e3..d507355c3 100644 --- a/dev/tsunami_io.hh +++ b/dev/tsunami_io.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,10 @@ #ifndef __TSUNAMI_DMA_HH__ #define __TSUNAMI_DMA_HH__ -#include "mem/functional_mem/functional_memory.hh" +#include "dev/io_device.hh" +#include "base/range.hh" #include "dev/tsunami.hh" +#include "sim/eventq.hh" /** How often the RTC interrupts */ static const int RTC_RATE = 1024; @@ -43,7 +45,7 @@ static const int RTC_RATE = 1024; * Tsunami I/O device is a catch all for all the south bridge stuff we care * to implement. */ -class TsunamiIO : public FunctionalMemory +class TsunamiIO : public PioDevice { private: /** The base address of this device */ @@ -109,7 +111,20 @@ class TsunamiIO : public FunctionalMemory */ uint8_t Status(); - }; + /** + * Serialize this object to the given output stream. + * @param os The stream to serialize to. + */ + virtual void serialize(std::ostream &os); + + + /** + * Reconstruct the state of this object from a checkpoint. + * @param cp The checkpoint use. + * @param section The section name of this object + */ + virtual void unserialize(Checkpoint *cp, const std::string §ion); + }; /** * Process RTC timer events and generate interrupts appropriately. @@ -134,7 +149,21 @@ class TsunamiIO : public FunctionalMemory * @return a description */ virtual const char *description(); - }; + + /** + * Serialize this object to the given output stream. + * @param os The stream to serialize to. + */ + virtual void serialize(std::ostream &os); + + + /** + * Reconstruct the state of this object from a checkpoint. + * @param cp The checkpoint use. + * @param section The section name of this object + */ + virtual void unserialize(Checkpoint *cp, const std::string §ion); + }; /** uip UpdateInProgess says that the rtc is updating, but we just fake it * by alternating it on every read of the bit since we are going to @@ -192,8 +221,11 @@ class TsunamiIO : public FunctionalMemory public: - /** Return the freqency of the RTC */ - uint32_t frequency() const { return RTC_RATE; } + /** + * Return the freqency of the RTC + * @return interrupt rate of the RTC + */ + Tick frequency() const { return RTC_RATE; } /** @@ -205,7 +237,8 @@ class TsunamiIO : public FunctionalMemory * @param mmu pointer to the memory controller that sends us events. */ TsunamiIO(const std::string &name, Tsunami *t, time_t init_time, - Addr a, MemoryController *mmu); + Addr a, MemoryController *mmu, HierParams *hier, Bus *bus, + Tick pio_latency); /** * Create the tm struct from seconds since 1970 @@ -253,6 +286,9 @@ class TsunamiIO : public FunctionalMemory * @param section The section name of this object */ virtual void unserialize(Checkpoint *cp, const std::string §ion); + + + Tick cacheAccess(MemReqPtr &req); }; #endif // __TSUNAMI_IO_HH__