diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index e0e1a475c..521f2e5a7 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -79,7 +79,6 @@ static int draw_module(ivl_scope_t scope, ivl_scope_t parent) vhdl_entity *parent_ent = find_entity(ivl_scope_tname(parent)); assert(parent_ent != NULL); - // Make sure we only collect instantiations from *one* // example of this module in the hieararchy if (parent_ent->get_derived_from() == ivl_scope_name(parent)) { diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index d64ff8253..27cf61a50 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -57,10 +57,8 @@ static int draw_stask_display(vhdl_process *proc, ivl_statement_t stmt) // Write the data into the line int count = ivl_stmt_parm_count(stmt); for (int i = 0; i < count; i++) { - // TODO: This is a bit simplistic since it will only - // work with strings - // --> Need to add a call to Type'Image for non-string - // expressions + // TODO: Need to add a call to Type'Image for types not + // supported by std.textio vhdl_expr *e = translate_expr(ivl_stmt_parm(stmt, i)); if (NULL == e) return 1; diff --git a/tgt-vhdl/vhdl_element.cc b/tgt-vhdl/vhdl_element.cc index c2e77aacd..63dd8724d 100644 --- a/tgt-vhdl/vhdl_element.cc +++ b/tgt-vhdl/vhdl_element.cc @@ -357,5 +357,9 @@ void vhdl_var_ref::emit(std::ofstream &of, int level) const void vhdl_const_string::emit(std::ofstream &of, int level) const { - of << "\"" << value_ << "\""; + // In some instances a string literal can be ambiguous between + // a String type and some other types (e.g. std_logic_vector) + // The explicit cast to String removes this ambiguity (although + // isn't always strictly necessary) + of << "String'(\"" << value_ << "\")"; }