cxxrtl: unbuffer output wires of toplevel module.
authorwhitequark <whitequark@whitequark.org>
Fri, 12 Jun 2020 00:05:05 +0000 (00:05 +0000)
committerwhitequark <whitequark@whitequark.org>
Fri, 12 Jun 2020 00:31:57 +0000 (00:31 +0000)
Without unbuffering output wires of, at least, toplevel modules, it
is not possible to have most designs that rely on IO via toplevel
ports (as opposed to using exclusively blackboxes) converge within
one delta cycle. That seriously impairs the performance of CXXRTL.

This commit avoids unbuffering outputs of all modules solely so that
in future, CXXRTL could gain fully separate compilation, and not for
any present technical reason.

backends/cxxrtl/cxxrtl_backend.cc

index 0a810b8d1ec2a03ee4188470814c2f06918b688c..c6b8bbc47a844c0c92bfc64715d6264958790cc2 100644 (file)
@@ -2154,7 +2154,7 @@ struct CxxrtlWorker {
 
                        for (auto wire : module->wires()) {
                                if (feedback_wires[wire]) continue;
-                               if (wire->port_output) continue;
+                               if (wire->port_output && !module->get_bool_attribute(ID::top)) continue;
                                if (wire->name.begins_with("$") && !unbuffer_internal) continue;
                                if (wire->name.begins_with("\\") && !unbuffer_public) continue;
                                if (flow.wire_sync_defs.count(wire) > 0) continue;