3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-13 07:56:40 +00:00

YosysJS stuff

This commit is contained in:
Clifford Wolf 2015-02-19 13:36:54 +01:00
parent 08c0fe164f
commit e0e6d130cd
7 changed files with 156 additions and 16 deletions

View file

@ -78,6 +78,7 @@ USING_YOSYS_NAMESPACE
extern "C" int main(int, char**);
extern "C" void run(const char*);
extern "C" const char *errmsg();
extern "C" const char *prompt();
int main(int, char**)
@ -92,7 +93,21 @@ int main(int, char**)
void run(const char *command)
{
run_pass(command);
int selSize = GetSize(yosys_get_design()->selection_stack);
try {
log_last_error = "Internal error (see JavaScript console for details)";
run_pass(command);
log_last_error = "";
} catch (...) {
while (GetSize(yosys_get_design()->selection_stack) > selSize)
yosys_get_design()->selection_stack.pop_back();
throw;
}
}
const char *errmsg()
{
return log_last_error.c_str();
}
const char *prompt()