-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSourceReactor.hh
42 lines (33 loc) · 1.23 KB
/
SourceReactor.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <reactor-sdk/reactor-sdk.hh>
using namespace std;
using namespace sdk;
class SourceReactor : public Reactor {
public:
struct Parameters : public SystemParametersStandalone<int> {
REACTOR_PARAMETER(int, iterations, "Number of iterations", 1, 100, 10);
REACTOR_PARAMETER(int, n_ports, "Size of multiports", 1, 10, 1);
Parameters(Reactor *container)
: SystemParametersStandalone<int>(container) {
register_parameters (iterations, n_ports);
}
};
private:
LogicalAction<int> sch{"sch", this};
Parameters parameters{this};
REACTION_SCOPE_START(SourceReactor, Parameters)
std::string name = "Source";
int itr = 0;
int rsp_itr = 0;
void add_reactions(SourceReactor *reactor);
REACTION_SCOPE_END(this, parameters)
public:
SourceReactor(const std::string &name, Environment *env)
: Reactor(name, env) {}
SourceReactor(const std::string &name, Reactor *container)
: Reactor(name, container) {}
MultiportInput<int> rsp{"rsp", this};
MultiportOutput<int> req{"req", this};
void construction() override;
void wiring() override;
};