X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fdev%2Fisa_fake.hh;h=1fd2415cb91bee736afa6f401727ec9a0a7f0db8;hb=27e8f3c98a4b1c56e16ce5f80c7ad992083ccef9;hp=6665f1a788d7e97ab4784091b3754b4c13e2eb4f;hpb=de90ae482507207566139c58911bc8e2894ad856;p=gem5.git diff --git a/src/dev/isa_fake.hh b/src/dev/isa_fake.hh index 6665f1a78..1fd2415cb 100644 --- a/src/dev/isa_fake.hh +++ b/src/dev/isa_fake.hh @@ -25,8 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Authors: Miguel Serrano - * Ali Saidi + * Authors: Ali Saidi */ /** @file @@ -36,30 +35,38 @@ #ifndef __ISA_FAKE_HH__ #define __ISA_FAKE_HH__ +#include + #include "base/range.hh" #include "dev/io_device.hh" -#include "dev/tsunami.hh" +// #include "dev/alpha/tsunami.hh" +#include "params/IsaFake.hh" #include "mem/packet.hh" /** - * IsaFake is a device that returns -1 on all reads and - * accepts all writes. It is meant to be placed at an address range + * IsaFake is a device that returns, BadAddr, 1 or 0 on all reads and + * rites. It is meant to be placed at an address range * so that an mcheck doesn't occur when an os probes a piece of hw - * that doesn't exist (e.g. UARTs1-3). + * that doesn't exist (e.g. UARTs1-3), or catch requests in the memory system + * that have no responders.. */ class IsaFake : public BasicPioDevice { - public: - struct Params : public BasicPioDevice::Params - { - Addr pio_size; - }; protected: - const Params *params() const { return (const Params*)_params; } + uint8_t retData8; + uint16_t retData16; + uint32_t retData32; + uint64_t retData64; public: + typedef IsaFakeParams Params; + const Params * + params() const + { + return dynamic_cast(_params); + } /** - * The constructor for Tsunmami Fake just registers itself with the MMU. + * The constructor for Isa Fake just registers itself with the MMU. * @param p params structure */ IsaFake(Params *p); @@ -79,21 +86,4 @@ class IsaFake : public BasicPioDevice virtual Tick write(PacketPtr pkt); }; -/** - * BadAddr is a device that fills the packet's result field with "BadAddress". - * @todo: Consider consolidating with IsaFake and similar classes. - */ -class BadAddr : public BasicPioDevice -{ - public: - struct Params : public BasicPioDevice::Params - { - }; - - BadAddr(Params *p); - virtual void init(); - virtual Tick read(PacketPtr pkt); - virtual Tick write(PacketPtr pkt); -}; - -#endif // __TSUNAMI_FAKE_HH__ +#endif // __ISA_FAKE_HH__