From d3229b906832a85a7465cd3fc39424d894b849e8 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 6 Mar 2015 16:58:22 +0100 Subject: [PATCH] vhdlpp: 'string' type is emitted as 'string' instead of 'array <> of character'. --- vhdlpp/vtype_stream.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vhdlpp/vtype_stream.cc b/vhdlpp/vtype_stream.cc index 6d24b6d74..f625f190a 100644 --- a/vhdlpp/vtype_stream.cc +++ b/vhdlpp/vtype_stream.cc @@ -38,13 +38,17 @@ void VType::write_type_to_stream(ostream&fd) const void VTypeArray::write_to_stream(ostream&fd) const { - // Special case: std_logic_vector + // Special cases: std_logic_vector & string if (etype_ == &primitive_STDLOGIC) { fd << "std_logic_vector"; if (! ranges_.empty() && ! ranges_[0].is_box()) { write_range_to_stream_(fd); } return; + } else if (etype_ == &primitive_CHARACTER && + ranges_.size() == 1 && ranges_[0].is_box()) { + fd << "string"; + return; } bool typedefed = false;