44I8237::Register::ReadFunc
45readUnimpl(
const std::string &label)
48 panic(
"Read from i8237 %s unimplemented.", label);
52I8237::Register::WriteFunc
53writeUnimpl(
const std::string &label)
56 panic(
"Write to i8237 %s unimplemented.", label);
65 reader(readUnimpl(
name()));
72 reader(readUnimpl(
name()));
80 panic(
"Illegal read from i8237 register %d.",
offset);
86 statusCommandReg(
"status/command"),
87 requestReg(
"request", 0x9),
88 setMaskBitReg(
"set mask bit", 0xa),
90 clearFlipFlopReg(
"clear flip-flop", 0xc),
91 temporaryMasterClearReg(
"temporary/maskter clear"),
92 clearMaskReg(
"clear mask", 0xe),
93 writeMaskReg(
"write mask", 0xf)
96 for (
auto &channel: channels)
97 regs.addRegisters({ channel.addrReg, channel.remainingReg });
102 reader([
this](
auto &
reg) -> uint8_t {
return statusVal; }).
103 writer([
this](
auto &
reg,
const uint8_t &value) {
114 writer([
this](
auto &
reg,
const uint8_t &value) {
115 channels[
bits(value, 1, 0)].mode = value;
119 writer([
this](
auto &
reg,
const uint8_t &value) {
123 temporaryMasterClearReg.
124 reader([
this](
auto &
reg) ->uint8_t {
return tempVal; }).
128 writer([
this](
auto &
reg,
const uint8_t &value) { maskVal = 0x0; }),
131 writer([
this](
auto &
reg,
const uint8_t &value) {
132 maskVal =
bits(value, 3, 0);
153 uint8_t select =
bits(command, 1, 0);
154 uint8_t bitVal =
bits(command, 2);
155 panic_if(!bitVal,
"Turning on i8237 channels unimplemented.");
162 uint8_t select =
bits(command, 1, 0);
163 uint8_t bitVal =
bits(command, 2);
164 panic_if(bitVal,
"Requesting i8237 DMA transfers is unimplemented.");
Addr pioAddr
Address that the device listens to.
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
T * getPtr()
get a pointer to the data ptr.
void makeAtomicResponse()
void addRegisters(std::initializer_list< RegisterAdder > adders)
virtual void read(Addr addr, void *buf, Addr bytes)
virtual void write(Addr addr, const void *buf, Addr bytes)
ChannelAddrReg(Channel &)
ChannelRemainingReg(Channel &)
WriteOnlyReg(const std::string &new_name, Addr offset)
void setMaskBit(Register ®, const uint8_t &command)
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
std::array< Channel, 4 > channels
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void setRequestBit(Register ®, const uint8_t &command)
void serialize(CheckpointOut &cp) const override
Serialize an object.
RegisterBankLE::Register8 Register
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
#define panic(...)
This implements a cprintf based panic() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
Declaration of the Packet class.