3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-28 03:15:50 +00:00

Added ScriptPass helper class for script-like passes

This commit is contained in:
Clifford Wolf 2016-03-31 11:16:34 +02:00
parent 6cafd08ac1
commit 2553319081
5 changed files with 255 additions and 251 deletions

View file

@ -31,6 +31,7 @@ struct Pass
virtual ~Pass();
virtual void help();
virtual void clear_flags();
virtual void execute(std::vector<std::string> args, RTLIL::Design *design) = 0;
int call_counter;
@ -63,6 +64,22 @@ struct Pass
static void done_register();
};
struct ScriptPass : Pass
{
bool block_active, help_mode;
RTLIL::Design *active_design;
std::string active_run_from, active_run_to;
ScriptPass(std::string name, std::string short_help = "** document me **") : Pass(name, short_help) { }
virtual void script() = 0;
bool check_label(std::string label, std::string info = std::string());
void run(std::string command, std::string info = std::string());
void run_script(RTLIL::Design *design, std::string run_from = std::string(), std::string run_to = std::string());
void help_script();
};
struct Frontend : Pass
{
// for reading of here documents