Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: azonenberg/yosys
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8f8baccfde62
Choose a base ref
...
head repository: azonenberg/yosys
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 155a80dfb78d
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Jun 20, 2017

  1. Copy the full SHA
    f6421c8 View commit details
  2. Copy the full SHA
    c0ca994 View commit details
  3. Copy the full SHA
    1f517d2 View commit details
  4. Copy the full SHA
    155a80d View commit details
Showing with 238 additions and 175 deletions.
  1. +29 −20 kernel/driver.cc
  2. +4 −0 kernel/log.cc
  3. +1 −0 kernel/log.h
  4. +204 −155 passes/techmap/abc.cc
49 changes: 29 additions & 20 deletions kernel/driver.cc
Original file line number Diff line number Diff line change
@@ -119,6 +119,29 @@ const char *prompt()

#else /* EMSCRIPTEN */

#ifdef YOSYS_ENABLE_READLINE
int yosys_history_offset = 0;
std::string yosys_history_file;
#endif

void yosys_atexit()
{
#ifdef YOSYS_ENABLE_READLINE
if (!yosys_history_file.empty()) {
if (yosys_history_offset > 0) {
history_truncate_file(yosys_history_file.c_str(), 100);
append_history(where_history() - yosys_history_offset, yosys_history_file.c_str());
} else
write_history(yosys_history_file.c_str());
}

clear_history();
HIST_ENTRY **hist_list = history_list();
if (hist_list != NULL)
free(hist_list);
#endif
}

int main(int argc, char **argv)
{
std::string frontend_command = "auto";
@@ -137,12 +160,10 @@ int main(int argc, char **argv)
bool mode_q = false;

#ifdef YOSYS_ENABLE_READLINE
int history_offset = 0;
std::string history_file;
if (getenv("HOME") != NULL) {
history_file = stringf("%s/.yosys_history", getenv("HOME"));
read_history(history_file.c_str());
history_offset = where_history();
yosys_history_file = stringf("%s/.yosys_history", getenv("HOME"));
read_history(yosys_history_file.c_str());
yosys_history_offset = where_history();
}
#endif

@@ -379,6 +400,7 @@ int main(int argc, char **argv)
log_hasher = new SHA1;

yosys_setup();
log_error_atexit = yosys_atexit;

for (auto &fn : plugin_filenames)
load_plugin(fn, {});
@@ -509,25 +531,12 @@ int main(int argc, char **argv)
}
#endif

yosys_atexit();

memhasher_off();
if (call_abort)
abort();

#ifdef YOSYS_ENABLE_READLINE
if (!history_file.empty()) {
if (history_offset > 0) {
history_truncate_file(history_file.c_str(), 100);
append_history(where_history() - history_offset, history_file.c_str());
} else
write_history(history_file.c_str());
}

clear_history();
HIST_ENTRY **hist_list = history_list();
if (hist_list != NULL)
free(hist_list);
#endif

log_flush();
#if defined(_MSC_VER)
_exit(0);
4 changes: 4 additions & 0 deletions kernel/log.cc
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ bool log_cmd_error_throw = false;
bool log_quiet_warnings = false;
int log_verbose_level;
string log_last_error;
void (*log_error_atexit)() = NULL;

vector<int> header_count;
pool<RTLIL::IdString> log_id_cache;
@@ -244,6 +245,9 @@ void logv_error(const char *format, va_list ap)
log("ERROR: %s", log_last_error.c_str());
log_flush();

if (log_error_atexit)
log_error_atexit();

#ifdef EMSCRIPTEN
log_files = backup_log_files;
throw 0;
1 change: 1 addition & 0 deletions kernel/log.h
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ extern bool log_cmd_error_throw;
extern bool log_quiet_warnings;
extern int log_verbose_level;
extern string log_last_error;
extern void (*log_error_atexit)();

void logv(const char *format, va_list ap);
void logv_header(RTLIL::Design *design, const char *format, va_list ap);
Loading