parent
ac4ec87942
commit
eeef5ab4de
|
|
@ -33,6 +33,7 @@ Gianfranco Costamagna
|
||||||
Glen Gibb
|
Glen Gibb
|
||||||
Graham Rushton
|
Graham Rushton
|
||||||
Guokai Chen
|
Guokai Chen
|
||||||
|
Gustav Svensk
|
||||||
Harald Heckmann
|
Harald Heckmann
|
||||||
Howard Su
|
Howard Su
|
||||||
Huang Rui
|
Huang Rui
|
||||||
|
|
|
||||||
|
|
@ -1459,11 +1459,12 @@ void VL_SFORMAT_X(int obits, void* destp, const char* formatp, ...) VL_MT_SAFE {
|
||||||
|
|
||||||
void VL_SFORMAT_X(int obits_ignored, std::string& output, const char* formatp, ...) VL_MT_SAFE {
|
void VL_SFORMAT_X(int obits_ignored, std::string& output, const char* formatp, ...) VL_MT_SAFE {
|
||||||
if (obits_ignored) {}
|
if (obits_ignored) {}
|
||||||
output = "";
|
std::string temp_output;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, formatp);
|
va_start(ap, formatp);
|
||||||
_vl_vsformat(output, formatp, ap);
|
_vl_vsformat(temp_output, formatp, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
output = temp_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VL_SFORMATF_NX(const char* formatp, ...) VL_MT_SAFE {
|
std::string VL_SFORMATF_NX(const char* formatp, ...) VL_MT_SAFE {
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,12 @@ module t;
|
||||||
$swriteo(str2, 4'd12);
|
$swriteo(str2, 4'd12);
|
||||||
if (str2 != "14") $stop;
|
if (str2 != "14") $stop;
|
||||||
|
|
||||||
|
str3 = "foo";
|
||||||
|
$sformat(str3, "%s", str3); // $sformat twice so verilator does not
|
||||||
|
$sformat(str3, "%s", str3); // optimize the call to $sformat(str3, "%s", "foo")
|
||||||
|
`ifdef TEST_VERBOSE $display("str3=%0s", str3); `endif
|
||||||
|
if (str3 != "foo") $stop;
|
||||||
|
|
||||||
$write("*-* All Finished *-*\n");
|
$write("*-* All Finished *-*\n");
|
||||||
$finish;
|
$finish;
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue