From d5ecd4a570a34f5315824a5bfbd740f7fb1866fa Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 12 Jun 2020 00:35:18 +0000 Subject: [PATCH] cxxrtl: annotate port direction as comments. --- backends/cxxrtl/cxxrtl_backend.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc index c6b8bbc47..a4ef38128 100644 --- a/backends/cxxrtl/cxxrtl_backend.cc +++ b/backends/cxxrtl/cxxrtl_backend.cc @@ -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)); -- 2.30.2