Go to the documentation of this file.
19 #include <catch2/catch.hpp>
21 SCENARIO(
"createMappingGraphFromConfig tests") {
22 GIVEN(
"an empty mapping") {
25 Mapping mapping(
nullptr, 1, og);
28 Module fillerMod(
"Mod",
"");
36 WHEN(
"a simple config graph is given") {
40 {
"maps_to_op",
"op_a"},
46 {
"maps_to_val",
"op_a_out"},
52 {
"maps_to_val",
"op_a_out"},
58 {
"maps_to_op",
"op_b"},
69 THEN(
"Mapping should be as expected") {
74 std::set<MRRG::NodeDescriptor> expected = std::set<MRRG::NodeDescriptor>{m2, m3};
75 const auto actual = std::set<MRRG::NodeDescriptor>(mapping.
getMapping()[og->getVal(
"op_a_out")].begin(), mapping.
getMapping()[og->getVal(
"op_a_out")].end());
76 CHECK(expected == actual);
81 CHECK(cmg.mg.fanout(cmg.fromMRRG[m1])[0] == cmg.fromMRRG[m2]);
82 CHECK(cmg.mg.fanout(cmg.fromMRRG[m2])[0] == cmg.fromMRRG[m3]);
83 CHECK(cmg.mg.fanout(cmg.fromMRRG[m3])[0] == cmg.fromMRRG[m4]);
MRRG::NodeDescriptor getSingleMapping(OpGraph::NodeDescriptor key) const
std::map< OpGraph::NodeDescriptor, std::vector< MRRG::NodeDescriptor > > & getMapping()
std::pair< NodeDescriptor, bool > insert(MRRGNode node)
OpGraph makeDFG_Linear3Node()
static MRRGNode make_function(Module *parent, int bitwidth, int cycle, STR &&name, int latency, SupportedOps supported_ops, int max_cap=1, bool is_const_unit=false)
SCENARIO("createMappingGraphFromConfig tests")
std::pair< VertexID, bool > insert(std::string name, ConfigStore vertex_attrs={})
EdgeID link(VertexID source, VertexID target, ConfigStore edge_attrs={})
CreateMappingGraphResult createMappingGraphFromConfig(Mapping &m, const ConfigGraph &config, const OpGraph &opgraph, const MRRG &mrrg)
static MRRGNode make_routing(Module *parent, int bitwidth, int cycle, STR &&name, int latency=0, int max_cap=1)