forked from github/verilator
Fix to string, msg1890.
This commit is contained in:
parent
2c9716c64c
commit
ae89e399a3
2
Changes
2
Changes
@ -21,6 +21,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||
|
||||
**** Fix core dump on Arch Linux/GCC 6.1.1, bug1058. [Jannis Harder]
|
||||
|
||||
**** Fix $value$plusargs to string, msg1890. [Frederic Requin]
|
||||
|
||||
|
||||
* Verilator 3.882 2016-03-01
|
||||
|
||||
|
@ -1077,6 +1077,14 @@ IData VL_TESTPLUSARGS_I(const char* formatp) {
|
||||
else return 1;
|
||||
}
|
||||
|
||||
IData VL_VALUEPLUSARGS_IN(int, const char* prefixp, char, string& ldr) {
|
||||
const string& match = VerilatedImp::argPlusMatch(prefixp);
|
||||
const char* dp = match.c_str() + 1 /*leading + */ + strlen(prefixp);
|
||||
if (match == "") return 0;
|
||||
ldr = string(dp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
IData VL_VALUEPLUSARGS_IW(int rbits, const char* prefixp, char fmt, WDataOutP rwp) {
|
||||
const string& match = VerilatedImp::argPlusMatch(prefixp);
|
||||
const char* dp = match.c_str() + 1 /*leading + */ + strlen(prefixp);
|
||||
|
@ -66,5 +66,6 @@ extern void VL_READMEM_N(bool hex, int width, int depth, int array_lsb, int fnwo
|
||||
extern IData VL_SSCANF_INX(int lbits, const string& ld, const char* formatp, ...);
|
||||
extern void VL_SFORMAT_X(int obits_ignored, string &output, const char* formatp, ...);
|
||||
extern string VL_SFORMATF_NX(const char* formatp, ...);
|
||||
extern IData VL_VALUEPLUSARGS_IN(int rbits, const char* prefixp, char fmt, string& ldr);
|
||||
|
||||
#endif // Guard
|
||||
|
@ -7,6 +7,7 @@ module t;
|
||||
|
||||
integer p_i;
|
||||
reg [7*8:1] p_str;
|
||||
string sv_str;
|
||||
|
||||
initial begin
|
||||
if ($test$plusargs("PLUS")!==1) $stop;
|
||||
@ -32,6 +33,10 @@ module t;
|
||||
$display("str='%s'",p_str);
|
||||
if (p_str !== "T=1234") $stop;
|
||||
|
||||
if ($value$plusargs("IN%s", sv_str)!==1) $stop;
|
||||
$display("str='%s'",sv_str);
|
||||
if (sv_str != "T=1234") $stop;
|
||||
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user