mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-05 13:56:04 +00:00
Merge 6da26921d8 into 1598771a37
This commit is contained in:
commit
9f08ea13ef
3 changed files with 27 additions and 3 deletions
|
|
@ -167,7 +167,7 @@ int run_command(const std::string &command, std::function<void(const std::string
|
|||
return -1;
|
||||
|
||||
std::string line;
|
||||
char logbuf[128];
|
||||
char logbuf[128]={0,};
|
||||
while (fgets(logbuf, 128, f) != NULL) {
|
||||
line += logbuf;
|
||||
if (!line.empty() && line.back() == '\n')
|
||||
|
|
@ -696,8 +696,10 @@ static void handle_label(std::string &command, bool &from_to_active, const std::
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> log_line_number;
|
||||
bool run_frontend(std::string filename, std::string command, RTLIL::Design *design, std::string *from_to_label)
|
||||
{
|
||||
log_line_number.clear();
|
||||
if (design == nullptr)
|
||||
design = yosys_design;
|
||||
|
||||
|
|
@ -742,7 +744,6 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
|
|||
{
|
||||
std::string run_from, run_to;
|
||||
bool from_to_active = true;
|
||||
|
||||
if (from_to_label != NULL) {
|
||||
size_t pos = from_to_label->find(':');
|
||||
if (pos == std::string::npos) {
|
||||
|
|
@ -767,13 +768,19 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
|
|||
if (f == NULL)
|
||||
log_error("Can't open script file `%s' for reading: %s\n", filename, strerror(errno));
|
||||
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Running " << command << " on file '" << filename << "'";
|
||||
log_line_number.push_back(ss.str());
|
||||
}
|
||||
FILE *backup_script_file = Frontend::current_script_file;
|
||||
Frontend::current_script_file = f;
|
||||
|
||||
try {
|
||||
std::string command;
|
||||
while (fgetline(f, command)) {
|
||||
while (!command.empty() && command[command.size()-1] == '\\') {
|
||||
log_line_number.push_back(command);
|
||||
while (!command.empty() && command[command.size()-1] == '\\') {
|
||||
std::string next_line;
|
||||
if (!fgetline(f, next_line))
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue