Difference between revisions of "Prettyprint to a string"
From Verific Design Automation FAQ
(Created page with "'''Q: Why do I prettyprint a Verilog parsetree node to a string?''' Example code: VeriExpression *init_value = param_id -> GetInitialValue(); if (init_value)...") |
(No difference)
|
Revision as of 15:43, 26 October 2016
Q: Why do I prettyprint a Verilog parsetree node to a string?
Example code:
VeriExpression *init_value = param_id -> GetInitialValue(); if (init_value) { ostringstream os; init_value->PrettyPrint(os, 0); char *to_string = Strings::save(os.str().c_str()) ; cout << "*** initial value: " << to_string << " ***\n"; Strings::free(to_string); }