cxxrtl: annotate port direction as comments.
authorwhitequark <whitequark@whitequark.org>
Fri, 12 Jun 2020 00:35:18 +0000 (00:35 +0000)
committerwhitequark <whitequark@whitequark.org>
Fri, 12 Jun 2020 00:35:18 +0000 (00:35 +0000)
backends/cxxrtl/cxxrtl_backend.cc

index c6b8bbc47a844c0c92bfc64715d6264958790cc2..a4ef38128d89f54375435b8be6303edf2bbcf28f 100644 (file)
@@ -1448,7 +1448,14 @@ struct CxxrtlWorker {
                        }
 
                        dump_attrs(wire);
-                       f << indent << (unbuffered_wires[wire] ? "value" : "wire") << "<" << width << "> " << mangle(wire);
+                       f << indent;
+                       if (wire->port_input && wire->port_output)
+                               f << "/*inout*/ ";
+                       else if (wire->port_input)
+                               f << "/*input*/ ";
+                       else if (wire->port_output)
+                               f << "/*output*/ ";
+                       f << (unbuffered_wires[wire] ? "value" : "wire") << "<" << width << "> " << mangle(wire);
                        if (wire->has_attribute(ID::init)) {
                                f << " ";
                                dump_const_init(wire->attributes.at(ID::init));