diff options
| author | Clifford Wolf <clifford@clifford.at> | 2016-09-19 10:20:20 +0200 | 
|---|---|---|
| committer | Clifford Wolf <clifford@clifford.at> | 2016-09-19 10:20:20 +0200 | 
| commit | 5e155aa1214a586e0db50c27e9b487915032f08e (patch) | |
| tree | f1c7358b6601f6f61ee781cf5d41b5856681070b /passes/tests | |
| parent | aaa99c35bdcde8bec9d44ca23814f323a4e09c75 (diff) | |
| download | yosys-5e155aa1214a586e0db50c27e9b487915032f08e.tar.gz yosys-5e155aa1214a586e0db50c27e9b487915032f08e.tar.bz2 yosys-5e155aa1214a586e0db50c27e9b487915032f08e.zip | |
Avoid creating very long strings in test_autotb
Diffstat (limited to 'passes/tests')
| -rw-r--r-- | passes/tests/test_autotb.cc | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/passes/tests/test_autotb.cc b/passes/tests/test_autotb.cc index 69e2e76d7..a0b47df8c 100644 --- a/passes/tests/test_autotb.cc +++ b/passes/tests/test_autotb.cc @@ -220,19 +220,21 @@ static void autotest(std::ostream &f, RTLIL::Design *design, int num_iter, int s  			for (auto it = signal_in.begin(); it != signal_in.end(); it++) {  				f << stringf("%s %s", it == signal_in.begin() ? "" : ",", it->first.c_str());  				int len = it->second; +				header2 += ", \"";  				if (len > 1)  					header2 += "/", len--;  				while (len > 1)  					header2 += "-", len--;  				if (len > 0)  					header2 += shorthand, len--; +				header2 += "\"";  				header1.push_back("    " + it->first);  				header1.back()[0] = shorthand;  				shorthand = shorthand == 'Z' ? 'A' : shorthand+1;  			}  		else {  			f << stringf(" 1'bx"); -			header2 += "#"; +			header2 += ", \"#\"";  		}  		f << stringf(" }, {");  		header2 += " "; @@ -240,19 +242,21 @@ static void autotest(std::ostream &f, RTLIL::Design *design, int num_iter, int s  			for (auto it = signal_clk.begin(); it != signal_clk.end(); it++) {  				f << stringf("%s %s", it == signal_clk.begin() ? "" : ",", it->first.c_str());  				int len = it->second; +				header2 += ", \"";  				if (len > 1)  					header2 += "/", len--;  				while (len > 1)  					header2 += "-", len--;  				if (len > 0)  					header2 += shorthand, len--; +				header2 += "\"";  				header1.push_back("    " + it->first);  				header1.back()[0] = shorthand;  				shorthand = shorthand == 'Z' ? 'A' : shorthand+1;  			}  		} else {  			f << stringf(" 1'bx"); -			header2 += "#"; +			header2 += ", \"#\"";  		}  		f << stringf(" }, {");  		header2 += " "; @@ -260,19 +264,21 @@ static void autotest(std::ostream &f, RTLIL::Design *design, int num_iter, int s  			for (auto it = signal_out.begin(); it != signal_out.end(); it++) {  				f << stringf("%s %s", it == signal_out.begin() ? "" : ",", it->first.c_str());  				int len = it->second; +				header2 += ", \"";  				if (len > 1)  					header2 += "/", len--;  				while (len > 1)  					header2 += "-", len--;  				if (len > 0)  					header2 += shorthand, len--; +				header2 += "\"";  				header1.push_back("    " + it->first);  				header1.back()[0] = shorthand;  				shorthand = shorthand == 'Z' ? 'A' : shorthand+1;  			}  		} else {  			f << stringf(" 1'bx"); -			header2 += "#"; +			header2 += ", \"#\"";  		}  		f << stringf(" }, $time, i);\n");  		f << stringf("end\n"); @@ -284,7 +290,7 @@ static void autotest(std::ostream &f, RTLIL::Design *design, int num_iter, int s  		for (auto &hdr : header1)  			f << stringf("\t$fdisplay(file, \"#OUT#   %s\");\n", hdr.c_str());  		f << stringf("\t$fdisplay(file, \"#OUT#\");\n"); -		f << stringf("\t$fdisplay(file, \"#OUT# %s\");\n", header2.c_str()); +		f << stringf("\t$fdisplay(file, {\"#OUT# \"%s});\n", header2.c_str());  		f << stringf("end\n");  		f << stringf("endtask\n\n"); | 
