14 #ifndef ABSSEMANTICS_HPP 15 #define ABSSEMANTICS_HPP 36 #define WRITE_MULTIPORT(PORT,VAL) \ 37 for (int WMPi=0;WMPi<PORT.size();WMPi++) PORT[WMPi]->write(VAL); 39 #define WRITE_VEC_MULTIPORT(PORT,VEC) \ 40 for (int WMPi=0;WMPi<PORT.size();WMPi++) \ 41 for (auto WMPit=VEC.begin();WMPit!=VEC.end();WMPit++) \ 42 PORT[WMPi]->write(*WMPit); 52 virtual const char* token_type()
const = 0;
59 virtual std::string moc()
const = 0;
69 template <
typename T,
typename TokenType>
70 class signal:
public sc_fifo<TokenType>
71 #ifdef FORSYDE_INTROSPECTION 76 signal() : sc_fifo<TokenType>() {}
77 signal(sc_module_name name,
unsigned size) : sc_fifo<TokenType>(name, size) {}
78 #ifdef FORSYDE_INTROSPECTION 90 virtual const char* token_type()
const 92 return get_type_name<T>();
95 virtual std::string moc()
const = 0;
105 std::string portType;
116 virtual const char* token_type()
const = 0;
120 template <
typename T,
typename TokenType,
typename ChanType>
122 #ifdef FORSYDE_INTROSPECTION 127 in_port() : sc_fifo_in<TokenType>(){}
128 in_port(
const char* name) : sc_fifo_in<TokenType>(name){}
129 #ifdef FORSYDE_INTROSPECTION 136 void operator()(sc_fifo_in_if<TokenType>& i)
138 sc_fifo_in<TokenType>::operator()(i);
139 static_cast<ChanType&
>(i).iport =
this;
145 sc_fifo_in<TokenType>::operator()(p);
150 virtual const char* token_type()
const 152 return get_type_name<T>();
158 template <
typename T,
typename TokenType,
typename ChanType>
160 #ifdef FORSYDE_INTROSPECTION 165 out_port() : sc_fifo_out<TokenType>(){}
166 out_port(
const char* name) : sc_fifo_out<TokenType>(name){}
167 #ifdef FORSYDE_INTROSPECTION 174 void operator()(sc_fifo_out_if<TokenType>& i)
176 sc_fifo_out<TokenType>::operator()(i);
178 static_cast<ChanType&
>(i).oport =
this;
184 sc_fifo_out<TokenType>::operator()(p);
190 virtual const char* token_type()
const 192 return get_type_name<T>();
237 virtual void init() = 0;
243 virtual void prep() = 0;
250 virtual void exec() = 0;
256 virtual void prod() = 0;
262 virtual void clean() = 0;
270 #ifdef FORSYDE_INTROSPECTION 273 void end_of_elaboration()
283 virtual void bindInfo() = 0;
288 #ifdef FORSYDE_INTROSPECTION 289 std::vector<PortInfo> boundInChans;
292 std::vector<PortInfo> boundOutChans;
295 std::vector<std::tuple<std::string,std::string>> arg_vec;
309 virtual std::string forsyde_kind()
const = 0;
bound_type
Type of the object bound to a port.
Definition: abssemantics.hpp:45
void end_of_simulation()
This hook is used to run the clean stage.
Definition: abssemantics.hpp:265
sc_object * iport
Input port to which a channel is bound.
Definition: abssemantics.hpp:62
The namespace for ForSyDe.
Definition: abssemantics.hpp:30
A helper class used to provide introspective channels.
Definition: abssemantics.hpp:48
CT_in in_port
The CT::in_port is an alias for CT::CT_in.
Definition: ct_process.hpp:61
The in_port port is used for input ports of ForSyDe processes.
Definition: abssemantics.hpp:121
CT2CT signal
The CT::signal is an alias for CT::CT2CT.
Definition: ct_process.hpp:50
The UT_out port is used for output ports of UT processes.
Definition: abssemantics.hpp:159
sc_object * oport
Output port to which a channel is bound.
Definition: abssemantics.hpp:65
sc_object * bound_port
To which port it is bound (used for binding ports of composite processes in the hierarchy) ...
Definition: abssemantics.hpp:113
The process constructor which defines the abstract semantics of execution.
Definition: abssemantics.hpp:212
CT_out out_port
The CT::out_port is an alias for CT::CT_out.
Definition: ct_process.hpp:72
A helper class used to provide introspective ports.
Definition: abssemantics.hpp:109
This type is used in the process base class to store structural information.
Definition: abssemantics.hpp:100
process(sc_module_name _name)
The constructor requires the module name.
Definition: abssemantics.hpp:302
A ForSyDe signal is used to inter-connect processes.
Definition: abssemantics.hpp:70