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

Added log_cmd_error_expection

This commit is contained in:
Clifford Wolf 2014-07-27 12:04:12 +02:00
parent 7661ded8dd
commit d878fcbdc7
4 changed files with 7 additions and 8 deletions

View file

@ -141,9 +141,9 @@ static void run_frontend(std::string filename, std::string command, RTLIL::Desig
Pass::call(design, command); Pass::call(design, command);
} }
} }
catch (...) { catch (log_cmd_error_expection) {
Frontend::current_script_file = backup_script_file; Frontend::current_script_file = backup_script_file;
std::rethrow_exception(std::current_exception()); throw log_cmd_error_expection();
} }
Frontend::current_script_file = backup_script_file; Frontend::current_script_file = backup_script_file;
@ -329,7 +329,7 @@ static void shell(RTLIL::Design *design)
try { try {
assert(design->selection_stack.size() == 1); assert(design->selection_stack.size() == 1);
Pass::call(design, command); Pass::call(design, command);
} catch (int) { } catch (log_cmd_error_expection) {
while (design->selection_stack.size() > 1) while (design->selection_stack.size() > 1)
design->selection_stack.pop_back(); design->selection_stack.pop_back();
log_reset_stack(); log_reset_stack();

View file

@ -160,7 +160,7 @@ void log_cmd_error(const char *format, ...)
log("ERROR: "); log("ERROR: ");
logv(format, ap); logv(format, ap);
log_flush(); log_flush();
throw 0; throw log_cmd_error_expection();
} }
logv_error(format, ap); logv_error(format, ap);

View file

@ -34,6 +34,8 @@
#define S__LINE__sub1(x) S__LINE__sub2(x) #define S__LINE__sub1(x) S__LINE__sub2(x)
#define S__LINE__ S__LINE__sub1(__LINE__) #define S__LINE__ S__LINE__sub1(__LINE__)
struct log_cmd_error_expection { };
extern std::vector<FILE*> log_files; extern std::vector<FILE*> log_files;
extern FILE *log_errfile; extern FILE *log_errfile;
extern bool log_time; extern bool log_time;

View file

@ -32,10 +32,7 @@
* Convert a signal into a KISS-compatible textual representation. * Convert a signal into a KISS-compatible textual representation.
*/ */
std::string kiss_convert_signal(const RTLIL::SigSpec &sig) { std::string kiss_convert_signal(const RTLIL::SigSpec &sig) {
if (!sig.is_fully_const()) { log_assert(sig.is_fully_const());
throw 0;
}
return sig.as_const().as_string(); return sig.as_const().as_string();
} }