diff --git a/docs/source/code_examples/functional/dummy.cc b/docs/source/code_examples/functional/dummy.cc index 42b05b339..a339bc275 100644 --- a/docs/source/code_examples/functional/dummy.cc +++ b/docs/source/code_examples/functional/dummy.cc @@ -24,19 +24,19 @@ struct FunctionalDummyBackend : public Backend { // write node functions for (auto node : ir) - *f << " assign " << id2cstr(node.name()) + *f << " assign " << node.name().unescape() << " = " << node.to_string() << "\n"; *f << "\n"; // write outputs and next state for (auto output : ir.outputs()) - *f << " " << id2cstr(output->kind) - << " " << id2cstr(output->name) - << " = " << id2cstr(output->value().name()) << "\n"; + *f << " " << output->kind.unescape() + << " " << output->name.unescape() + << " = " << output->value().name().unescape() << "\n"; for (auto state : ir.states()) - *f << " " << id2cstr(state->kind) - << " " << id2cstr(state->name) - << " = " << id2cstr(state->next_value().name()) << "\n"; + *f << " " << state->kind.unescape() + << " " << state->name.unescape() + << " = " << state->next_value().name().unescape() << "\n"; } } } FunctionalDummyBackend; diff --git a/docs/source/yosys_internals/extending_yosys/extensions.rst b/docs/source/yosys_internals/extending_yosys/extensions.rst index 74a7d72d6..949c78586 100644 --- a/docs/source/yosys_internals/extending_yosys/extensions.rst +++ b/docs/source/yosys_internals/extending_yosys/extensions.rst @@ -230,8 +230,7 @@ Use ``log_error()`` to report a non-recoverable error: .. code:: C++ if (design->modules.count(module->name) != 0) - log_error("A module with the name %s already exists!\n", - RTLIL::id2cstr(module->name)); + log_error("A module with the name %s already exists!\n", module); Use ``log_cmd_error()`` to report a recoverable error: diff --git a/docs/source/yosys_internals/extending_yosys/functional_ir.rst b/docs/source/yosys_internals/extending_yosys/functional_ir.rst index 4f363623e..1c4ab5281 100644 --- a/docs/source/yosys_internals/extending_yosys/functional_ir.rst +++ b/docs/source/yosys_internals/extending_yosys/functional_ir.rst @@ -181,7 +181,7 @@ pointer ``f`` to the output file, or stdout if none is given. For this minimal example all we are doing is printing out each node. The ``node.name()`` method returns an ``RTLIL::IdString``, which we convert for -printing with ``id2cstr()``. Then, to print the function of the node, we use +printing with ``unescape()``. Then, to print the function of the node, we use ``node.to_string()`` which gives us a string of the form ``function(args)``. The ``function`` part is the result of ``Functional::IR::fn_to_string(node.fn())``; while ``args`` is the zero or more arguments passed to the function, most