42 #include "debug/Tsunami.hh" 56 pioDelay(p->pio_latency)
58 for (
int i = 0;
i < 4;
i++) {
65 pctl = (
ULL(0x1) << 20) | (
ULL(0x1) << 32) | (
ULL(0x2) << 36);
68 p->tsunami->pchip =
this;
80 assert(pkt->
getSize() ==
sizeof(uint64_t));
126 panic(
"PC_PLAT not implemented\n");
128 panic(
"PC_RES not implemented\n");
130 pkt->
setLE((uint64_t)0x00);
133 pkt->
setLE((uint64_t)0x00);
136 panic(
"PC_PERRSET not implemented\n");
138 panic(
"PC_TLBIV not implemented\n");
140 pkt->
setLE((uint64_t)0x00);
143 panic(
"PC_PMONCTL not implemented\n");
145 panic(
"PC_PMONCTN not implemented\n");
147 panic(
"Default in PChip Read reached reading 0x%x\n", daddr);
165 assert(pkt->
getSize() ==
sizeof(uint64_t));
210 panic(
"PC_PLAT not implemented\n");
212 panic(
"PC_RES not implemented\n");
216 panic(
"PC_PERRMASK not implemented\n");
218 panic(
"PC_PERRSET not implemented\n");
220 panic(
"PC_TLBIV not implemented\n");
224 panic(
"PC_PMONCTL not implemented\n");
226 panic(
"PC_PMONCTN not implemented\n");
228 panic(
"Default in PChip write reached reading 0x%x\n", daddr);
247 #define DMA_ADDR_MASK ULL(0x3ffffffff) 253 uint64_t tbaMask = 0;
256 uint64_t windowMask = 0;
257 uint64_t windowBase = 0;
259 uint64_t pteEntry = 0;
264 for (
int i = 0;
i < 4;
i++) {
266 windowBase =
wsba[
i];
267 windowMask = ~
wsm[
i] & (
ULL(0xfff) << 20);
269 if ((busAddr & windowMask) == (windowBase & windowMask)) {
283 tbaMask = ~(((
wsm[
i] & (
ULL(0xfff) << 20)) >> 10) |
285 baMask = (
wsm[
i] & (
ULL(0xfff) << 20)) | (
ULL(0x7f) << 13);
286 pteAddr = (
tba[
i] & tbaMask) | ((busAddr & baMask) >> 10);
291 dmaAddr = ((pteEntry & ~
ULL(0x1)) << 12) |
292 (busAddr &
ULL(0x1fff));
295 baMask = (
wsm[
i] & (
ULL(0xfff) << 20)) |
ULL(0xfffff);
297 dmaAddr = (
tba[
i] & tbaMask) | (busAddr & baMask);
329 TsunamiPChipParams::create()
#define panic(...)
This implements a cprintf based panic() function.
AddrRange RangeSize(Addr start, Addr size)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
uint64_t tba[4]
Translated Base Addresses.
uint64_t wsba[4]
Window Base addresses.
Emulation of the Tsunami CChip CSRs.
Configurable generic PCI host interface.
Tsunami PCI interface CSRs.
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
Top level class for Tsunami Chipset emulation.
bool contains(const Addr &a) const
Determine if the range contains an address.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Overload hash function for BasicBlockRange type.
TsunamiPChipParams Params
void setLE(T v)
Set the value in the data pointer to v as little endian.
uint64_t wsm[4]
Window masks.
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
#define UNSERIALIZE_SCALAR(scalar)
TsunamiPChip(const Params *p)
Register the PChip with the mmu and init all wsba, wsm, and tba to 0.
#define TSDEV_PC_PERRMASK
void makeAtomicResponse()
uint64_t Tick
Tick count type.
A very simple implementation of the Tsunami PCI interface chips.
Declaration of top level class for the Tsunami chipset.
#define SERIALIZE_ARRAY(member, size)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define ULL(N)
uint64_t constant
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Addr dmaAddr(const PciBusAddr &addr, Addr pci_addr) const override
Translate a PCI bus address to a memory address for DMA.
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
#define SERIALIZE_SCALAR(scalar)
uint64_t pctl
Pchip control register.
#define UNSERIALIZE_ARRAY(member, size)
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Declaration of the Packet class.
std::ostream CheckpointOut
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Addr start() const
Get the start address of the range.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.