Skip to content

Question regarding expected behaviour when user-defined top-module identifier is provided #265

Open
@TooMuchDakka

Description

@TooMuchDakka

Section 2.1 "Module and Signal declarations" of RevLib 2.0.1 states:
"The top-module of a program is defined by the special identifier main. If no module with this name exists, the last module declared is used instead by convention."

While looking through the code of the synthesis base class implementation the following lines raised the question:

auto mainModule = get<std::string>(settings, "main_module", std::string());

// get the main module
Module::ptr main;

if (!mainModule.empty()) {
    main = program.findModule(mainModule);
    if (!main) {
        std::cerr << "Program has no module: " << mainModule << "\n";
        return false;
    }
} else {
    main = program.findModule("main");
    if (!main) {
        main = program.modules().front();
    }
}
  • It seems that currently the user is able to specify the expected identifier of the top-module via the syrec::Settings class. Is this a custom extension since this is not specified in RevLib?
  • A SyReC program for which no module matching the user defined top-module identifier is found cannot be synthesized which differs from the behaviour when no expected top-module identifier is defined and no module with identifier "main" is found. Is this expected behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Anything related to C++ codedocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions