3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-06-01 14:47:53 +00:00

Update documentation/demos based on cleanup

This commit is contained in:
Miodrag Milanovic 2026-05-18 09:13:46 +02:00
parent 75dcbe03c6
commit 35d13e1c32
3 changed files with 9 additions and 10 deletions

View file

@ -24,19 +24,19 @@ struct FunctionalDummyBackend : public Backend {
// write node functions // write node functions
for (auto node : ir) for (auto node : ir)
*f << " assign " << id2cstr(node.name()) *f << " assign " << node.name().unescape()
<< " = " << node.to_string() << "\n"; << " = " << node.to_string() << "\n";
*f << "\n"; *f << "\n";
// write outputs and next state // write outputs and next state
for (auto output : ir.outputs()) for (auto output : ir.outputs())
*f << " " << id2cstr(output->kind) *f << " " << output->kind.unescape()
<< " " << id2cstr(output->name) << " " << output->name.unescape()
<< " = " << id2cstr(output->value().name()) << "\n"; << " = " << output->value().name().unescape() << "\n";
for (auto state : ir.states()) for (auto state : ir.states())
*f << " " << id2cstr(state->kind) *f << " " << state->kind.unescape()
<< " " << id2cstr(state->name) << " " << state->name.unescape()
<< " = " << id2cstr(state->next_value().name()) << "\n"; << " = " << state->next_value().name().unescape() << "\n";
} }
} }
} FunctionalDummyBackend; } FunctionalDummyBackend;

View file

@ -230,8 +230,7 @@ Use ``log_error()`` to report a non-recoverable error:
.. code:: C++ .. code:: C++
if (design->modules.count(module->name) != 0) if (design->modules.count(module->name) != 0)
log_error("A module with the name %s already exists!\n", log_error("A module with the name %s already exists!\n", module);
RTLIL::id2cstr(module->name));
Use ``log_cmd_error()`` to report a recoverable error: Use ``log_cmd_error()`` to report a recoverable error:

View file

@ -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 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 ``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 ``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())``; ``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 while ``args`` is the zero or more arguments passed to the function, most