15 #ifndef UT_PROCESS_CONSTRUCTORS_HPP 16 #define UT_PROCESS_CONSTRUCTORS_HPP 44 template <
typename T0,
typename T1>
52 typedef std::function<void(std::vector<T0>&,
53 const std::vector<T1>&
61 comb(
const sc_module_name& _name,
63 const unsigned int& i1toks
64 ) :
ut_process(_name), iport1(
"iport1"), oport1(
"oport1"),
65 i1toks(i1toks), _func(_func)
67 #ifdef FORSYDE_INTROSPECTION 68 std::string func_name = std::string(basename());
69 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
70 arg_vec.push_back(std::make_tuple(
"_func",func_name+std::string(
"_func")));
71 arg_vec.push_back(std::make_tuple(
"i1toks",std::to_string(i1toks)));
83 std::vector<T0> o1vals;
84 std::vector<T1> i1vals;
92 i1vals.resize(i1toks);
97 for (
auto it=i1vals.begin();it!=i1vals.end();it++)
103 _func(o1vals, i1vals);
108 WRITE_VEC_MULTIPORT(oport1, o1vals)
114 #ifdef FORSYDE_INTROSPECTION 117 boundInChans.resize(1);
118 boundInChans[0].port = &iport1;
119 boundOutChans.resize(1);
120 boundOutChans[0].port = &oport1;
128 template <
typename T0,
typename T1,
typename T2>
137 typedef std::function<void(std::vector<T0>&,
138 const std::vector<T1>&,
139 const std::vector<T2>&
149 const unsigned int& i1toks,
150 const unsigned int& i2toks
151 ) :
ut_process(_name), iport1(
"iport1"), iport2(
"iport2"), oport1(
"oport1"),
152 i1toks(i1toks), i2toks(i2toks), _func(_func)
154 #ifdef FORSYDE_INTROSPECTION 155 std::string func_name = std::string(basename());
156 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
157 arg_vec.push_back(std::make_tuple(
"_func",func_name+std::string(
"_func")));
158 arg_vec.push_back(std::make_tuple(
"i1toks",std::to_string(i1toks)));
159 arg_vec.push_back(std::make_tuple(
"i2toks",std::to_string(i2toks)));
167 unsigned int i1toks, i2toks;
170 std::vector<T0> o1vals;
171 std::vector<T1> i1vals;
172 std::vector<T2> i2vals;
180 i1vals.resize(i1toks);
181 i2vals.resize(i2toks);
186 for (
auto it=i1vals.begin();it!=i1vals.end();it++)
188 for (
auto it=i2vals.begin();it!=i2vals.end();it++)
194 _func(o1vals, i1vals, i2vals);
199 WRITE_VEC_MULTIPORT(oport1, o1vals)
205 #ifdef FORSYDE_INTROSPECTION 208 boundInChans.resize(2);
209 boundInChans[0].port = &iport1;
210 boundInChans[1].port = &iport2;
211 boundOutChans.resize(1);
212 boundOutChans[0].port = &oport1;
220 template <
typename T0,
typename T1,
typename T2,
typename T3>
230 typedef std::function<void(std::vector<T0>&,
231 const std::vector<T1>&,
232 const std::vector<T2>&,
233 const std::vector<T3>&
243 const unsigned int& i1toks,
244 const unsigned int& i2toks,
245 const unsigned int& i3toks
246 ) :
ut_process(_name), iport1(
"iport1"), iport2(
"iport2"), iport3(
"iport3"),
248 i1toks(i1toks), i2toks(i2toks), i3toks(i3toks), _func(_func)
250 #ifdef FORSYDE_INTROSPECTION 251 std::string func_name = std::string(basename());
252 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
253 arg_vec.push_back(std::make_tuple(
"_func",func_name+std::string(
"_func")));
254 arg_vec.push_back(std::make_tuple(
"i1toks",std::to_string(i1toks)));
255 arg_vec.push_back(std::make_tuple(
"i2toks",std::to_string(i2toks)));
256 arg_vec.push_back(std::make_tuple(
"i3toks",std::to_string(i3toks)));
264 unsigned int i1toks, i2toks, i3toks;
267 std::vector<T0> o1vals;
268 std::vector<T1> i1vals;
269 std::vector<T2> i2vals;
270 std::vector<T3> i3vals;
278 i1vals.resize(i1toks);
279 i2vals.resize(i2toks);
280 i3vals.resize(i3toks);
285 for (
auto it=i1vals.begin();it!=i1vals.end();it++)
287 for (
auto it=i2vals.begin();it!=i2vals.end();it++)
289 for (
auto it=i3vals.begin();it!=i3vals.end();it++)
295 _func(o1vals, i1vals, i2vals, i3vals);
300 WRITE_VEC_MULTIPORT(oport1, o1vals)
306 #ifdef FORSYDE_INTROSPECTION 309 boundInChans.resize(3);
310 boundInChans[0].port = &iport1;
311 boundInChans[1].port = &iport2;
312 boundInChans[2].port = &iport3;
313 boundOutChans.resize(1);
314 boundOutChans[0].port = &oport1;
322 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
333 typedef std::function<void(std::vector<T0>&,
334 const std::vector<T1>&,
335 const std::vector<T2>&,
336 const std::vector<T3>&,
337 const std::vector<T4>&
347 const unsigned int& i1toks,
348 const unsigned int& i2toks,
349 const unsigned int& i3toks,
350 const unsigned int& i4toks
351 ) :
ut_process(_name), iport1(
"iport1"), iport2(
"iport2"), iport3(
"iport3"),
352 iport4(
"iport4"), oport1(
"oport1"),
353 i1toks(i1toks), i2toks(i2toks), i3toks(i3toks),
354 i4toks(i4toks), _func(_func)
356 #ifdef FORSYDE_INTROSPECTION 357 std::string func_name = std::string(basename());
358 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
359 arg_vec.push_back(std::make_tuple(
"_func",func_name+std::string(
"_func")));
360 arg_vec.push_back(std::make_tuple(
"i1toks",std::to_string(i1toks)));
361 arg_vec.push_back(std::make_tuple(
"i2toks",std::to_string(i2toks)));
362 arg_vec.push_back(std::make_tuple(
"i3toks",std::to_string(i3toks)));
363 arg_vec.push_back(std::make_tuple(
"i4toks",std::to_string(i4toks)));
371 unsigned int i1toks, i2toks, i3toks, i4toks;
374 std::vector<T0> o1vals;
375 std::vector<T1> i1vals;
376 std::vector<T2> i2vals;
377 std::vector<T3> i3vals;
378 std::vector<T4> i4vals;
386 i1vals.resize(i1toks);
387 i2vals.resize(i2toks);
388 i3vals.resize(i3toks);
389 i4vals.resize(i4toks);
394 for (
auto it=i1vals.begin();it!=i1vals.end();it++)
396 for (
auto it=i2vals.begin();it!=i2vals.end();it++)
398 for (
auto it=i3vals.begin();it!=i3vals.end();it++)
400 for (
auto it=i4vals.begin();it!=i4vals.end();it++)
406 _func(o1vals, i1vals, i2vals, i3vals, i4vals);
411 WRITE_VEC_MULTIPORT(oport1, o1vals)
417 #ifdef FORSYDE_INTROSPECTION 420 boundInChans.resize(4);
421 boundInChans[0].port = &iport1;
422 boundInChans[1].port = &iport2;
423 boundInChans[2].port = &iport3;
424 boundInChans[3].port = &iport4;
425 boundOutChans.resize(1);
426 boundOutChans[0].port = &oport1;
455 ) :
ut_process(_name), iport1(
"iport1"), oport1(
"oport1"),
458 #ifdef FORSYDE_INTROSPECTION 459 std::stringstream ss;
461 arg_vec.push_back(std::make_tuple(
"init_val", ss.str()));
479 WRITE_MULTIPORT(oport1, init_val)
484 *val = iport1.read();
491 WRITE_MULTIPORT(oport1, *val)
498 #ifdef FORSYDE_INTROSPECTION 501 boundInChans.resize(1);
502 boundInChans[0].port = &iport1;
503 boundOutChans.resize(1);
504 boundOutChans[0].port = &oport1;
531 const unsigned int& n
532 ) :
ut_process(_name), iport1(
"iport1"), oport1(
"oport1"),
533 init_val(init_val), ns(n)
535 #ifdef FORSYDE_INTROSPECTION 536 std::stringstream ss;
538 arg_vec.push_back(std::make_tuple(
"init_val", ss.str()));
539 arg_vec.push_back(std::make_tuple(
"n", std::to_string(n)));
558 for (
unsigned int i=0; i<ns; i++)
559 WRITE_MULTIPORT(oport1, init_val)
564 *val = iport1.read();
571 WRITE_MULTIPORT(oport1, *val)
578 #ifdef FORSYDE_INTROSPECTION 581 boundInChans.resize(1);
582 boundInChans[0].port = &iport1;
583 boundOutChans.resize(1);
584 boundOutChans[0].port = &oport1;
596 template <
class IT,
class ST>
607 typedef std::function<void(ST&, const ST&, const std::vector<IT>&)>
ns_functype;
614 scan(
const sc_module_name& _name,
615 const gamma_functype& _gamma_func,
618 ) :
ut_process(_name), _gamma_func(_gamma_func), _ns_func(_ns_func),
621 #ifdef FORSYDE_INTROSPECTION 622 std::string func_name = std::string(basename());
623 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
624 arg_vec.push_back(std::make_tuple(
"_gamma_func",func_name+std::string(
"_gamma_func")));
625 arg_vec.push_back(std::make_tuple(
"_ns_func",func_name+std::string(
"_ns_func")));
626 std::stringstream ss;
628 arg_vec.push_back(std::make_tuple(
"init_st",ss.str()));
637 gamma_functype _gamma_func;
643 std::vector<IT> ivals;
658 _gamma_func(itoks, *stval);
660 for (
auto it=ivals.begin();it!=ivals.end();it++)
666 _ns_func(*nsval, *stval, ivals);
672 WRITE_MULTIPORT(oport1, *stval)
680 #ifdef FORSYDE_INTROSPECTION 683 boundInChans.resize(1);
684 boundInChans[0].port = &iport1;
685 boundOutChans.resize(1);
686 boundOutChans[0].port = &oport1;
697 template <
class IT,
class ST>
708 typedef std::function<void(ST&, const ST&, const std::vector<IT>&)>
ns_functype;
716 const gamma_functype& _gamma_func,
719 ) :
ut_process(_name), _gamma_func(_gamma_func), _ns_func(_ns_func),
722 #ifdef FORSYDE_INTROSPECTION 723 std::string func_name = std::string(basename());
724 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
725 arg_vec.push_back(std::make_tuple(
"_gamma_func",func_name+std::string(
"_gamma_func")));
726 arg_vec.push_back(std::make_tuple(
"_ns_func",func_name+std::string(
"_ns_func")));
727 std::stringstream ss;
729 arg_vec.push_back(std::make_tuple(
"init_st",ss.str()));
738 gamma_functype _gamma_func;
746 std::vector<IT> ivals;
766 _gamma_func(itoks, *stval);
768 for (
auto it=ivals.begin();it!=ivals.end();it++)
778 _ns_func(*nsval, *stval, ivals);
789 WRITE_MULTIPORT(oport1, *stval)
797 #ifdef FORSYDE_INTROSPECTION 800 boundInChans.resize(1);
801 boundInChans[0].port = &iport1;
802 boundOutChans.resize(1);
803 boundOutChans[0].port = &oport1;
813 template <
class IT,
class ST,
class OT>
824 typedef std::function<void(ST&, const ST&, const std::vector<IT>&)>
ns_functype;
827 typedef std::function<void(std::vector<OT>&,
const ST&)>
od_functype;
835 const gamma_functype& _gamma_func,
839 ) :
ut_process(_name), _gamma_func(_gamma_func), _ns_func(_ns_func),
840 _od_func(_od_func), init_st(init_st)
842 #ifdef FORSYDE_INTROSPECTION 843 std::string func_name = std::string(basename());
844 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
845 arg_vec.push_back(std::make_tuple(
"_gamma_func",func_name+std::string(
"_gamma_func")));
846 arg_vec.push_back(std::make_tuple(
"_ns_func",func_name+std::string(
"_ns_func")));
847 arg_vec.push_back(std::make_tuple(
"_od_func",func_name+std::string(
"_od_func")));
848 std::stringstream ss;
850 arg_vec.push_back(std::make_tuple(
"init_st",ss.str()));
859 gamma_functype _gamma_func;
868 std::vector<IT> ivals;
871 std::vector<OT> ovals;
889 _gamma_func(itoks, *stval);
891 for (
auto it=ivals.begin();it!=ivals.end();it++)
901 _ns_func(*nsval, *stval, ivals);
902 _od_func(ovals, *stval);
908 _od_func(ovals, *stval);
914 WRITE_VEC_MULTIPORT(oport1, ovals)
923 #ifdef FORSYDE_INTROSPECTION 926 boundInChans.resize(1);
927 boundInChans[0].port = &iport1;
928 boundOutChans.resize(1);
929 boundOutChans[0].port = &oport1;
939 template <
class IT,
class ST,
class OT>
950 typedef std::function<void(ST&, const ST&, const std::vector<IT>&)>
ns_functype;
953 typedef std::function<void(std::vector<OT>&,
const ST&,
962 const gamma_functype& _gamma_func,
966 ) :
ut_process(_name), _gamma_func(_gamma_func), _ns_func(_ns_func),
967 _od_func(_od_func), init_st(init_st)
969 #ifdef FORSYDE_INTROSPECTION 970 std::string func_name = std::string(basename());
971 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
972 arg_vec.push_back(std::make_tuple(
"_gamma_func",func_name+std::string(
"_gamma_func")));
973 arg_vec.push_back(std::make_tuple(
"_ns_func",func_name+std::string(
"_ns_func")));
974 arg_vec.push_back(std::make_tuple(
"_od_func",func_name+std::string(
"_od_func")));
975 std::stringstream ss;
977 arg_vec.push_back(std::make_tuple(
"init_st",ss.str()));
986 gamma_functype _gamma_func;
993 std::vector<IT> ivals;
996 std::vector<OT> ovals;
1009 _gamma_func(itoks, *stval);
1010 ivals.resize(itoks);
1011 for (
auto it=ivals.begin();it!=ivals.end();it++)
1012 *it = iport1.read();
1017 _ns_func(*nsval, *stval, ivals);
1018 _od_func(ovals, *stval, ivals);
1024 WRITE_VEC_MULTIPORT(oport1, ovals)
1033 #ifdef FORSYDE_INTROSPECTION 1036 boundInChans.resize(1);
1037 boundInChans[0].port = &iport1;
1038 boundOutChans.resize(1);
1039 boundOutChans[0].port = &oport1;
1062 const unsigned long long& take=0
1064 init_val(init_val), take(take)
1067 #ifdef FORSYDE_INTROSPECTION 1068 std::stringstream ss;
1070 arg_vec.push_back(std::make_tuple(
"init_val", ss.str()));
1071 arg_vec.push_back(std::make_tuple(
"take", std::to_string(take)));
1080 unsigned long long take;
1082 unsigned long long tok_cnt;
1088 if (take==0) infinite =
true;
1098 if (tok_cnt++ < take || infinite)
1099 WRITE_MULTIPORT(oport1, init_val)
1105 #ifdef FORSYDE_INTROSPECTION 1108 boundOutChans.resize(1);
1109 boundOutChans[0].port = &oport1;
1134 const functype& _func,
1136 const unsigned long long& take=0
1138 init_st(init_val), take(take), _func(_func)
1140 #ifdef FORSYDE_INTROSPECTION 1141 std::string func_name = std::string(basename());
1142 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
1143 arg_vec.push_back(std::make_tuple(
"_func",func_name+std::string(
"_func")));
1144 std::stringstream ss;
1146 arg_vec.push_back(std::make_tuple(
"init_val", ss.str()));
1147 arg_vec.push_back(std::make_tuple(
"take", std::to_string(take)));
1156 unsigned long long take;
1159 unsigned long long tok_cnt;
1170 WRITE_MULTIPORT(oport1, *cur_st)
1171 if (take==0) infinite =
true;
1179 _func(*cur_st, *cur_st);
1184 if (tok_cnt++ < take || infinite)
1185 WRITE_MULTIPORT(oport1, *cur_st)
1194 #ifdef FORSYDE_INTROSPECTION 1197 boundOutChans.resize(1);
1198 boundOutChans[0].port = &oport1;
1208 template <
class OTYP>
1219 const std::vector<OTYP>& invec
1221 :sc_module(_name), in_vec(invec)
1226 std::vector<OTYP> in_vec;
1232 typename std::vector<OTYP>::iterator itr;
1233 for (itr=in_vec.begin();itr!=in_vec.end();itr++)
1235 OTYP out_val = *itr;
1236 WRITE_MULTIPORT(oport1,out_val)
1260 const functype& _func
1261 ) :
ut_process(_name), iport1(
"iport1"), _func(_func)
1264 #ifdef FORSYDE_INTROSPECTION 1265 std::string func_name = std::string(basename());
1266 func_name = func_name.substr(0, func_name.find_last_not_of(
"0123456789")+1);
1267 arg_vec.push_back(std::make_tuple(
"_func",func_name+std::string(
"_func")));
1288 *val = iport1.read();
1303 #ifdef FORSYDE_INTROSPECTION 1306 boundInChans.resize(1);
1307 boundInChans[0].port = &iport1;
1315 template <
class T1,
class T2>
1327 zip(
const sc_module_name& _name,
1328 const unsigned int& i1toks,
1329 const unsigned int& i2toks
1330 ) :
ut_process(_name), iport1(
"iport1"), iport2(
"iport2"), oport1(
"oport1"),
1331 i1toks(i1toks), i2toks(i2toks)
1338 unsigned int i1toks, i2toks;
1340 std::vector<T1> i1vals;
1341 std::vector<T2> i2vals;
1345 i1vals.resize(i1toks);
1346 i2vals.resize(i2toks);
1351 for (
auto it=i1vals.begin();it!=i1vals.end();it++)
1352 *it = iport1.read();
1353 for (
auto it=i2vals.begin();it!=i2vals.end();it++)
1354 *it = iport2.read();
1361 WRITE_MULTIPORT(oport1,std::make_tuple(i1vals,i2vals))
1366 #ifdef FORSYDE_INTROSPECTION 1369 boundInChans.resize(2);
1370 boundInChans[0].port = &iport1;
1371 boundInChans[1].port = &iport2;
1372 boundOutChans.resize(1);
1373 boundOutChans[0].port = &oport1;
1381 template <
class... Ts>
1393 const std::vector<unsigned>& in_toks)
1394 :
ut_process(_name), in_toks(in_toks), oport1(
"iport1")
1396 if (in_toks.size()!=
sizeof...(Ts))
1397 SC_REPORT_ERROR(name(),
"Wrong number of production rates provided");
1398 #ifdef FORSYDE_INTROSPECTION 1399 std::stringstream ss;
1401 arg_vec.push_back(std::make_tuple(
"itoks",ss.str()));
1408 std::vector<unsigned> in_toks;
1410 std::tuple<std::vector<Ts>...>* in_val;
1414 in_val =
new std::tuple<std::vector<Ts>...>;
1419 *in_val = sc_fifo_tuple_read<Ts...>(iport, in_toks);
1426 WRITE_MULTIPORT(oport1,*in_val);
1434 template<
size_t N,
class R,
class T>
1435 struct fifo_read_helper
1437 static void read(R& ret, T& t,
const std::vector<unsigned int>& itoks)
1439 fifo_read_helper<N-1,R,T>::read(ret,t,itoks);
1440 for (
unsigned int i=0;i<itoks[N];i++)
1441 std::get<N>(ret).push_back(std::get<N>(t).read());
1445 template<
class R,
class T>
1446 struct fifo_read_helper<0,R,T>
1448 static void read(R& ret, T& t,
const std::vector<unsigned int>& itoks)
1450 for (
unsigned int i=0;i<itoks[0];i++)
1451 std::get<0>(ret).push_back(std::get<0>(t).read());
1455 template<
class... T>
1456 std::tuple<std::vector<T>...> sc_fifo_tuple_read(std::tuple<
UT_in<T>...>& ports,
1457 const std::vector<unsigned int>& itoks)
1459 std::tuple<std::vector<T>...> ret;
1460 fifo_read_helper<
sizeof...(T)-1,
1461 std::tuple<std::vector<T>...>,
1462 std::tuple<
UT_in<T>...>>::read(ret,ports,itoks);
1466 #ifdef FORSYDE_INTROSPECTION 1469 boundInChans.resize(
sizeof...(Ts));
1470 register_ports(boundInChans, iport);
1471 boundOutChans.resize(1);
1472 boundInChans[0].port = &oport1;
1475 template<
size_t N,
class T>
1476 struct register_ports_helper
1478 static void reg_port(std::vector<PortInfo>& boundChans, T& t)
1480 register_ports_helper<N-1,T>::reg_port(boundChans,t);
1481 boundChans[N].port = &std::get<N>(t);
1486 struct register_ports_helper<0,T>
1488 static void reg_port(std::vector<PortInfo>& boundChans, T& t)
1490 boundChans[0].port = &std::get<0>(t);
1494 template<
class... T>
1495 void register_ports(std::vector<PortInfo>& boundChans,
1498 register_ports_helper<
sizeof...(T)-1,
1499 std::tuple<
UT_in<T>...>&>::reg_port(boundChans,ports);
1508 template <
class T1,
class T2>
1522 iport1(
"iport1"), oport1(
"oport1"), oport2(
"oport2") {}
1528 std::tuple<std::vector<T1>,std::vector<T2>>* in_val;
1532 in_val =
new std::tuple<std::vector<T1>,std::vector<T2>>;
1537 *in_val = iport1.read();
1545 WRITE_VEC_MULTIPORT(oport1,std::get<0>(*in_val))
1546 WRITE_VEC_MULTIPORT(oport2,std::get<1>(*in_val))
1554 #ifdef FORSYDE_INTROSPECTION 1557 boundInChans.resize(1);
1558 boundInChans[0].port = &iport1;
1559 boundOutChans.resize(2);
1560 boundOutChans[0].port = &oport1;
1561 boundOutChans[1].port = &oport2;
1569 template <
class... Ts>
1587 std::tuple<std::vector<Ts>...>* in_val;
1591 in_val =
new std::tuple<std::vector<Ts>...>;
1596 *in_val = iport1.read();
1603 fifo_tuple_write<Ts...>(*in_val, oport);
1611 template<
size_t N,
class R,
class T>
1612 struct fifo_write_helper
1614 static void write(
const R& vals, T& t)
1616 fifo_write_helper<N-1,R,T>::write(vals,t);
1617 for (
unsigned int i=0;i<(std::get<N>(vals)).size();i++)
1618 std::get<N>(t).write(std::get<N>(vals)[i]);
1622 template<
class R,
class T>
1623 struct fifo_write_helper<0,R,T>
1625 static void write(
const R& vals, T& t)
1627 for (
unsigned int i=0;i<(std::get<0>(vals)).size();i++)
1628 std::get<0>(t).write(std::get<0>(vals)[i]);
1632 template<
class... T>
1633 void fifo_tuple_write(
const std::tuple<std::vector<T>...>& vals,
1636 fifo_write_helper<
sizeof...(T)-1,
1637 std::tuple<std::vector<T>...>,
1638 std::tuple<
UT_out<T>...>>::write(vals,ports);
1641 #ifdef FORSYDE_INTROSPECTION 1644 boundInChans.resize(1);
1645 boundInChans[0].port = &iport1;
1646 boundOutChans.resize(
sizeof...(Ts));
1647 register_ports(boundOutChans, oport);
1650 template<
size_t N,
class T>
1651 struct register_ports_helper
1653 static void reg_port(std::vector<PortInfo>& boundChans, T& t)
1655 register_ports_helper<N-1,T>::reg_port(boundChans,t);
1656 boundChans[N].port = &std::get<N>(t);
1661 struct register_ports_helper<0,T>
1663 static void reg_port(std::vector<PortInfo>& boundChans, T& t)
1665 boundChans[0].port = &std::get<0>(t);
1669 template<
class... T>
1670 void register_ports(std::vector<PortInfo>& boundChans,
1673 register_ports_helper<
sizeof...(T)-1,
1674 std::tuple<
UT_out<T>...>&>::reg_port(boundChans,ports);
1719 *val = iport1.read();
1726 WRITE_MULTIPORT(oport1, *val)
1733 #ifdef FORSYDE_INTROSPECTION 1736 boundInChans.resize(1);
1737 boundInChans[0].port = &iport1;
1738 boundOutChans.resize(1);
1739 boundOutChans[0].port = &oport1;
UT_out< std::tuple< std::vector< Ts >... > > oport1
port for the output channel
Definition: ut_process_constructors.hpp:1386
UT_in< T > iport1
port for the input channel
Definition: ut_process_constructors.hpp:521
UT_out< std::tuple< std::vector< T1 >, std::vector< T2 > > > oport1
port for the output channel
Definition: ut_process_constructors.hpp:1321
UT_in< T1 > iport1
port for the input channel
Definition: ut_process_constructors.hpp:48
UT_in< T1 > iport1
port for the input channel 1
Definition: ut_process_constructors.hpp:1319
comb3(const sc_module_name &_name, const functype &_func, const unsigned int &i1toks, const unsigned int &i2toks, const unsigned int &i3toks)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:241
UT_in< IT > iport1
port for the input channel
Definition: ut_process_constructors.hpp:817
vsource(const sc_module_name &_name, const std::vector< OTYP > &invec)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1218
UT_in< T > iport1
port for the input channel
Definition: ut_process_constructors.hpp:1694
The zip process with two inputs and one output.
Definition: ut_process_constructors.hpp:1316
UT_in< T2 > iport2
port for the input channel 2
Definition: ut_process_constructors.hpp:1320
std::function< void(unsigned int &, const ST &)> gamma_functype
Type of the partitioning function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:947
The unzip process with one input and variable number of outputs.
Definition: ut_process_constructors.hpp:1570
std::tuple< UT_out< Ts >... > oport
tuple of ports for the output channels
Definition: ut_process_constructors.hpp:1574
UT_in< IT > iport1
port for the input channel
Definition: ut_process_constructors.hpp:600
std::function< void(std::vector< T0 > &, const std::vector< T1 > &)> functype
Type of the function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:54
UT_out< T0 > oport1
port for the output channel
Definition: ut_process_constructors.hpp:134
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1406
UT_in< std::tuple< std::vector< T1 >, std::vector< T2 > > > iport1
port for the input channel
Definition: ut_process_constructors.hpp:1512
std::function< void(ST &, const ST &, const std::vector< IT > &)> ns_functype
Type of the next-state function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:708
The namespace for ForSyDe.
Definition: abssemantics.hpp:30
Process constructor for a Mealy machine.
Definition: ut_process_constructors.hpp:940
std::function< void(unsigned int &, const ST &)> gamma_functype
Type of the partitioning function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:821
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:982
std::function< void(std::vector< T0 > &, const std::vector< T1 > &, const std::vector< T2 > &)> functype
Type of the function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:140
UT_out< ST > oport1
port for the output channel
Definition: ut_process_constructors.hpp:601
Process constructor for a fan-out process with one input and one output.
Definition: ut_process_constructors.hpp:1691
UT_in< T > iport1
port for the input channel
Definition: ut_process_constructors.hpp:445
std::function< void(std::vector< OT > &, const ST &)> od_functype
Type of the output-decoding function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:827
UT_out< T > oport1
port for the output channel
Definition: ut_process_constructors.hpp:522
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1272
UT_in< T2 > iport2
port for the input channel 2
Definition: ut_process_constructors.hpp:133
UT_out< T1 > oport1
port for the output channel 1
Definition: ut_process_constructors.hpp:1513
UT_in< T1 > iport1
port for the input channel 1
Definition: ut_process_constructors.hpp:132
UT_in< IT > iport1
port for the input channel
Definition: ut_process_constructors.hpp:943
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:261
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1705
Process constructor for a Moore machine.
Definition: ut_process_constructors.hpp:814
UT_out< T > oport1
port for the output channel
Definition: ut_process_constructors.hpp:1695
std::function< void(std::vector< T0 > &, const std::vector< T1 > &, const std::vector< T2 > &, const std::vector< T3 > &)> functype
Type of the function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:234
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:368
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1152
source(const sc_module_name &_name, const functype &_func, const T &init_val, const unsigned long long &take=0)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1133
zipN(const sc_module_name &_name, const std::vector< unsigned > &in_toks)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1392
The unzip process with one input and two outputs.
Definition: ut_process_constructors.hpp:1509
UT_out< T0 > oport1
port for the output channel
Definition: ut_process_constructors.hpp:330
mealy(const sc_module_name &_name, const gamma_functype &_gamma_func, const ns_functype &_ns_func, const od_functype &_od_func, const ST &init_st)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:961
UT_in< T3 > iport3
port for the input channel 3
Definition: ut_process_constructors.hpp:328
Process constructor for a combinational process with two inputs and one output.
Definition: ut_process_constructors.hpp:323
UT_out< OT > oport1
port for the output channel
Definition: ut_process_constructors.hpp:818
UT_in< T1 > iport1
port for the input channel 1
Definition: ut_process_constructors.hpp:224
sink(const sc_module_name &_name, const functype &_func)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1259
Implements the abstract process in the UT Model of Computation.
UT_out< ST > oport1
port for the output channel
Definition: ut_process_constructors.hpp:702
UT_out< T2 > oport2
port for the output channel 2
Definition: ut_process_constructors.hpp:1514
scand(const sc_module_name &_name, const gamma_functype &_gamma_func, const ns_functype &_ns_func, const ST &init_st)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:715
scan(const sc_module_name &_name, const gamma_functype &_gamma_func, const ns_functype &_ns_func, const ST &init_st)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:614
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1076
std::function< void(unsigned int &, const ST &)> gamma_functype
Type of the partitioning function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:705
UT_out< T0 > oport1
port for the output channel
Definition: ut_process_constructors.hpp:227
UT_out< T0 > oport1
port for the output channel
Definition: ut_process_constructors.hpp:49
Process constructor for a sink process.
Definition: ut_process_constructors.hpp:1247
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:633
UT_out< OT > oport1
port for the output channel
Definition: ut_process_constructors.hpp:944
std::function< void(const T &)> functype
Type of the function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:1253
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:734
UT_in< T4 > iport4
port for the input channel 4
Definition: ut_process_constructors.hpp:329
UT_in< IT > iport1
port for the input channel
Definition: ut_process_constructors.hpp:701
fanout(const sc_module_name &_name)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1701
comb(const sc_module_name &_name, const functype &_func, const unsigned int &i1toks)
The constructor requires the module name ad the number of tokens to be produced.
Definition: ut_process_constructors.hpp:61
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:164
Process constructor for a combinational process with two inputs and one output.
Definition: ut_process_constructors.hpp:221
moore(const sc_module_name &_name, const gamma_functype &_gamma_func, const ns_functype &_ns_func, const od_functype &_od_func, const ST &init_st)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:834
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1335
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:544
std::function< void(std::vector< T0 > &, const std::vector< T1 > &, const std::vector< T2 > &, const std::vector< T3 > &, const std::vector< T4 > &)> functype
Type of the function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:338
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:466
UT_in< T3 > iport3
port for the input channel 3
Definition: ut_process_constructors.hpp:226
std::function< void(std::vector< OT > &, const ST &, const std::vector< IT > &)> od_functype
Type of the output-decoding function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:954
The process constructor which defines the abstract semantics of execution.
Definition: abssemantics.hpp:212
Process constructor for a source process with vector input.
Definition: ut_process_constructors.hpp:1209
UT_in< T1 > iport1
port for the input channel 1
Definition: ut_process_constructors.hpp:326
UT_in< T2 > iport2
port for the input channel 2
Definition: ut_process_constructors.hpp:327
Process constructor for a scand process.
Definition: ut_process_constructors.hpp:698
Process constructor for a combinational process with two inputs and one output.
Definition: ut_process_constructors.hpp:129
sc_fifo_out< OTYP > oport1
port for the output channel
Definition: ut_process_constructors.hpp:1212
The zip process with variable number of inputs and one output.
Definition: ut_process_constructors.hpp:1382
UT_in< std::tuple< std::vector< Ts >... > > iport1
port for the input channel
Definition: ut_process_constructors.hpp:1573
constant(const sc_module_name &_name, const T &init_val, const unsigned long long &take=0)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1060
Process constructor for a constant source process.
Definition: ut_process_constructors.hpp:1051
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:855
std::function< void(ST &, const ST &, const std::vector< IT > &)> ns_functype
Type of the next-state function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:607
comb2(const sc_module_name &_name, const functype &_func, const unsigned int &i1toks, const unsigned int &i2toks)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:147
Process constructor for a n-delay element.
Definition: ut_process_constructors.hpp:518
comb4(const sc_module_name &_name, const functype &_func, const unsigned int &i1toks, const unsigned int &i2toks, const unsigned int &i3toks, const unsigned int &i4toks)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:345
delay(const sc_module_name &_name, const T &init_val)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:453
Process constructor for a delay element.
Definition: ut_process_constructors.hpp:442
Process constructor for a scan process.
Definition: ut_process_constructors.hpp:597
UT_in< T > iport1
port for the input channel
Definition: ut_process_constructors.hpp:1250
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:76
std::function< void(T &, const T &)> functype
Type of the function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:1127
Process constructor for a combinational process (actor) with one input and one output.
Definition: ut_process_constructors.hpp:45
zip(const sc_module_name &_name, const unsigned int &i1toks, const unsigned int &i2toks)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1327
std::function< void(unsigned int &, const ST &)> gamma_functype
Type of the partitioning function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:604
UT_in< T2 > iport2
port for the input channel 2
Definition: ut_process_constructors.hpp:225
delayn(const sc_module_name &_name, const T &init_val, const unsigned int &n)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:529
UT_out< T > oport1
port for the output channel
Definition: ut_process_constructors.hpp:1124
std::function< void(ST &, const ST &, const std::vector< IT > &)> ns_functype
Type of the next-state function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:950
std::function< void(ST &, const ST &, const std::vector< IT > &)> ns_functype
Type of the next-state function to be passed to the process constructor.
Definition: ut_process_constructors.hpp:824
UT_out< T > oport1
port for the output channel
Definition: ut_process_constructors.hpp:1054
unzip(const sc_module_name &_name)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1520
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1525
unzipN(const sc_module_name &_name)
The constructor requires the module name.
Definition: ut_process_constructors.hpp:1580
std::string forsyde_kind() const
Specifying from which process constructor is the module built.
Definition: ut_process_constructors.hpp:1584
std::tuple< UT_in< Ts >... > iport
tuple of ports for the input channels
Definition: ut_process_constructors.hpp:1385
UT_out< T > oport1
port for the output channel
Definition: ut_process_constructors.hpp:446
Process constructor for a source process.
Definition: ut_process_constructors.hpp:1121