17#include "etiss/jit/ReturnCode.h"
22 std::shared_ptr<CPUArch> arch,
InterruptType itype,
bool sync)
23 : itype_(itype), sync_(sync), vector_(interruptVector), enable_(interruptEnable), cpuarch_(arch)
31 const std::pair<etiss::uint64, std::pair<unsigned, bool>> &o2)
33 return o1.first < o2.first;
43 pending_.push_back(std::make_pair(time_ps, std::make_pair(line, state)));
55 return etiss::RETURNCODE::NOERROR;
77 std::pair<etiss::uint64, std::pair<unsigned, bool>> &cur =
pending_.front();
82 if (cur.second.second)
106 std::cout <<
"InterruptHandler::execute: ERROR: interrupt type is invalid" <<
stream_code_info
134 return (mayinterrupt && active && enabled) ? etiss::RETURNCODE::INTERRUPT : etiss::RETURNCODE::NOERROR;
139 return "InterruptHandler";
bool interrupt_handler_cmp(const std::pair< etiss::uint64, std::pair< unsigned, bool > > &o1, const std::pair< etiss::uint64, std::pair< unsigned, bool > > &o2)
interrupt checking and signaling
defines a general interface to set interrupt bits
virtual ~InterruptHandler()
virtual std::string _getPluginName() const
InterruptHandler(etiss::InterruptVector *interruptVector, etiss::InterruptEnable *interruptEnable, std::shared_ptr< etiss::CPUArch > arch, InterruptType itype=EDGE_TRIGGERED, bool sync=true)
std::set< unsigned > ed_raised_
virtual etiss::int32 execute()
apply interrupt changes to the InterruptVector
std::list< std::pair< etiss::uint64, std::pair< unsigned, bool > > > pending_
list: (time , (line ,state) )
virtual void setLine(unsigned line, bool state, etiss::uint64 time_ps)
set the state of a line at a given time.
const InterruptType itype_
InterruptVector *const vector_
InterruptEnable *const enable_
interface to set interrupt bits
virtual bool isActive() const
bool consumed_by_interruptlistener_
virtual void setBit(unsigned bit, bool state)=0
set the bit of an interrupt line to state (true = raised)
ETISS_CPU * plugin_cpu_
holds a pointer to the cpu structure. will be set before init call and after cleanup call
InterruptType
interrupt types supported by the default implementation
etiss_uint64 cpuTime_ps
simulation time of cpu