isa_fake.cc (3357:0963b8a38b5e) isa_fake.cc (3488:52e909177bfa)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

83Tick
84IsaFake::write(PacketPtr pkt)
85{
86 DPRINTF(Tsunami, "write - va=%#x size=%d \n", pkt->getAddr(), pkt->getSize());
87 pkt->result = Packet::Success;
88 return pioDelay;
89}
90
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

83Tick
84IsaFake::write(PacketPtr pkt)
85{
86 DPRINTF(Tsunami, "write - va=%#x size=%d \n", pkt->getAddr(), pkt->getSize());
87 pkt->result = Packet::Success;
88 return pioDelay;
89}
90
91BadAddr::BadAddr(Params *p)
92 : BasicPioDevice(p)
93{
94}
95
96void
97BadAddr::init()
98{
99 // Only init this device if it's connected to anything.
100 if (pioPort)
101 PioDevice::init();
102}
103
104Tick
105BadAddr::read(PacketPtr pkt)
106{
107 assert(pkt->result == Packet::Unknown);
108 DPRINTF(Tsunami, "read to bad address va=%#x size=%d\n",
109 pkt->getAddr(), pkt->getSize());
110 pkt->result = Packet::BadAddress;
111 return pioDelay;
112}
113
114Tick
115BadAddr::write(PacketPtr pkt)
116{
117 DPRINTF(Tsunami, "write to bad address va=%#x size=%d \n",
118 pkt->getAddr(), pkt->getSize());
119 pkt->result = Packet::BadAddress;
120 return pioDelay;
121}
122
91BEGIN_DECLARE_SIM_OBJECT_PARAMS(IsaFake)
92
93 Param<Addr> pio_addr;
94 Param<Tick> pio_latency;
95 Param<Addr> pio_size;
96 SimObjectParam<Platform *> platform;
97 SimObjectParam<System *> system;
98

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

116 p->pio_delay = pio_latency;
117 p->pio_size = pio_size;
118 p->platform = platform;
119 p->system = system;
120 return new IsaFake(p);
121}
122
123REGISTER_SIM_OBJECT("IsaFake", IsaFake)
123BEGIN_DECLARE_SIM_OBJECT_PARAMS(IsaFake)
124
125 Param<Addr> pio_addr;
126 Param<Tick> pio_latency;
127 Param<Addr> pio_size;
128 SimObjectParam<Platform *> platform;
129 SimObjectParam<System *> system;
130

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

148 p->pio_delay = pio_latency;
149 p->pio_size = pio_size;
150 p->platform = platform;
151 p->system = system;
152 return new IsaFake(p);
153}
154
155REGISTER_SIM_OBJECT("IsaFake", IsaFake)
156
157BEGIN_DECLARE_SIM_OBJECT_PARAMS(BadAddr)
158
159 Param<Addr> pio_addr;
160 Param<Tick> pio_latency;
161 SimObjectParam<Platform *> platform;
162 SimObjectParam<System *> system;
163
164END_DECLARE_SIM_OBJECT_PARAMS(BadAddr)
165
166BEGIN_INIT_SIM_OBJECT_PARAMS(BadAddr)
167
168 INIT_PARAM(pio_addr, "Device Address"),
169 INIT_PARAM(pio_latency, "Programmed IO latency"),
170 INIT_PARAM(platform, "platform"),
171 INIT_PARAM(system, "system object")
172
173END_INIT_SIM_OBJECT_PARAMS(BadAddr)
174
175CREATE_SIM_OBJECT(BadAddr)
176{
177 BadAddr::Params *p = new BadAddr::Params;
178 p->name = getInstanceName();
179 p->pio_addr = pio_addr;
180 p->pio_delay = pio_latency;
181 p->platform = platform;
182 p->system = system;
183 return new BadAddr(p);
184}
185
186REGISTER_SIM_OBJECT("BadAddr", BadAddr)