mc2lib
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
mc2lib::codegen::Compiler< Operation, Backend > Class Template Reference

Top level class used to manage code generation (compiler). More...

#include <compiler.hpp>

Public Types

typedef Operation::EvtState EvtState
 
typedef Operation::Threads Threads
 
typedef Operation::ThreadIt ThreadIt
 
typedef Operation::ThreadItStack ThreadItStack
 
typedef Operation::ThreadConst ThreadConst
 
typedef Operation::Callback Callback
 
typedef Operation::CallbackStack CallbackStack
 

Public Member Functions

 Compiler (std::unique_ptr< EvtState > evts)
 
 Compiler (std::unique_ptr< EvtState > evts, Threads &&threads)
 
void Reset ()
 
void Reset (Threads &&threads)
 
const Threadsthreads ()
 
const EvtStateevts () const
 
EvtStateevts ()
 
std::size_t Emit (types::InstPtr base, Operation *op, void *code, std::size_t len, ThreadConst *thread_const_ops, CallbackStack *callback_stack)
 
std::size_t Emit (types::Pid pid, types::InstPtr base, void *code, std::size_t len)
 
bool UpdateObs (types::InstPtr ip, int part, types::Addr addr, const types::WriteID *from_id, std::size_t size)
 
Operation * IpToOp (types::InstPtr ip) const
 

Private Types

typedef std::map< types::InstPtr, std::pair< types::InstPtr, Operation * > > InstPtr_Op
 

Private Attributes

std::unique_ptr< EvtStateevts_
 
Backend backend_
 
Threads threads_
 
InstPtr_Op ip_to_op_
 

Detailed Description

template<class Operation, class Backend>
class mc2lib::codegen::Compiler< Operation, Backend >

Top level class used to manage code generation (compiler).

Member Typedef Documentation

§ Callback

template<class Operation , class Backend >
typedef Operation::Callback mc2lib::codegen::Compiler< Operation, Backend >::Callback

§ CallbackStack

template<class Operation , class Backend >
typedef Operation::CallbackStack mc2lib::codegen::Compiler< Operation, Backend >::CallbackStack

§ EvtState

template<class Operation , class Backend >
typedef Operation::EvtState mc2lib::codegen::Compiler< Operation, Backend >::EvtState

§ InstPtr_Op

template<class Operation , class Backend >
typedef std::map<types::InstPtr, std::pair<types::InstPtr, Operation *> > mc2lib::codegen::Compiler< Operation, Backend >::InstPtr_Op
private

§ ThreadConst

template<class Operation , class Backend >
typedef Operation::ThreadConst mc2lib::codegen::Compiler< Operation, Backend >::ThreadConst

§ ThreadIt

template<class Operation , class Backend >
typedef Operation::ThreadIt mc2lib::codegen::Compiler< Operation, Backend >::ThreadIt

§ ThreadItStack

template<class Operation , class Backend >
typedef Operation::ThreadItStack mc2lib::codegen::Compiler< Operation, Backend >::ThreadItStack

§ Threads

template<class Operation , class Backend >
typedef Operation::Threads mc2lib::codegen::Compiler< Operation, Backend >::Threads

Constructor & Destructor Documentation

§ Compiler() [1/2]

template<class Operation , class Backend >
mc2lib::codegen::Compiler< Operation, Backend >::Compiler ( std::unique_ptr< EvtState evts)
inlineexplicit

Implies a reset of state in evts.

Parameters
evtsPointer to instance of EvtState as required by Operation. The choice of unique_ptr here is deliberate, in that the class that Operation requires may be a virtual base class, and Compiler takes ownership.

§ Compiler() [2/2]

template<class Operation , class Backend >
mc2lib::codegen::Compiler< Operation, Backend >::Compiler ( std::unique_ptr< EvtState evts,
Threads &&  threads 
)
inlineexplicit

Implies a reset of state in evts and threads (the Ops contained).

Parameters
evtsPointer to instance of EvtState as required by Operation. The choice of unique_ptr here is deliberate, in that the class that Operation requires may be a virtual base class. Takes ownership.
[in,out]threadsThreads container. The Ops pointed to by Threads may be modified.

Member Function Documentation

§ Emit() [1/2]

template<class Operation , class Backend >
std::size_t mc2lib::codegen::Compiler< Operation, Backend >::Emit ( types::InstPtr  base,
Operation *  op,
void *  code,
std::size_t  len,
ThreadConst thread_const_ops,
CallbackStack callback_stack 
)
inline

§ Emit() [2/2]

template<class Operation , class Backend >
std::size_t mc2lib::codegen::Compiler< Operation, Backend >::Emit ( types::Pid  pid,
types::InstPtr  base,
void *  code,
std::size_t  len 
)
inline

§ evts() [1/2]

template<class Operation , class Backend >
const EvtState* mc2lib::codegen::Compiler< Operation, Backend >::evts ( ) const
inline

§ evts() [2/2]

template<class Operation , class Backend >
EvtState* mc2lib::codegen::Compiler< Operation, Backend >::evts ( )
inline

§ IpToOp()

template<class Operation , class Backend >
Operation* mc2lib::codegen::Compiler< Operation, Backend >::IpToOp ( types::InstPtr  ip) const
inline

§ Reset() [1/2]

template<class Operation , class Backend >
void mc2lib::codegen::Compiler< Operation, Backend >::Reset ( )
inline

§ Reset() [2/2]

template<class Operation , class Backend >
void mc2lib::codegen::Compiler< Operation, Backend >::Reset ( Threads &&  threads)
inline

§ threads()

template<class Operation , class Backend >
const Threads& mc2lib::codegen::Compiler< Operation, Backend >::threads ( )
inline

§ UpdateObs()

template<class Operation , class Backend >
bool mc2lib::codegen::Compiler< Operation, Backend >::UpdateObs ( types::InstPtr  ip,
int  part,
types::Addr  addr,
const types::WriteID from_id,
std::size_t  size 
)
inline

Member Data Documentation

§ backend_

template<class Operation , class Backend >
Backend mc2lib::codegen::Compiler< Operation, Backend >::backend_
private

§ evts_

template<class Operation , class Backend >
std::unique_ptr<EvtState> mc2lib::codegen::Compiler< Operation, Backend >::evts_
private

§ ip_to_op_

template<class Operation , class Backend >
InstPtr_Op mc2lib::codegen::Compiler< Operation, Backend >::ip_to_op_
private

§ threads_

template<class Operation , class Backend >
Threads mc2lib::codegen::Compiler< Operation, Backend >::threads_
private

The documentation for this class was generated from the following file: