diff --git a/tgt-vhdl/cast.cc b/tgt-vhdl/cast.cc index 11dd34eb5..4d7abed94 100644 --- a/tgt-vhdl/cast.cc +++ b/tgt-vhdl/cast.cc @@ -1,7 +1,7 @@ /* * Generate code to convert between VHDL types. * - * Copyright (C) 2008-2012 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2021 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,8 @@ #include #include +using namespace std; + vhdl_expr *vhdl_expr::cast(const vhdl_type *to) { #if 0 diff --git a/tgt-vhdl/expr.cc b/tgt-vhdl/expr.cc index a91274e76..7b0bcacad 100644 --- a/tgt-vhdl/expr.cc +++ b/tgt-vhdl/expr.cc @@ -1,7 +1,7 @@ /* * VHDL code generation for expressions. * - * Copyright (C) 2008-2013 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2021 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include #include +using namespace std; /* * Change the signedness of a vector. diff --git a/tgt-vhdl/logic.cc b/tgt-vhdl/logic.cc index 098d4a9fe..562481566 100644 --- a/tgt-vhdl/logic.cc +++ b/tgt-vhdl/logic.cc @@ -1,7 +1,7 @@ /* * VHDL code generation for logic devices. * - * Copyright (C) 2008-2014 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2021 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,8 @@ #include #include +using namespace std; + /* * Convert the inputs of a logic gate to a binary expression. */ diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 28c5b0c5c..07917d175 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -1,7 +1,7 @@ /* * VHDL code generation for scopes. * - * Copyright (C) 2008-2014 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2021 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,8 @@ #include #include +using namespace std; + /* * This represents the portion of a nexus that is visible within * a VHDL scope. If that nexus portion does not contain a signal, diff --git a/tgt-vhdl/stmt.cc b/tgt-vhdl/stmt.cc index 6d9c7f437..033642d05 100644 --- a/tgt-vhdl/stmt.cc +++ b/tgt-vhdl/stmt.cc @@ -1,7 +1,7 @@ /* * VHDL code generation for statements. * - * Copyright (C) 2008-2018 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2021 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,8 @@ #include #include +using namespace std; + static void emit_wait_for_0(vhdl_procedural *proc, stmt_container *container, ivl_statement_t stmt, vhdl_expr *expr); diff --git a/tgt-vhdl/vhdl.cc b/tgt-vhdl/vhdl.cc index de5dd4c3a..afab4c9e0 100644 --- a/tgt-vhdl/vhdl.cc +++ b/tgt-vhdl/vhdl.cc @@ -1,7 +1,7 @@ /* * VHDL code generator for Icarus Verilog. * - * Copyright (C) 2008-2020 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2021 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,8 @@ #include #include +using namespace std; + static const char*version_string = "Icarus Verilog VHDL Code Generator " VERSION " (" VERSION_TAG ")\n\n" "Copyright (C) 2008-2020 Nick Gasson (nick@nickg.me.uk)\n\n" diff --git a/tgt-vhdl/vhdl_syntax.hh b/tgt-vhdl/vhdl_syntax.hh index 7efecbaf8..35718b39b 100644 --- a/tgt-vhdl/vhdl_syntax.hh +++ b/tgt-vhdl/vhdl_syntax.hh @@ -27,14 +27,12 @@ #include "vhdl_element.hh" #include "vhdl_type.hh" -using namespace std; - class vhdl_scope; class vhdl_entity; class vhdl_arch; class vhdl_var_ref; -typedef set vhdl_var_set_t; +typedef std::set vhdl_var_set_t; class vhdl_expr : public vhdl_element { public: @@ -56,8 +54,8 @@ public: virtual void find_vars(vhdl_var_set_t&) {} protected: - static void open_parens(ostream& of); - static void close_parens(ostream& of); + static void open_parens(std::ostream& of); + static void close_parens(std::ostream& of); static int paren_levels; const vhdl_type *type_; @@ -70,7 +68,7 @@ protected: */ class vhdl_var_ref : public vhdl_expr { public: - vhdl_var_ref(const string& name, const vhdl_type *type, + vhdl_var_ref(const std::string& name, const vhdl_type *type, vhdl_expr *slice = NULL) : vhdl_expr(type), name_(name), slice_(slice), slice_width_(0) {} ~vhdl_var_ref(); @@ -178,7 +176,7 @@ private: class vhdl_const_string : public vhdl_expr { public: - explicit vhdl_const_string(const string& value) + explicit vhdl_const_string(const std::string& value) : vhdl_expr(vhdl_type::string(), true), value_(value) {} void emit(std::ostream &of, int level) const; @@ -272,7 +270,7 @@ private: */ class vhdl_fcall : public vhdl_expr { public: - vhdl_fcall(const string& name, const vhdl_type *rtype) + vhdl_fcall(const std::string& name, const vhdl_type *rtype) : vhdl_expr(rtype), name_(name) {}; ~vhdl_fcall() {} @@ -468,7 +466,7 @@ public: vhdl_severity_t severity = SEVERITY_NOTE); virtual ~vhdl_report_stmt() {} - virtual void emit(ostream& of, int level) const; + virtual void emit(std::ostream& of, int level) const; void find_vars(vhdl_var_set_t& read, vhdl_var_set_t& write); private: vhdl_severity_t severity_; @@ -480,7 +478,7 @@ class vhdl_assert_stmt : public vhdl_report_stmt { public: explicit vhdl_assert_stmt(const char *reason); - void emit(ostream &of, int level) const; + void emit(std::ostream &of, int level) const; }; @@ -602,8 +600,8 @@ private: */ class vhdl_decl : public vhdl_element { public: - vhdl_decl(const string& name, const vhdl_type *type = NULL, - vhdl_expr *initial = NULL) + explicit vhdl_decl(const std::string& name, const vhdl_type *type = NULL, + vhdl_expr *initial = NULL) : name_(name), type_(type), initial_(initial), has_initial_(initial != NULL) {} virtual ~vhdl_decl(); @@ -666,7 +664,7 @@ private: class vhdl_type_decl : public vhdl_decl { public: - vhdl_type_decl(const string& name, const vhdl_type *base) + vhdl_type_decl(const std::string& name, const vhdl_type *base) : vhdl_decl(name, base) {} void emit(std::ostream &of, int level) const; }; @@ -677,7 +675,7 @@ public: */ class vhdl_var_decl : public vhdl_decl { public: - vhdl_var_decl(const string& name, const vhdl_type *type) + vhdl_var_decl(const std::string& name, const vhdl_type *type) : vhdl_decl(name, type) {} void emit(std::ostream &of, int level) const; assign_type_t assignment_type() const { return ASSIGN_BLOCK; } @@ -689,7 +687,7 @@ public: */ class vhdl_signal_decl : public vhdl_decl { public: - vhdl_signal_decl(const string& name, const vhdl_type* type) + vhdl_signal_decl(const std::string& name, const vhdl_type* type) : vhdl_decl(name, type) {} virtual void emit(std::ostream &of, int level) const; assign_type_t assignment_type() const { return ASSIGN_NONBLOCK; } @@ -755,7 +753,7 @@ public: ~vhdl_comp_inst(); void emit(std::ostream &of, int level) const; - void map_port(const string& name, vhdl_expr *expr); + void map_port(const std::string& name, vhdl_expr *expr); const std::string &get_comp_name() const { return comp_name_; } const std::string &get_inst_name() const { return inst_name_; } @@ -779,7 +777,7 @@ public: void add_forward_decl(vhdl_decl *decl); vhdl_decl *get_decl(const std::string &name) const; bool have_declared(const std::string &name) const; - bool name_collides(const string& name) const; + bool name_collides(const std::string& name) const; bool contained_within(const vhdl_scope *other) const; vhdl_scope *get_parent() const; @@ -834,7 +832,7 @@ protected: // The set of variable we have performed a blocking // assignment to - set blocking_targets_; + std::set blocking_targets_; }; @@ -878,7 +876,7 @@ private: */ class vhdl_arch : public vhdl_element { public: - vhdl_arch(const string& entity, const string& name) + vhdl_arch(const std::string& entity, const std::string& name) : name_(name), entity_(entity) {} virtual ~vhdl_arch(); @@ -900,7 +898,7 @@ private: */ class vhdl_entity : public vhdl_element { public: - vhdl_entity(const string& name, vhdl_arch *arch, int depth=0); + vhdl_entity(const std::string& name, vhdl_arch *arch, int depth=0); virtual ~vhdl_entity(); void emit(std::ostream &of, int level=0) const; @@ -930,4 +928,3 @@ private: typedef std::list entity_list_t; #endif - diff --git a/tgt-vhdl/vhdl_target.h b/tgt-vhdl/vhdl_target.h index abc09266b..e2dbd87f8 100644 --- a/tgt-vhdl/vhdl_target.h +++ b/tgt-vhdl/vhdl_target.h @@ -10,8 +10,6 @@ #include -using namespace std; - void error(const char *fmt, ...); void debug_msg(const char *fmt, ...); @@ -28,7 +26,7 @@ vhdl_expr *translate_time_expr(ivl_expr_t e); ivl_design_t get_vhdl_design(); vhdl_var_ref *nexus_to_var_ref(vhdl_scope *arch_scope, ivl_nexus_t nexus); vhdl_var_ref* readable_ref(vhdl_scope* scope, ivl_nexus_t nex); -string make_safe_name(ivl_signal_t sig); +std::string make_safe_name(ivl_signal_t sig); void require_support_function(support_function_t f); #endif /* #ifndef INC_VHDL_TARGET_H */