From 52b099feae060d3a5a73c47d3228d065951fbdd4 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Thu, 4 Nov 2021 16:12:04 +0000 Subject: [PATCH] Remove "using namespace std" from compiler header files and fix the fallout. (cherry picked from commit ecbbb60fb6c1773eb460d4ecc369d9f5a6ec9550) --- AStatement.h | 8 +- HName.h | 10 +- Module.cc | 2 + Module.h | 34 +-- PDelays.cc | 4 +- PDelays.h | 14 +- PExpr.cc | 2 + PExpr.h | 52 ++--- PFunction.cc | 2 + PGate.cc | 4 +- PGate.h | 48 ++--- PGenerate.cc | 2 + PGenerate.h | 16 +- PModport.h | 6 +- PScope.cc | 4 +- PScope.h | 38 ++-- PTask.cc | 4 +- PTask.h | 4 +- PUdp.h | 10 +- PWire.cc | 2 + PWire.h | 8 +- Statement.cc | 2 + Statement.h | 66 +++--- compiler.h | 6 +- config.h.in | 10 +- cprop.cc | 1 + design_dump.cc | 2 + discipline.h | 8 +- dup_expr.cc | 4 +- elab_anet.cc | 5 +- elab_expr.cc | 2 + elab_lval.cc | 2 + elab_net.cc | 2 + elab_scope.cc | 1 + elaborate.cc | 1 + elaborate_analog.cc | 4 +- emit.cc | 2 + eval.cc | 4 +- eval_attrib.cc | 4 +- eval_tree.cc | 2 + exposenodes.cc | 3 +- expr_synth.cc | 2 + ivl_assert.h | 8 +- lexor.lex | 2 + libmisc/LineInfo.h | 6 +- libmisc/StringHeap.cc | 4 +- libmisc/StringHeap.h | 8 +- link_const.cc | 4 +- load_module.cc | 4 +- main.cc | 2 + net_assign.cc | 4 +- net_design.cc | 2 + net_event.cc | 2 + net_expr.cc | 2 + net_func.cc | 4 +- net_link.cc | 4 +- net_nex_input.cc | 2 + net_nex_output.cc | 2 + net_proc.cc | 4 +- net_scope.cc | 2 + net_tran.cc | 4 +- net_udp.cc | 4 +- netclass.h | 4 +- netlist.cc | 1 + netlist.h | 370 ++++++++++++++++----------------- netmisc.cc | 1 + netmisc.h | 30 +-- nodangle.cc | 4 +- parse.y | 266 ++++++++++++------------ parse_api.h | 2 +- parse_misc.cc | 5 +- parse_misc.h | 4 +- pform.cc | 2 + pform.h | 110 +++++----- pform_analog.cc | 4 +- pform_class_type.cc | 4 +- pform_disciplines.cc | 4 +- pform_dump.cc | 2 + pform_pclass.cc | 4 +- pform_string_type.cc | 4 +- pform_struct_type.cc | 4 +- pform_types.h | 18 +- symbol_search.cc | 1 + syn-rules.y | 4 +- t-dll-api.cc | 2 + t-dll-expr.cc | 4 +- t-dll.cc | 2 + t-dll.h | 4 +- target.cc | 2 + target.h | 4 +- util.h | 4 +- verinum.cc | 2 + verinum.h | 14 +- verireal.cc | 4 +- verireal.h | 10 +- vhdlpp/architec.h | 48 ++--- vhdlpp/architec_elaborate.cc | 2 + vhdlpp/architec_emit.cc | 4 +- vhdlpp/debug.cc | 2 + vhdlpp/entity.h | 10 +- vhdlpp/entity_emit.cc | 4 +- vhdlpp/expression.h | 164 +++++++-------- vhdlpp/expression_evaluate.cc | 4 +- vhdlpp/library.h | 5 +- vhdlpp/main.cc | 2 + vhdlpp/package.cc | 4 +- vhdlpp/parse.y | 4 +- vhdlpp/parse_types.h | 2 +- vhdlpp/scope.h | 30 +-- vhdlpp/sequential.cc | 4 +- vhdlpp/sequential.h | 86 ++++---- vhdlpp/sequential_elaborate.cc | 2 + vhdlpp/sequential_emit.cc | 2 + vhdlpp/std_funcs.cc | 4 +- vhdlpp/std_types.cc | 3 +- vhdlpp/std_types.h | 4 +- vhdlpp/subprogram.h | 4 +- vhdlpp/vhdlpp_config.h.in | 8 - vhdlpp/vsignal.h | 8 +- vhdlpp/vtype_elaborate.cc | 4 +- vpi_modules.cc | 4 +- 121 files changed, 958 insertions(+), 841 deletions(-) diff --git a/AStatement.h b/AStatement.h index 209dab455..f5815af4c 100644 --- a/AStatement.h +++ b/AStatement.h @@ -1,7 +1,7 @@ #ifndef IVL_AStatement_H #define IVL_AStatement_H /* - * Copyright (c) 2008-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -42,7 +42,7 @@ class AContrib : public Statement { AContrib(PExpr*lval, PExpr*rval); ~AContrib(); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; private: @@ -68,10 +68,10 @@ class AProcess : public LineInfo { ivl_process_type_t type() const { return type_; } Statement*statement() { return statement_; } - map attributes; + std::map attributes; // Dump the analog process - void dump(ostream&out, unsigned ind) const; + void dump(std::ostream&out, unsigned ind) const; private: ivl_process_type_t type_; diff --git a/HName.h b/HName.h index b278aae55..890822166 100644 --- a/HName.h +++ b/HName.h @@ -1,7 +1,7 @@ #ifndef IVL_HName_H #define IVL_HName_H /* - * Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -36,7 +36,7 @@ class hname_t { - friend ostream& operator<< (ostream&out, const hname_t&that); + friend std::ostream& operator<< (std::ostream&out, const hname_t&that); public: hname_t (); @@ -92,14 +92,14 @@ inline size_t hname_t::has_numbers() const return number_.size(); } -extern ostream& operator<< (ostream&, const hname_t&); +extern std::ostream& operator<< (std::ostream&, const hname_t&); inline bool operator != (const hname_t&l, const hname_t&r) { return ! (l == r); } -inline ostream& operator<< (ostream&out, const list&ll) +inline std::ostream& operator<< (std::ostream&out, const std::list&ll) { - list::const_iterator cur = ll.begin(); + std::list::const_iterator cur = ll.begin(); out << *cur; ++ cur; while (cur != ll.end()) { diff --git a/Module.cc b/Module.cc index a7e5183bc..c94bd7d48 100644 --- a/Module.cc +++ b/Module.cc @@ -24,6 +24,8 @@ # include "PWire.h" # include +using namespace std; + list Module::user_defparms; /* n is a permallocated string. */ diff --git a/Module.h b/Module.h index 993a8c0df..d529b40bb 100644 --- a/Module.h +++ b/Module.h @@ -64,7 +64,7 @@ class Module : public PScopeExtra, public PNamedItem { public: struct port_t { perm_string name; - vector expr; + std::vector expr; }; public: @@ -97,15 +97,15 @@ class Module : public PScopeExtra, public PNamedItem { /* specparams are simpler than other parameters, in that they can have a range, but not an explicit type. The restrictions are enforced by the parser. */ - mapspecparams; + std::mapspecparams; /* The module also has defparam assignments which don't create new parameters within the module, but may be used to set values within this module (when instantiated) or in other instantiated modules. */ - typedef pair named_expr_t; - listdefparms; - static listuser_defparms; + typedef std::pair named_expr_t; + std::listdefparms; + static std::listuser_defparms; /* Parameters may be overridden at instantiation time; the overrides do not contain explicit parameter names, @@ -113,17 +113,17 @@ class Module : public PScopeExtra, public PNamedItem { appear in the instantiated module. Therefore a list of names in module-order is needed to pass from a parameter-index to its name. */ - list param_names; + std::list param_names; /* This is an array of port descriptors, which is in turn a named array of PEident pointers. */ - vector ports; + std::vector ports; - map attributes; + std::map attributes; /* The module has a list of generate schemes that appear in the module definition. These are used at elaboration time. */ - list generate_schemes; + std::list generate_schemes; /* Nested modules are placed here, and are not elaborated unless they are instantiated, implicitly or explicitly. */ @@ -132,9 +132,9 @@ class Module : public PScopeExtra, public PNamedItem { /* An interface can contain one or more named modport lists. The parser will ensure these don't appear in modules or program blocks. */ - map modports; + std::map modports; - list specify_paths; + std::list specify_paths; // The mod_name() is the name of the module type. perm_string mod_name() const { return pscope_name(); } @@ -142,7 +142,7 @@ class Module : public PScopeExtra, public PNamedItem { void add_gate(PGate*gate); unsigned port_count() const; - const vector& get_port(unsigned idx) const; + const std::vector& get_port(unsigned idx) const; unsigned find_port(const char*name) const; // Return port name ("" for undeclared port) @@ -150,12 +150,12 @@ class Module : public PScopeExtra, public PNamedItem { PGate* get_gate(perm_string name); - const list& get_gates() const; + const std::list& get_gates() const; - void dump(ostream&out) const; + void dump(std::ostream&out) const; bool elaborate(Design*, NetScope*scope) const; - typedef map replace_t; + typedef std::map replace_t; bool elaborate_scope(Design*, NetScope*scope, const replace_t&rep); bool elaborate_sig(Design*, NetScope*scope) const; @@ -163,8 +163,8 @@ class Module : public PScopeExtra, public PNamedItem { SymbolType symbol_type() const; private: - void dump_specparams_(ostream&out, unsigned indent) const; - list gates_; + void dump_specparams_(std::ostream&out, unsigned indent) const; + std::list gates_; private: // Not implemented Module(const Module&); diff --git a/PDelays.cc b/PDelays.cc index 3759d39fe..c513a9f56 100644 --- a/PDelays.cc +++ b/PDelays.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2017 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -26,6 +26,8 @@ # include "verinum.h" # include "netmisc.h" +using namespace std; + PDelays::PDelays() { delete_flag_ = true; diff --git a/PDelays.h b/PDelays.h index 353501f66..b745b7330 100644 --- a/PDelays.h +++ b/PDelays.h @@ -1,7 +1,7 @@ #ifndef IVL_PDelays_H #define IVL_PDelays_H /* - * Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,12 +24,6 @@ # include # include -#ifdef __GNUC__ -#if __GNUC__ > 2 -using namespace std; -#endif -#endif - class Design; class NetScope; class NetExpr; @@ -49,7 +43,7 @@ class PDelays { this object takes ownership of the expressions, and will delete it in the destructor. */ void set_delay(PExpr*); - void set_delays(const list*del, bool delete_flag=true); + void set_delays(const std::list*del, bool delete_flag=true); unsigned delay_count() const; @@ -59,7 +53,7 @@ class PDelays { NetExpr*&decay_time, bool as_nets_flag =false) const; - void dump_delays(ostream&out) const; + void dump_delays(std::ostream&out) const; private: PExpr* delay_[3]; @@ -70,6 +64,6 @@ class PDelays { PDelays& operator= (const PDelays&); }; -ostream& operator << (ostream&o, const PDelays&); +std::ostream& operator << (std::ostream&o, const PDelays&); #endif /* IVL_PDelays_H */ diff --git a/PExpr.cc b/PExpr.cc index 51c0de605..a2aceedeb 100644 --- a/PExpr.cc +++ b/PExpr.cc @@ -30,6 +30,8 @@ # include "util.h" # include +using namespace std; + PExpr::PExpr() { expr_type_ = IVL_VT_NO_TYPE; diff --git a/PExpr.h b/PExpr.h index 369464f9a..8dd8e9376 100644 --- a/PExpr.h +++ b/PExpr.h @@ -60,7 +60,7 @@ class PExpr : public LineInfo { PExpr(); virtual ~PExpr(); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; // This method tests whether the expression contains any identifiers // that have not been previously declared in the specified scope or @@ -202,7 +202,7 @@ class PExpr : public LineInfo { PExpr& operator= (const PExpr&); }; -ostream& operator << (ostream&, const PExpr&); +std::ostream& operator << (std::ostream&, const PExpr&); class PEAssignPattern : public PExpr { public: @@ -230,11 +230,11 @@ class PEAssignPattern : public PExpr { class PEConcat : public PExpr { public: - PEConcat(const list&p, PExpr*r =0); + explicit PEConcat(const std::list&p, PExpr*r =0); ~PEConcat(); virtual verinum* eval_const(Design*des, NetScope*sc) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual void declare_implicit_nets(LexicalScope*scope, NetNet::Type type); @@ -261,7 +261,7 @@ class PEConcat : public PExpr { NetNet* elaborate_lnet_common_(Design*des, NetScope*scope, bool bidirectional_flag) const; private: - vectorparms_; + std::vectorparms_; std::valarraywidth_modes_; PExpr*repeat_; @@ -289,7 +289,7 @@ class PEEvent : public PExpr { edge_t type() const; PExpr* expr() const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual bool has_aa_term(Design*des, NetScope*scope) const; @@ -322,7 +322,7 @@ class PEFNumber : public PExpr { unsigned expr_wid, unsigned flags) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; private: verireal*value_; @@ -340,7 +340,7 @@ class PEIdent : public PExpr { // current identifier. void append_name(perm_string); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual void declare_implicit_nets(LexicalScope*scope, NetNet::Type type); @@ -540,7 +540,7 @@ class PENewArray : public PExpr { explicit PENewArray (PExpr*s, PExpr*i); ~PENewArray(); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual unsigned test_width(Design*des, NetScope*scope, width_mode_t&mode); virtual NetExpr*elaborate_expr(Design*des, NetScope*scope, @@ -564,7 +564,7 @@ class PENewClass : public PExpr { ~PENewClass(); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; // Class objects don't have a useful width, but the expression // is IVL_VT_CLASS. virtual unsigned test_width(Design*des, NetScope*scope, @@ -589,7 +589,7 @@ class PENewCopy : public PExpr { explicit PENewCopy(PExpr*src); ~PENewCopy(); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; // Class objects don't have a useful width, but the expression // is IVL_VT_CLASS. virtual unsigned test_width(Design*des, NetScope*scope, @@ -609,7 +609,7 @@ class PENull : public PExpr { explicit PENull(); ~PENull(); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual unsigned test_width(Design*des, NetScope*scope, width_mode_t&mode); virtual NetExpr*elaborate_expr(Design*des, NetScope*scope, @@ -627,7 +627,7 @@ class PENumber : public PExpr { const verinum& value() const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual unsigned test_width(Design*des, NetScope*scope, width_mode_t&mode); @@ -661,8 +661,8 @@ class PEString : public PExpr { explicit PEString(char*s); ~PEString(); - string value() const; - virtual void dump(ostream&) const; + std::string value() const; + virtual void dump(std::ostream&) const; virtual unsigned test_width(Design*des, NetScope*scope, width_mode_t&mode); @@ -683,7 +683,7 @@ class PETypename : public PExpr { explicit PETypename(data_type_t*data_type); ~PETypename(); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual unsigned test_width(Design*des, NetScope*scope, width_mode_t&mode); virtual NetExpr*elaborate_expr(Design*des, NetScope*scope, @@ -701,7 +701,7 @@ class PEUnary : public PExpr { explicit PEUnary(char op, PExpr*ex); ~PEUnary(); - virtual void dump(ostream&out) const; + virtual void dump(std::ostream&out) const; virtual void declare_implicit_nets(LexicalScope*scope, NetNet::Type type); @@ -733,7 +733,7 @@ class PEBinary : public PExpr { explicit PEBinary(char op, PExpr*l, PExpr*r); ~PEBinary(); - virtual void dump(ostream&out) const; + virtual void dump(std::ostream&out) const; virtual void declare_implicit_nets(LexicalScope*scope, NetNet::Type type); @@ -858,7 +858,7 @@ class PETernary : public PExpr { explicit PETernary(PExpr*e, PExpr*t, PExpr*f); ~PETernary(); - virtual void dump(ostream&out) const; + virtual void dump(std::ostream&out) const; virtual void declare_implicit_nets(LexicalScope*scope, NetNet::Type type); @@ -890,7 +890,7 @@ class PETernary : public PExpr { */ class PECallFunction : public PExpr { public: - explicit PECallFunction(const pform_name_t&n, const vector &parms); + explicit PECallFunction(const pform_name_t&n, const std::vector &parms); // Call function defined in package. explicit PECallFunction(PPackage*pkg, perm_string n, const std::vector &parms); explicit PECallFunction(PPackage*pkg, perm_string n, const std::list &parms); @@ -899,16 +899,16 @@ class PECallFunction : public PExpr { explicit PECallFunction(PPackage*pkg, const pform_name_t&n, const std::vector &parms); // Call of system function (name is not hierarchical) - explicit PECallFunction(perm_string n, const vector &parms); + explicit PECallFunction(perm_string n, const std::vector &parms); explicit PECallFunction(perm_string n); // std::list versions. Should be removed! - explicit PECallFunction(const pform_name_t&n, const list &parms); - explicit PECallFunction(perm_string n, const list &parms); + explicit PECallFunction(const pform_name_t&n, const std::list &parms); + explicit PECallFunction(perm_string n, const std::list &parms); ~PECallFunction(); - virtual void dump(ostream &) const; + virtual void dump(std::ostream &) const; virtual void declare_implicit_nets(LexicalScope*scope, NetNet::Type type); @@ -975,7 +975,7 @@ class PECastSize : public PExpr { explicit PECastSize(PExpr*size, PExpr*base); ~PECastSize(); - void dump(ostream &out) const; + void dump(std::ostream &out) const; virtual NetExpr*elaborate_expr(Design*des, NetScope*scope, unsigned expr_wid, @@ -998,7 +998,7 @@ class PECastType : public PExpr { explicit PECastType(data_type_t*target, PExpr*base); ~PECastType(); - void dump(ostream &out) const; + void dump(std::ostream &out) const; virtual NetExpr*elaborate_expr(Design*des, NetScope*scope, ivl_type_t type, unsigned flags) const; diff --git a/PFunction.cc b/PFunction.cc index 215cc5170..fbee08292 100644 --- a/PFunction.cc +++ b/PFunction.cc @@ -23,6 +23,8 @@ # include # include "ivl_assert.h" +using namespace std; + PFunction::PFunction(perm_string name, LexicalScope*parent, bool is_auto__) : PTaskFunc(name, parent), statement_(0) { diff --git a/PGate.cc b/PGate.cc index 0429b4690..f5057dcd0 100644 --- a/PGate.cc +++ b/PGate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,6 +24,8 @@ # include "verinum.h" # include +using namespace std; + void PGate::set_pins_(list*pins) { assert(pins); diff --git a/PGate.h b/PGate.h index 1f5ce5752..80ec0e5cc 100644 --- a/PGate.h +++ b/PGate.h @@ -1,7 +1,7 @@ #ifndef IVL_PGate_H #define IVL_PGate_H /* - * Copyright (c) 1998-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -50,13 +50,13 @@ class Module; class PGate : public PNamedItem { public: - explicit PGate(perm_string name, list*pins, - const list*del); + explicit PGate(perm_string name, std::list*pins, + const std::list*del); - explicit PGate(perm_string name, list*pins, + explicit PGate(perm_string name, std::list*pins, PExpr*del); - explicit PGate(perm_string name, list*pins); + explicit PGate(perm_string name, std::list*pins); virtual ~PGate(); @@ -81,9 +81,9 @@ class PGate : public PNamedItem { void strength0(ivl_drive_t); void strength1(ivl_drive_t); - map attributes; + std::map attributes; - virtual void dump(ostream&out, unsigned ind =4) const; + virtual void dump(std::ostream&out, unsigned ind =4) const; virtual void elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*sc) const; virtual bool elaborate_sig(Design*des, NetScope*scope) const; @@ -91,19 +91,19 @@ class PGate : public PNamedItem { SymbolType symbol_type() const; protected: - const vector& get_pins() const { return pins_; } + const std::vector& get_pins() const { return pins_; } - void dump_pins(ostream&out) const; - void dump_delays(ostream&out) const; + void dump_pins(std::ostream&out) const; + void dump_delays(std::ostream&out) const; private: perm_string name_; PDelays delay_; - vectorpins_; + std::vectorpins_; ivl_drive_t str0_, str1_; - void set_pins_(list*pins); + void set_pins_(std::list*pins); private: // not implemented PGate(const PGate&); @@ -117,11 +117,11 @@ class PGate : public PNamedItem { class PGAssign : public PGate { public: - explicit PGAssign(list*pins); - explicit PGAssign(list*pins, list*dels); + explicit PGAssign(std::list*pins); + explicit PGAssign(std::list*pins, std::list*dels); ~PGAssign(); - void dump(ostream&out, unsigned ind =4) const; + void dump(std::ostream&out, unsigned ind =4) const; virtual void elaborate(Design*des, NetScope*scope) const; virtual bool elaborate_sig(Design*des, NetScope*scope) const; @@ -150,10 +150,10 @@ class PGBuiltin : public PGate { public: explicit PGBuiltin(Type t, perm_string name, - list*pins, - list*del); + std::list*pins, + std::list*del); explicit PGBuiltin(Type t, perm_string name, - list*pins, + std::list*pins, PExpr*del); ~PGBuiltin(); @@ -161,7 +161,7 @@ class PGBuiltin : public PGate { const char * gate_name() const; void set_range(PExpr*msb, PExpr*lsb); - virtual void dump(ostream&out, unsigned ind =4) const; + virtual void dump(std::ostream&out, unsigned ind =4) const; virtual void elaborate(Design*, NetScope*scope) const; virtual bool elaborate_sig(Design*des, NetScope*scope) const; @@ -197,7 +197,7 @@ class PGModule : public PGate { // If the binding of ports is by position, this constructor // builds everything all at once. explicit PGModule(perm_string type, perm_string name, - list*pins); + std::list*pins); // If the binding of ports is by name, this constructor takes // the bindings and stores them for later elaboration. @@ -212,16 +212,16 @@ class PGModule : public PGate { // Parameter overrides can come as an ordered list, or a set // of named expressions. - void set_parameters(list*o); + void set_parameters(std::list*o); void set_parameters(named*pa, unsigned npa); // Modules can be instantiated in ranges. The parser uses this // method to pass the range to the pform. void set_range(PExpr*msb, PExpr*lsb); - map attributes; + std::map attributes; - virtual void dump(ostream&out, unsigned ind =4) const; + virtual void dump(std::ostream&out, unsigned ind =4) const; virtual void elaborate(Design*, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*sc) const; virtual bool elaborate_sig(Design*des, NetScope*scope) const; @@ -233,7 +233,7 @@ class PGModule : public PGate { private: Module*bound_type_; perm_string type_; - list*overrides_; + std::list*overrides_; named*pins_; unsigned npins_; diff --git a/PGenerate.cc b/PGenerate.cc index 53cf5fdcc..62aebe375 100644 --- a/PGenerate.cc +++ b/PGenerate.cc @@ -21,6 +21,8 @@ # include "PWire.h" # include "ivl_assert.h" +using namespace std; + PGenerate::PGenerate(LexicalScope*parent, unsigned id) : LexicalScope(parent), id_number(id) { diff --git a/PGenerate.h b/PGenerate.h index e0136793a..85b1e0b8f 100644 --- a/PGenerate.h +++ b/PGenerate.h @@ -86,18 +86,18 @@ class PGenerate : public PNamedItem, public LexicalScope { std::valarray item_test; // defparam assignments found in this scope. - typedef pair named_expr_t; - listdefparms; + typedef std::pair named_expr_t; + std::listdefparms; - list gates; + std::list gates; void add_gate(PGate*); // Tasks instantiated within this scheme. - map tasks; - mapfuncs; + std::map tasks; + std::mapfuncs; // Generate schemes can contain further generate schemes. - list generate_schemes; + std::list generate_schemes; // PGenerate*parent; // This method is called by the elaboration of a module to @@ -110,7 +110,7 @@ class PGenerate : public PNamedItem, public LexicalScope { bool elaborate_sig(Design*des, NetScope*container) const; bool elaborate(Design*des, NetScope*container) const; - void dump(ostream&out, unsigned indent) const; + void dump(std::ostream&out, unsigned indent) const; SymbolType symbol_type() const; @@ -125,7 +125,7 @@ class PGenerate : public PNamedItem, public LexicalScope { void elaborate_subscope_direct_(Design*des, NetScope*scope); // These are the scopes created by generate_scope. - listscope_list_; + std::listscope_list_; // internal function called on each scope generated by this scheme. bool elaborate_sig_(Design*des, NetScope*scope) const; bool elaborate_sig_direct_(Design*des, NetScope*scope) const; diff --git a/PModport.h b/PModport.h index 417d0b523..add4ab8ac 100644 --- a/PModport.h +++ b/PModport.h @@ -1,7 +1,7 @@ #ifndef IVL_PModport_H #define IVL_PModport_H /* - * Copyright (c) 2015-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 2015-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -38,8 +38,8 @@ class PModport : public PNamedItem { perm_string name() const { return name_; } - typedef pair simple_port_t; - map simple_ports; + typedef std::pair simple_port_t; + std::map simple_ports; SymbolType symbol_type() const; diff --git a/PScope.cc b/PScope.cc index 787dbf88d..e2f3192f2 100644 --- a/PScope.cc +++ b/PScope.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -19,6 +19,8 @@ # include "PScope.h" +using namespace std; + bool LexicalScope::var_init_needs_explicit_lifetime() const { return false; diff --git a/PScope.h b/PScope.h index d06e5707d..83034974a 100644 --- a/PScope.h +++ b/PScope.h @@ -112,30 +112,30 @@ class LexicalScope { SymbolType symbol_type() const; }; - mapparameters; - maplocalparams; + std::mapparameters; + std::maplocalparams; // Defined types in the scope. - maptypedefs; + std::maptypedefs; // Named events in the scope. - mapevents; + std::mapevents; // Nets and variables (wires) in the scope - mapwires; + std::mapwires; PWire* wires_find(perm_string name); // Genvars in the scope. These will only be present in module // scopes, but are listed here to allow them to be found when // creating implicit nets. - map genvars; + std::map genvars; // Variable initializations in this scope - vector var_inits; + std::vector var_inits; // Behaviors (processes) in this scope - list behaviors; - list analog_behaviors; + std::list behaviors; + std::list analog_behaviors; // Enumeration sets. std::set enum_sets; @@ -150,19 +150,19 @@ class LexicalScope { virtual bool var_init_needs_explicit_lifetime() const; protected: - void dump_typedefs_(ostream&out, unsigned indent) const; + void dump_typedefs_(std::ostream&out, unsigned indent) const; - void dump_parameters_(ostream&out, unsigned indent) const; + void dump_parameters_(std::ostream&out, unsigned indent) const; - void dump_localparams_(ostream&out, unsigned indent) const; + void dump_localparams_(std::ostream&out, unsigned indent) const; - void dump_enumerations_(ostream&out, unsigned indent) const; + void dump_enumerations_(std::ostream&out, unsigned indent) const; - void dump_events_(ostream&out, unsigned indent) const; + void dump_events_(std::ostream&out, unsigned indent) const; - void dump_wires_(ostream&out, unsigned indent) const; + void dump_wires_(std::ostream&out, unsigned indent) const; - void dump_var_inits_(ostream&out, unsigned indent) const; + void dump_var_inits_(std::ostream&out, unsigned indent) const; bool elaborate_var_inits_(Design*des, NetScope*scope) const; @@ -233,9 +233,9 @@ class PScopeExtra : public PScope { bool time_prec_is_local; protected: - void dump_classes_(ostream&out, unsigned indent) const; - void dump_tasks_(ostream&out, unsigned indent) const; - void dump_funcs_(ostream&out, unsigned indent) const; + void dump_classes_(std::ostream&out, unsigned indent) const; + void dump_tasks_(std::ostream&out, unsigned indent) const; + void dump_funcs_(std::ostream&out, unsigned indent) const; }; #endif /* IVL_PScope_H */ diff --git a/PTask.cc b/PTask.cc index bb008ad23..9c9ccb9ee 100644 --- a/PTask.cc +++ b/PTask.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -21,6 +21,8 @@ # include "PTask.h" # include +using namespace std; + PTaskFunc::PTaskFunc(perm_string n, LexicalScope*p) : PScope(n,p), this_type_(0), ports_(0) { diff --git a/PTask.h b/PTask.h index 1d328ed6c..35ac2b0f0 100644 --- a/PTask.h +++ b/PTask.h @@ -97,7 +97,7 @@ class PTask : public PTaskFunc { bool is_auto() const { return is_auto_; }; - void dump(ostream&, unsigned) const; + void dump(std::ostream&, unsigned) const; SymbolType symbol_type() const; @@ -148,7 +148,7 @@ class PFunction : public PTaskFunc { bool is_auto() const { return is_auto_; }; - void dump(ostream&, unsigned) const; + void dump(std::ostream&, unsigned) const; SymbolType symbol_type() const; diff --git a/PUdp.h b/PUdp.h index 9bc087c4d..f39da6b37 100644 --- a/PUdp.h +++ b/PUdp.h @@ -1,7 +1,7 @@ #ifndef IVL_PUdp_H #define IVL_PUdp_H /* - * Copyright (c) 1998-2014 Stephen Williams (steve@picturel.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@picturel.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -53,20 +53,20 @@ class PUdp : public LineInfo { public: explicit PUdp(perm_string n, unsigned nports); - svectorports; + svectorports; unsigned find_port(const char*name); bool sequential; - svectortinput; + svectortinput; svector tcurrent; svector toutput; verinum::V initial; - map attributes; + std::map attributes; - void dump(ostream&out) const; + void dump(std::ostream&out) const; perm_string name_; private: diff --git a/PWire.cc b/PWire.cc index 4773c7911..77a8ddeb6 100644 --- a/PWire.cc +++ b/PWire.cc @@ -22,6 +22,8 @@ # include "PExpr.h" # include +using namespace std; + PWire::PWire(perm_string n, NetNet::Type t, NetNet::PortType pt, diff --git a/PWire.h b/PWire.h index b93338b12..0d8c44a30 100644 --- a/PWire.h +++ b/PWire.h @@ -1,7 +1,7 @@ #ifndef IVL_PWire_H #define IVL_PWire_H /* - * Copyright (c) 1998-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -28,7 +28,7 @@ #ifdef HAVE_IOSFWD # include #else -class ostream; +# include #endif class PExpr; @@ -87,10 +87,10 @@ class PWire : public PNamedItem { void set_discipline(ivl_discipline_t); ivl_discipline_t get_discipline(void) const; - map attributes; + std::map attributes; // Write myself to the specified stream. - void dump(ostream&out, unsigned ind=4) const; + void dump(std::ostream&out, unsigned ind=4) const; NetNet* elaborate_sig(Design*, NetScope*scope) const; diff --git a/Statement.cc b/Statement.cc index e200f7734..8713730a1 100644 --- a/Statement.cc +++ b/Statement.cc @@ -23,6 +23,8 @@ # include "PExpr.h" # include "ivl_assert.h" +using namespace std; + Statement::~Statement() { } diff --git a/Statement.h b/Statement.h index 67e4448b0..54f1c578a 100644 --- a/Statement.h +++ b/Statement.h @@ -61,9 +61,9 @@ class PProcess : public LineInfo { ivl_process_type_t type() const { return type_; } Statement*statement() { return statement_; } - map attributes; + std::map attributes; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: ivl_process_type_t type_; @@ -81,12 +81,12 @@ class Statement : virtual public LineInfo { Statement() { } virtual ~Statement() =0; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - map attributes; + std::map attributes; }; /* @@ -139,7 +139,7 @@ class PAssign : public PAssign_ { explicit PAssign(PExpr*lval, PExpr*ex, bool is_constant); ~PAssign(); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; private: @@ -155,7 +155,7 @@ class PAssignNB : public PAssign_ { explicit PAssignNB(PExpr*lval, PExpr*cnt, PEventStatement*de, PExpr*ex); ~PAssignNB(); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; private: @@ -200,7 +200,7 @@ class PBlock : public PScope, public Statement, public PNamedItem { // block. void push_statement_front(Statement*that); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; @@ -215,14 +215,14 @@ class PBlock : public PScope, public Statement, public PNamedItem { class PCallTask : public Statement { public: - explicit PCallTask(PPackage*pkg, const pform_name_t&n, const list&parms); - explicit PCallTask(const pform_name_t&n, const list&parms); - explicit PCallTask(perm_string n, const list&parms); + explicit PCallTask(PPackage*pkg, const pform_name_t&n, const std::list&parms); + explicit PCallTask(const pform_name_t&n, const std::list&parms); + explicit PCallTask(perm_string n, const std::list&parms); ~PCallTask(); const pform_name_t& path() const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; private: @@ -256,14 +256,14 @@ class PCallTask : public Statement { PPackage*package_; pform_name_t path_; - vector parms_; + std::vector parms_; }; class PCase : public Statement { public: struct Item { - listexpr; + std::listexpr; Statement*stat; }; @@ -273,7 +273,7 @@ class PCase : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: ivl_case_quality_t quality_; @@ -294,7 +294,7 @@ class PCAssign : public Statement { ~PCAssign(); virtual NetCAssign* elaborate(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*lval_; @@ -308,11 +308,11 @@ class PCAssign : public Statement { */ class PChainConstructor : public Statement { public: - explicit PChainConstructor(const list&parms); + explicit PChainConstructor(const std::list&parms); ~PChainConstructor(); virtual NetProc* elaborate(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; inline const std::vector& chain_args(void) const { return parms_; } @@ -330,7 +330,7 @@ class PCondit : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*expr_; @@ -349,7 +349,7 @@ class PDeassign : public Statement { ~PDeassign(); virtual NetDeassign* elaborate(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*lval_; @@ -361,7 +361,7 @@ class PDelayStatement : public Statement { PDelayStatement(PExpr*d, Statement*st); ~PDelayStatement(); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; @@ -381,7 +381,7 @@ class PDisable : public Statement { explicit PDisable(const pform_name_t&sc); ~PDisable(); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; private: @@ -397,7 +397,7 @@ class PDoWhile : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*cond_; @@ -426,10 +426,10 @@ class PEventStatement : public Statement { void set_statement(Statement*st); - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; // Call this with a NULL statement only. It is used to print // the event expression for inter-assignment event controls. - virtual void dump_inline(ostream&out) const; + virtual void dump_inline(std::ostream&out) const; virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; @@ -449,7 +449,7 @@ class PEventStatement : public Statement { bool always_sens_; }; -ostream& operator << (ostream&o, const PEventStatement&obj); +std::ostream& operator << (std::ostream&o, const PEventStatement&obj); class PForce : public Statement { @@ -458,7 +458,7 @@ class PForce : public Statement { ~PForce(); virtual NetForce* elaborate(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*lval_; @@ -473,7 +473,7 @@ class PForeach : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: NetProc* elaborate_static_array_(Design*des, NetScope*scope, @@ -493,7 +493,7 @@ class PForever : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: Statement*statement_; @@ -509,7 +509,7 @@ class PForStatement : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr* name1_; @@ -537,7 +537,7 @@ class PRepeat : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*expr_; @@ -551,7 +551,7 @@ class PRelease : public Statement { ~PRelease(); virtual NetProc* elaborate(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*lval_; @@ -581,7 +581,7 @@ class PTrigger : public Statement { ~PTrigger(); virtual NetProc* elaborate(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PPackage*package_; @@ -597,7 +597,7 @@ class PWhile : public Statement { virtual NetProc* elaborate(Design*des, NetScope*scope) const; virtual void elaborate_scope(Design*des, NetScope*scope) const; virtual void elaborate_sig(Design*des, NetScope*scope) const; - virtual void dump(ostream&out, unsigned ind) const; + virtual void dump(std::ostream&out, unsigned ind) const; private: PExpr*cond_; diff --git a/compiler.h b/compiler.h index 441ad11d9..060753ed7 100644 --- a/compiler.h +++ b/compiler.h @@ -147,7 +147,7 @@ extern unsigned long array_size_limit; extern const char*basedir; /* This is an ordered list of library suffixes to search. */ -extern listlibrary_suff; +extern std::listlibrary_suff; extern int build_library_index(const char*path, bool key_case_sensitive); /* This is the generation of Verilog that the compiler is asked to @@ -244,14 +244,14 @@ extern int lexor_keyword_mask; /* This is the string to use to invoke the preprocessor. */ extern char*ivlpp_string; -extern map missing_modules; +extern std::map missing_modules; /* Files that are library files are in this map. The lexor compares file names as it processes `line directives, and if the file name matches an entry in this table, it will turn on the library_active_flag so that modules know that they are in a library. */ -extern map library_file_map; +extern std::map library_file_map; /* * the lex_strings are perm_strings made up of tokens from the source diff --git a/config.h.in b/config.h.in index 8cd8ddf45..67db18f75 100644 --- a/config.h.in +++ b/config.h.in @@ -1,7 +1,7 @@ #ifndef IVL_config_H /* -*- c++ -*- */ #define IVL_config_H /* - * Copyright (c) 2001-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -19,14 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if defined(__cplusplus) -# if !defined(__GNUC__) - using namespace std; -# elif (__GNUC__ == 3) - using namespace std; -# endif -#endif - # undef NEED_LU # undef NEED_TU # undef WLU diff --git a/cprop.cc b/cprop.cc index f05d467f5..d8bd07ed9 100644 --- a/cprop.cc +++ b/cprop.cc @@ -28,6 +28,7 @@ # include "compiler.h" # include "ivl_assert.h" +using namespace std; /* * The cprop function below invokes constant propagation where diff --git a/design_dump.cc b/design_dump.cc index c1335fd85..910e1441b 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -35,6 +35,8 @@ # include "ivl_assert.h" # include "PExpr.h" +using namespace std; + static ostream& operator<< (ostream&o, NetBlock::Type t) { switch (t) { diff --git a/discipline.h b/discipline.h index df902b499..677b25772 100644 --- a/discipline.h +++ b/discipline.h @@ -1,7 +1,7 @@ #ifndef IVL_discipline_H #define IVL_discipline_H /* - * Copyright (c) 2008-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -69,9 +69,9 @@ class ivl_discipline_s : public LineInfo { ivl_discipline_s& operator = (const ivl_discipline_s&); }; -extern map natures; -extern map disciplines; +extern std::map natures; +extern std::map disciplines; // Map access function name to the nature that it accesses. -extern map access_function_nature; +extern std::map access_function_nature; #endif /* IVL_discipline_H */ diff --git a/dup_expr.cc b/dup_expr.cc index c1c2246db..64afcba7e 100644 --- a/dup_expr.cc +++ b/dup_expr.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,6 +24,8 @@ # include # include "ivl_assert.h" +using namespace std; + NetEAccess* NetEAccess::dup_expr() const { NetEAccess*tmp = new NetEAccess(branch_, nature_); diff --git a/elab_anet.cc b/elab_anet.cc index 72489e1ad..bae913518 100644 --- a/elab_anet.cc +++ b/elab_anet.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -29,6 +29,8 @@ # include "netmisc.h" # include +using namespace std; + NetNet* PExpr::elaborate_anet(Design*des, NetScope*scope) const { cerr << get_line() << ": error: Invalid expression on left side " @@ -163,4 +165,3 @@ NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const return sig; } - diff --git a/elab_expr.cc b/elab_expr.cc index 0ab52b703..7d1a6dfe4 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -41,6 +41,8 @@ # include "util.h" # include "ivl_assert.h" +using namespace std; + bool type_is_vectorable(ivl_variable_type_t type) { switch (type) { diff --git a/elab_lval.cc b/elab_lval.cc index da2f804b7..c2a10cd7a 100644 --- a/elab_lval.cc +++ b/elab_lval.cc @@ -36,6 +36,8 @@ # include # include "ivl_assert.h" +using namespace std; + /* * These methods generate a NetAssign_ object for the l-value of the * assignment. This is common code for the = and <= statements. diff --git a/elab_net.cc b/elab_net.cc index cc2ad7f92..fc249b8a9 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -32,6 +32,8 @@ # include # include "ivl_assert.h" +using namespace std; + /* * The concatenation is also OK an an l-value. This method elaborates * it as a structural l-value. The return values is the *input* net of diff --git a/elab_scope.cc b/elab_scope.cc index 32be976e7..a16b76ac9 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -54,6 +54,7 @@ # include # include "ivl_assert.h" +using namespace std; void set_scope_timescale(Design*des, NetScope*scope, PScope*pscope) { diff --git a/elaborate.cc b/elaborate.cc index fcc97d088..f37eaca8a 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -51,6 +51,7 @@ # include "compiler.h" # include "ivl_assert.h" +using namespace std; // Implemented in elab_scope.cc extern void set_scope_timescale(Design*des, NetScope*scope, PScope*pscope); diff --git a/elaborate_analog.cc b/elaborate_analog.cc index 8b901e3a8..bcfe87911 100644 --- a/elaborate_analog.cc +++ b/elaborate_analog.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -26,6 +26,8 @@ # include +using namespace std; + NetProc* AContrib::elaborate(Design*des, NetScope*scope) const { NetExpr*lval = elab_and_eval(des, scope, lval_, -1); diff --git a/emit.cc b/emit.cc index c5c64c9d3..f769b7f7c 100644 --- a/emit.cc +++ b/emit.cc @@ -33,6 +33,8 @@ # include # include +using namespace std; + bool NetNode::emit_node(struct target_t*) const { cerr << "EMIT: Gate type? " << typeid(*this).name() << endl; diff --git a/eval.cc b/eval.cc index 475bf31b0..3b29d46e5 100644 --- a/eval.cc +++ b/eval.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -27,6 +27,8 @@ # include "netmisc.h" # include "compiler.h" +using namespace std; + verinum* PExpr::eval_const(Design*, NetScope*) const { return 0; diff --git a/eval_attrib.cc b/eval_attrib.cc index ecdf7efa8..2c0d7b3c7 100644 --- a/eval_attrib.cc +++ b/eval_attrib.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,6 +24,8 @@ # include # include +using namespace std; + /* * The evaluate_attributes function evaluates the attribute * expressions from the map, and returns a table in a form suitable diff --git a/eval_tree.cc b/eval_tree.cc index b9ba7fb39..300353dbb 100644 --- a/eval_tree.cc +++ b/eval_tree.cc @@ -29,6 +29,8 @@ # include "ivl_assert.h" # include "netmisc.h" +using namespace std; + NetExpr* NetExpr::eval_tree() { return 0; diff --git a/exposenodes.cc b/exposenodes.cc index dc989b7f2..56687cc48 100644 --- a/exposenodes.cc +++ b/exposenodes.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Martin Whitaker (icarus@martin-whitaker.me.uk) + * Copyright (c) 2016-2021 Martin Whitaker (icarus@martin-whitaker.me.uk) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -26,6 +26,7 @@ # include "compiler.h" # include "ivl_assert.h" +using namespace std; /* * The exposenodes functor is primarily provided for use by the vlog95 diff --git a/expr_synth.cc b/expr_synth.cc index 18001e3a8..953ed7b18 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -28,6 +28,8 @@ # include "netmisc.h" # include "ivl_assert.h" +using namespace std; + static NetNet* convert_to_real_const(Design*des, NetScope*scope, NetEConst*expr) { verireal vrl(expr->value().as_double()); diff --git a/ivl_assert.h b/ivl_assert.h index 72812c05f..26fb20fe3 100644 --- a/ivl_assert.h +++ b/ivl_assert.h @@ -1,7 +1,7 @@ #ifndef IVL_ivl_assert_H #define IVL_ivl_assert_H /* - * Copyright (c) 2007-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2007-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,9 +24,9 @@ #define ivl_assert(tok, expression) \ do { \ if (! (expression)) { \ - cerr << (tok).get_fileline() << ": assert: " \ - << __FILE__ << ":" << __LINE__ \ - << ": failed assertion " << #expression << endl; \ + std::cerr << (tok).get_fileline() << ": assert: " \ + << __FILE__ << ":" << __LINE__ \ + << ": failed assertion " << #expression << std::endl; \ abort(); \ } \ } while (0) diff --git a/lexor.lex b/lexor.lex index 7f1134b6c..69e0aa196 100644 --- a/lexor.lex +++ b/lexor.lex @@ -37,6 +37,8 @@ # include "discipline.h" # include +using namespace std; + # define YY_USER_INIT reset_lexor(); # define yylval VLlval diff --git a/libmisc/LineInfo.h b/libmisc/LineInfo.h index 4d4c6beda..ec36aee41 100644 --- a/libmisc/LineInfo.h +++ b/libmisc/LineInfo.h @@ -1,7 +1,7 @@ #ifndef IVL_LineInfo_H #define IVL_LineInfo_H /* - * Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -22,8 +22,6 @@ # include "StringHeap.h" # include -using namespace std; - /* * This class holds line information for an internal object. * @@ -40,7 +38,7 @@ class LineInfo { virtual ~LineInfo(); // Get a fully formatted file/lineno - string get_fileline() const; + std::string get_fileline() const; // Set the file/line from another LineInfo object. void set_line(const LineInfo&that); diff --git a/libmisc/StringHeap.cc b/libmisc/StringHeap.cc index 4d89305b4..d14580eb5 100644 --- a/libmisc/StringHeap.cc +++ b/libmisc/StringHeap.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -29,6 +29,8 @@ static char **string_pool = NULL; static unsigned string_pool_count = 0; #endif +using namespace std; + static const unsigned DEFAULT_CELL_SIZE = 0x10000; diff --git a/libmisc/StringHeap.h b/libmisc/StringHeap.h index f76059573..b11a7109f 100644 --- a/libmisc/StringHeap.h +++ b/libmisc/StringHeap.h @@ -1,7 +1,7 @@ #ifndef IVL_StringHeap_H #define IVL_StringHeap_H /* - * Copyright (c) 2002-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -21,8 +21,6 @@ # include -using namespace std; - class perm_string { public: @@ -61,7 +59,7 @@ extern bool operator > (perm_string a, perm_string b); extern bool operator < (perm_string a, perm_string b); extern bool operator >= (perm_string a, perm_string b); extern bool operator <= (perm_string a, perm_string b); -extern ostream& operator << (ostream&out, perm_string that); +extern std::ostream& operator << (std::ostream&out, perm_string that); /* * The string heap is a way to permanently allocate strings @@ -100,7 +98,7 @@ class StringHeapLex : private StringHeap { const char*add(const char*); perm_string make(const char*); - perm_string make(const string&); + perm_string make(const std::string&); unsigned add_count() const; unsigned add_hit_count() const; diff --git a/link_const.cc b/link_const.cc index d5b77a6a8..447c789c8 100644 --- a/link_const.cc +++ b/link_const.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -23,6 +23,8 @@ # include "netmisc.h" # include "ivl_assert.h" +using namespace std; + /* * Scan the link for drivers. If there are only constant drivers, then * the nexus has a known constant value. diff --git a/load_module.cc b/load_module.cc index 194d9ff9b..fef785659 100644 --- a/load_module.cc +++ b/load_module.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -32,6 +32,8 @@ # include # include "ivl_alloc.h" +using namespace std; + /* * The module library items are maps of key names to file name within * the directory. diff --git a/main.cc b/main.cc index 7da46989a..af44c046f 100644 --- a/main.cc +++ b/main.cc @@ -62,6 +62,8 @@ const char NOTICE[] = # include "discipline.h" # include "t-dll.h" +using namespace std; + #if defined(__MINGW32__) && !defined(HAVE_GETOPT_H) extern "C" int getopt(int argc, char*argv[], const char*fmt); extern "C" int optind; diff --git a/net_assign.cc b/net_assign.cc index 29005f885..d3ecf5215 100644 --- a/net_assign.cc +++ b/net_assign.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -25,6 +25,8 @@ # include "netenum.h" # include "ivl_assert.h" +using namespace std; + /* * NetAssign */ diff --git a/net_design.cc b/net_design.cc index 6dc0bced0..44e7079e4 100644 --- a/net_design.cc +++ b/net_design.cc @@ -37,6 +37,8 @@ # include # include "ivl_assert.h" +using namespace std; + Design:: Design() : errors(0), nodes_(0), procs_(0), aprocs_(0) { diff --git a/net_event.cc b/net_event.cc index 2b6eb8d35..5b8b56af1 100644 --- a/net_event.cc +++ b/net_event.cc @@ -22,6 +22,8 @@ # include "netlist.h" # include "ivl_assert.h" +using namespace std; + /* * NOTE: The name_ is perm-allocated by the caller. */ diff --git a/net_expr.cc b/net_expr.cc index 804fae96d..e225f73bd 100644 --- a/net_expr.cc +++ b/net_expr.cc @@ -27,6 +27,8 @@ # include # include "ivl_assert.h" +using namespace std; + NetExpr::NetExpr(unsigned w) : net_type_(0), width_(w), signed_flag_(false) { diff --git a/net_func.cc b/net_func.cc index 8518fbd32..aa92b9b3a 100644 --- a/net_func.cc +++ b/net_func.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -23,6 +23,8 @@ # include "PExpr.h" # include +using namespace std; + /* * To make a NetUserFunc device, make as many pins as there are ports * in the function. Get the port count from the function definition, diff --git a/net_link.cc b/net_link.cc index 3b0a79d45..05f1635fd 100644 --- a/net_link.cc +++ b/net_link.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -29,6 +29,8 @@ # include # include "ivl_alloc.h" +using namespace std; + void Nexus::connect(Link&r) { Nexus*r_nexus = r.next_? r.find_nexus_() : 0; diff --git a/net_nex_input.cc b/net_nex_input.cc index 78250316b..f26bb7759 100644 --- a/net_nex_input.cc +++ b/net_nex_input.cc @@ -27,6 +27,8 @@ # include "netlist.h" # include "netmisc.h" +using namespace std; + NexusSet* NetExpr::nex_input(bool, bool, bool) const { cerr << get_fileline() diff --git a/net_nex_output.cc b/net_nex_output.cc index 9c1d32e10..44325874f 100644 --- a/net_nex_output.cc +++ b/net_nex_output.cc @@ -26,6 +26,8 @@ # include "netlist.h" # include "netmisc.h" +using namespace std; + void NetProc::nex_output(NexusSet&) { cerr << get_fileline() diff --git a/net_proc.cc b/net_proc.cc index b82abe8f1..b5d3d49ca 100644 --- a/net_proc.cc +++ b/net_proc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2015 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,6 +24,8 @@ # include "netmisc.h" # include "ivl_assert.h" +using namespace std; + NetBlock::NetBlock(Type t, NetScope*ss) : type_(t), subscope_(ss), last_(0) { diff --git a/net_scope.cc b/net_scope.cc index 0ac1265cf..4fdb94e6a 100644 --- a/net_scope.cc +++ b/net_scope.cc @@ -31,6 +31,8 @@ # include # include "ivl_assert.h" +using namespace std; + class PExpr; Definitions::Definitions() diff --git a/net_tran.cc b/net_tran.cc index 7a1476096..f9959e51a 100644 --- a/net_tran.cc +++ b/net_tran.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -29,6 +29,8 @@ # include "ivl_target_priv.h" # include "ivl_assert.h" +using namespace std; + static bool has_enable(ivl_switch_type_t tt) { switch (tt) { diff --git a/net_udp.cc b/net_udp.cc index 0ed83d49a..a4797ecf7 100644 --- a/net_udp.cc +++ b/net_udp.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * Copyright (c) 2001 Stephan Boettcher * * This source code is free software; you can redistribute it @@ -22,6 +22,8 @@ # include "compiler.h" # include "netlist.h" +using namespace std; + NetUDP::NetUDP(NetScope*s, perm_string n, unsigned pins, PUdp *u) : NetNode(s, n, pins), udp(u) { diff --git a/netclass.h b/netclass.h index b6d26e114..c97180c4d 100644 --- a/netclass.h +++ b/netclass.h @@ -1,7 +1,7 @@ #ifndef IVL_netclass_H #define IVL_netclass_H /* - * Copyright (c) 2012-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2012-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -110,7 +110,7 @@ class netclass_t : public ivl_type_s { bool emit_defs(struct target_t*tgt) const; std::ostream& debug_dump(std::ostream&fd) const; - void dump_scope(ostream&fd) const; + void dump_scope(std::ostream&fd) const; private: perm_string name_; diff --git a/netlist.cc b/netlist.cc index fe2c8b6f0..b1adf02ca 100644 --- a/netlist.cc +++ b/netlist.cc @@ -37,6 +37,7 @@ # include "netvector.h" # include "ivl_assert.h" +using namespace std; ostream& operator<< (ostream&o, NetNet::Type t) { diff --git a/netlist.h b/netlist.h index b41160321..1db59e176 100644 --- a/netlist.h +++ b/netlist.h @@ -49,7 +49,7 @@ #ifdef HAVE_IOSFWD # include #else -class ostream; +# include #endif class Design; @@ -97,7 +97,7 @@ struct functor_t; # define ENUM_UNSIGNED_INT #endif -ostream& operator << (ostream&o, ivl_variable_type_t val); +std::ostream& operator << (std::ostream&o, ivl_variable_type_t val); extern void join_island(NetPins*obj); @@ -170,7 +170,7 @@ class Link { NetPins*get_obj(); unsigned get_pin() const; - void dump_link(ostream&fd, unsigned ind) const; + void dump_link(std::ostream&fd, unsigned ind) const; private: // The NetNode manages these. They point back to the @@ -212,7 +212,7 @@ class NetPins : public LineInfo { Link&pin(unsigned idx); const Link&pin(unsigned idx) const; - void dump_node_pins(ostream&, unsigned, const char**pin_names =0) const; + void dump_node_pins(std::ostream&, unsigned, const char**pin_names =0) const; void set_default_dir(Link::DIR d); bool is_linked(); @@ -271,7 +271,7 @@ class NetObj : public NetPins, public Attrib { void fall_time(const NetExpr* d) { delay2_ = d; } void decay_time(const NetExpr* d) { delay3_ = d; } - void dump_obj_attr(ostream&, unsigned) const; + void dump_obj_attr(std::ostream&, unsigned) const; virtual void show_type(std::ostream&fd) const; @@ -322,7 +322,7 @@ class NetBranch : public NetPins, public IslandBranch { ivl_branch_s* target_obj() const { return &target_obj_; } - void dump(ostream&, unsigned) const; + void dump(std::ostream&, unsigned) const; private: perm_string name_; @@ -533,7 +533,7 @@ class NetNode : public NetObj { virtual ~NetNode(); virtual bool emit_node(struct target_t*) const; - virtual void dump_node(ostream&, unsigned) const; + virtual void dump_node(std::ostream&, unsigned) const; // This is used to scan a modifiable netlist, one node at a time. virtual void functor_node(Design*, functor_t*); @@ -592,7 +592,7 @@ class NetDelaySrc : public NetObj { bool is_parallel() const; - void dump(ostream&, unsigned ind) const; + void dump(std::ostream&, unsigned ind) const; private: uint64_t transition_delays_[12]; @@ -799,7 +799,7 @@ class NetNet : public NetObj, public PortType { unsigned delay_paths(void) const; const class NetDelaySrc*delay_path(unsigned idx) const; - virtual void dump_net(ostream&, unsigned) const; + virtual void dump_net(std::ostream&, unsigned) const; private: void initialize_dir_(); @@ -830,7 +830,7 @@ class NetNet : public NetObj, public PortType { // that is known to be driven. std::vector lref_mask_; - vector delay_paths_; + std::vector delay_paths_; int port_index_; }; @@ -849,7 +849,7 @@ struct LocalVar { class NetBaseDef { public: - NetBaseDef(NetScope*n, const vector&po, + NetBaseDef(NetScope*n, const std::vector&po, const std::vector&pd); virtual ~NetBaseDef(); @@ -946,10 +946,10 @@ class NetScope : public Definitions, public Attrib { if a unique name couldn't be generated. */ bool auto_name(const char* prefix, char pad, const char* suffix); - void add_imports(const map*imports); + void add_imports(const std::map*imports); NetScope*find_import(const Design*des, perm_string name); - void add_typedefs(const map*typedefs); + void add_typedefs(const std::map*typedefs); /* Search the scope hierarchy for the scope where 'type' was defined. */ NetScope*find_typedef_scope(const Design*des, data_type_t*type); @@ -1042,7 +1042,7 @@ class NetScope : public Definitions, public Attrib { inline bool is_interface() const { return is_interface_; } inline bool is_unit() const { return is_unit_; } inline TYPE type() const { return type_; } - void print_type(ostream&) const; + void print_type(std::ostream&) const; // This provides a link to the variable initialisation process // for use when evaluating a constant function. Note this is @@ -1062,7 +1062,7 @@ class NetScope : public Definitions, public Attrib { // This is used by the evaluate_function setup to collect // local variables from the scope. void evaluate_function_find_locals(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; void set_line(perm_string file, perm_string def_file, unsigned lineno, unsigned def_lineno); @@ -1171,7 +1171,7 @@ class NetScope : public Definitions, public Attrib { guaranteed to be unique within this scope. */ perm_string local_symbol(); - void dump(ostream&) const; + void dump(std::ostream&) const; // Check to see if the scope has items that are not allowed // in an always_comb/ff/latch process. virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -1193,8 +1193,8 @@ class NetScope : public Definitions, public Attrib { assignments from the scope pass to the parameter evaluation step. After that, it is not used. */ - list > defparams; - list,PExpr*> > defparams_later; + std::list > defparams; + std::list,PExpr*> > defparams_later; public: struct range_t { @@ -1238,16 +1238,16 @@ class NetScope : public Definitions, public Attrib { // Expression value NetExpr*val; }; - mapparameters; + std::mapparameters; - typedef map::iterator param_ref_t; + typedef std::map::iterator param_ref_t; param_ref_t find_parameter(perm_string name); /* Module instance arrays are collected here for access during the multiple elaboration passes. */ - typedef vector scope_vec_t; - mapinstance_arrays; + typedef std::vector scope_vec_t; + std::mapinstance_arrays; /* Loop generate uses this as scratch space during elaboration. Expression evaluation can use this to match @@ -1283,20 +1283,20 @@ class NetScope : public Definitions, public Attrib { signed char time_unit_, time_prec_; bool time_from_timescale_; - const map*imports_; + const std::map*imports_; - maptypedefs_; + std::maptypedefs_; NetEvent *events_; - map genvars_; + std::map genvars_; typedef std::map::const_iterator signals_map_iter_t; std::map signals_map_; perm_string module_name_; - vector port_nets; + std::vector port_nets; - vector ports_; + std::vector ports_; const NetProc*var_init_; @@ -1310,7 +1310,7 @@ class NetScope : public Definitions, public Attrib { NetScope*unit_; NetScope*up_; - map children_; + std::map children_; unsigned lcounter_; bool need_const_func_, is_const_func_, is_auto_, is_cell_, calls_stask_; @@ -1336,7 +1336,7 @@ class NetAbs : public NetNode { unsigned width() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1369,7 +1369,7 @@ class NetAddSub : public NetNode { const Link& pin_DataB() const; const Link& pin_Result() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1399,7 +1399,7 @@ class NetArrayDq : public NetNode { const Link& pin_Address() const; const Link& pin_Result() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1419,7 +1419,7 @@ class NetCastInt4 : public NetNode { unsigned width() const { return width_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1433,7 +1433,7 @@ class NetCastInt2 : public NetNode { unsigned width() const { return width_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1453,7 +1453,7 @@ class NetCastReal : public NetNode { bool signed_flag() const { return signed_flag_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1484,7 +1484,7 @@ class NetCLShift : public NetNode { const Link& pin_Result() const; const Link& pin_Distance() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1540,7 +1540,7 @@ class NetCompare : public NetNode { const Link& pin_DataB() const; virtual void functor_node(Design*, functor_t*); - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1576,7 +1576,7 @@ class NetConcat : public NetNode { // ignored. bool transparent() const { return transparent_; } - void dump_node(ostream&, unsigned ind) const; + void dump_node(std::ostream&, unsigned ind) const; bool emit_node(struct target_t*) const; void functor_node(Design*des, functor_t*fun); @@ -1618,7 +1618,7 @@ class NetDivide : public NetNode { const Link& pin_DataB() const; const Link& pin_Result() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1662,7 +1662,7 @@ class NetModulo : public NetNode { const Link& pin_DataB() const; const Link& pin_Result() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1711,7 +1711,7 @@ class NetFF : public NetNode { void sset_value(const verinum&val); const verinum& sset_value() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1743,7 +1743,7 @@ class NetLatch : public NetNode { const Link& pin_Data() const; const Link& pin_Q() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1784,7 +1784,7 @@ class NetMult : public NetNode { const Link& pin_DataB() const; const Link& pin_Result() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1831,7 +1831,7 @@ class NetMux : public NetNode { const Link& pin_Data(unsigned) const; const Link& pin_Sel() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1875,7 +1875,7 @@ class NetPow : public NetNode { const Link& pin_DataB() const; const Link& pin_Result() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*des, functor_t*fun); @@ -1909,7 +1909,7 @@ class NetReplicate : public NetNode { unsigned width() const; unsigned repeat() const; - void dump_node(ostream&, unsigned ind) const; + void dump_node(std::ostream&, unsigned ind) const; bool emit_node(struct target_t*) const; private: @@ -1935,7 +1935,7 @@ class NetUserFunc : public NetNode { const NetEvWait* trigger() const { return trigger_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1961,7 +1961,7 @@ class NetSysFunc : public NetNode { const NetEvWait* trigger() const { return trigger_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -1987,7 +1987,7 @@ class NetTran : public NetNode, public IslandBranch { unsigned part_width() const; unsigned part_offset() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -2011,7 +2011,7 @@ class NetExpr : public LineInfo { virtual ~NetExpr() =0; virtual void expr_scan(struct expr_scan_t*) const =0; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; // This is the advanced description of the type. I think I // want to replace the other type description members with @@ -2061,7 +2061,7 @@ class NetExpr : public LineInfo { // allocated constant, or nil if the expression cannot be // evaluated for any reason. virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; // Get the Nexus that are the input to this // expression. Normally this descends down to the reference to @@ -2107,7 +2107,7 @@ class NetEArrayPattern : public NetExpr { const NetExpr* item(size_t idx) const { return items_[idx]; } void expr_scan(struct expr_scan_t*) const; - void dump(ostream&) const; + void dump(std::ostream&) const; NetEArrayPattern* dup_expr() const; NexusSet* nex_input(bool rem_out = true, bool always_sens = false, @@ -2140,7 +2140,7 @@ class NetEConst : public NetExpr { void trim(); virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual NetEConst* dup_expr() const; virtual NetNet*synthesize(Design*, NetScope*scope, NetExpr*); @@ -2148,7 +2148,7 @@ class NetEConst : public NetExpr { bool nested_func = false) const; virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: verinum value_; @@ -2165,7 +2165,7 @@ class NetEConstEnum : public NetEConst { const netenum_t*enumeration() const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual NetEConstEnum* dup_expr() const; @@ -2186,7 +2186,7 @@ class NetEConstParam : public NetEConst { const NetScope*scope() const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual NetEConstParam* dup_expr() const; @@ -2213,7 +2213,7 @@ class NetECReal : public NetExpr { ivl_variable_type_t expr_type() const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual NetECReal* dup_expr() const; virtual NetNet*synthesize(Design*, NetScope*scope, NetExpr*); @@ -2221,7 +2221,7 @@ class NetECReal : public NetExpr { bool nested_func = false) const; virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: verireal value_; @@ -2238,7 +2238,7 @@ class NetECRealParam : public NetECReal { const NetScope*scope() const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual NetECRealParam* dup_expr() const; @@ -2293,7 +2293,7 @@ class NetPartSelect : public NetNode { /* Is the select signal signed? */ inline bool signed_flag() const { return signed_flag_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; bool emit_node(struct target_t*tgt) const; virtual void functor_node(Design*des, functor_t*fun); @@ -2330,7 +2330,7 @@ class NetSubstitute : public NetNode { inline unsigned width() const { return wid_; } inline unsigned base() const { return off_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*tgt) const; virtual void functor_node(Design*des, functor_t*fun); @@ -2359,7 +2359,7 @@ class NetBUFZ : public NetNode { unsigned width() const; bool transparent() const { return transparent_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -2404,7 +2404,7 @@ class NetCaseCmp : public NetNode { // What kind of case compare? inline kind_t kind() const { return kind_; } - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: @@ -2412,7 +2412,7 @@ class NetCaseCmp : public NetNode { const kind_t kind_; }; -extern ostream& operator << (ostream&fd, NetCaseCmp::kind_t that); +extern std::ostream& operator << (std::ostream&fd, NetCaseCmp::kind_t that); /* NOTE: This class should be replaced with the NetLiteral class * below, that is more general in that it supports different types of @@ -2439,7 +2439,7 @@ class NetConst : public NetNode { virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*, functor_t*); - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; private: verinum value_; @@ -2466,7 +2466,7 @@ class NetLiteral : public NetNode { virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*, functor_t*); - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; private: verireal real_; @@ -2505,7 +2505,7 @@ class NetLogic : public NetNode { unsigned width() const; bool is_cassign() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*, functor_t*); @@ -2530,7 +2530,7 @@ class NetSignExtend : public NetNode { unsigned width() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*, functor_t*); @@ -2555,7 +2555,7 @@ class NetUReduce : public NetNode { TYPE type() const; unsigned width() const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; virtual void functor_node(Design*, functor_t*); @@ -2619,14 +2619,14 @@ class NetUDP : public NetNode { explicit NetUDP(NetScope*s, perm_string n, unsigned pins, PUdp*u); virtual bool emit_node(struct target_t*) const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; /* Use these methods to scan the truth table of the device. "first" returns the first item in the table, and "next" returns the next item in the table. The method will return false when the scan is done. */ - bool first(string&inp, char&out) const; - bool next(string&inp, char&out) const; + bool first(std::string&inp, char&out) const; + bool next(std::string&inp, char&out) const; unsigned rows() const { return udp->tinput.count(); } unsigned nin() const { return pin_count()-1; } @@ -2637,7 +2637,7 @@ class NetUDP : public NetNode { char get_initial() const; unsigned port_count() const; - string port_name(unsigned idx) const; + std::string port_name(unsigned idx) const; private: mutable unsigned table_idx; @@ -2680,7 +2680,7 @@ class NetProc : public virtual LineInfo { // identifiers to values. The function returns true if the // processing succeeds, or false otherwise. virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; // This method is called by functors that want to scan a // process in search of matchable patterns. @@ -2710,10 +2710,10 @@ class NetProc : public virtual LineInfo { // The clock/gate enables generated by synthesis operate at a // vector level (i.e. they are asserted if any bit(s) in the // vector are driven). - typedef vector mask_t; + typedef std::vector mask_t; virtual bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); // Synthesize as synchronous logic, and return true on success. // That means binding the outputs to the data port of a FF, and @@ -2733,12 +2733,12 @@ class NetProc : public virtual LineInfo { bool&ff_negedge, NetNet*ff_clock, NetBus&ff_ce, NetBus&ff_aclr, NetBus&ff_aset, - vector&ff_aset_value, + std::vector&ff_aset_value, NexusSet&nex_map, NetBus&nex_out, - vector&bitmasks, + std::vector&bitmasks, const std::vector&events); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; // Recursively checks to see if there is delay in this element. virtual DelayType delay_type(bool print_delay=false) const; @@ -2750,7 +2750,7 @@ class NetProc : public virtual LineInfo { NexusSet&nex_map, NetBus&nex_out, NetBus&enables, - vector&bitmasks, + std::vector&bitmasks, NetProc*substmt); private: friend class NetBlock; @@ -2767,7 +2767,7 @@ class NetAlloc : public NetProc { explicit NetAlloc(NetScope*); ~NetAlloc(); - const string name() const; + const std::string name() const; const NetScope* scope() const; @@ -2775,7 +2775,7 @@ class NetAlloc : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; private: NetScope*scope_; @@ -2821,7 +2821,7 @@ class NetAssign_ { // This is so NetAssign_ objects can be passed to ivl_assert // and other macros that call this method. - string get_fileline() const; + std::string get_fileline() const; // If this expression exists, then it is used to select a word // from an array/memory. @@ -2891,7 +2891,7 @@ class NetAssign_ { // This pointer is for keeping simple lists. NetAssign_* more; - void dump_lval(ostream&o) const; + void dump_lval(std::ostream&o) const; private: // Nested l-value. If this is set, sig_ must NOT be set! @@ -2941,11 +2941,11 @@ class NetAssignBase : public NetProc { bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); // This dumps all the lval structures. - void dump_lval(ostream&) const; - virtual void dump(ostream&, unsigned ind) const; + void dump_lval(std::ostream&) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; private: @@ -2967,15 +2967,15 @@ class NetAssign : public NetAssignBase { virtual bool emit_proc(struct target_t*) const; virtual int match_proc(struct proc_match_t*); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: void eval_func_lval_op_real_(const LineInfo&loc, verireal&lv, verireal&rv) const; void eval_func_lval_op_(const LineInfo&loc, verinum&lv, verinum&rv) const; - bool eval_func_lval_(const LineInfo&loc, map&ctx, + bool eval_func_lval_(const LineInfo&loc, std::map&ctx, const NetAssign_*lval, NetExpr*rval_result) const; char op_; @@ -2990,7 +2990,7 @@ class NetAssignNB : public NetAssignBase { virtual bool emit_proc(struct target_t*) const; virtual int match_proc(struct proc_match_t*); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; unsigned nevents() const; @@ -3028,20 +3028,20 @@ class NetBlock : public NetProc { const NetProc*proc_next(const NetProc*cur) const; bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; // synthesize as asynchronous logic, and return true. bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); bool synth_sync(Design*des, NetScope*scope, bool&ff_negedge, NetNet*ff_clk, NetBus&ff_ce, NetBus&ff_aclr,NetBus&ff_aset, - vector&ff_aset_value, + std::vector&ff_aset_value, NexusSet&nex_map, NetBus&nex_out, - vector&bitmasks, + std::vector&bitmasks, const std::vector&events); // This version of emit_recurse scans all the statements of @@ -3054,7 +3054,7 @@ class NetBlock : public NetProc { virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; virtual int match_proc(struct proc_match_t*); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -3105,24 +3105,24 @@ class NetCase : public NetProc { bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: bool evaluate_function_vect_(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; bool evaluate_function_real_(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; bool synth_async_casez_(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); ivl_case_quality_t quality_; TYPE type_; @@ -3148,7 +3148,7 @@ class NetCAssign : public NetAssignBase { explicit NetCAssign(NetAssign_*lv, NetExpr*rv); ~NetCAssign(); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool emit_proc(struct target_t*) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -3188,24 +3188,24 @@ class NetCondit : public NetProc { bool is_asynchronous(); bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); bool synth_sync(Design*des, NetScope*scope, bool&ff_negedge, NetNet*ff_clk, NetBus&ff_ce, NetBus&ff_aclr,NetBus&ff_aset, - vector&ff_aset_value, + std::vector&ff_aset_value, NexusSet&nex_map, NetBus&nex_out, - vector&bitmasks, + std::vector&bitmasks, const std::vector&events); virtual bool emit_proc(struct target_t*) const; virtual int match_proc(struct proc_match_t*); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: NetExpr* expr_; @@ -3228,7 +3228,7 @@ class NetContribution : public NetProc { const NetExpr* rval() const; virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; private: NetEAccess*lval_; @@ -3248,7 +3248,7 @@ class NetDeassign : public NetAssignBase { ~NetDeassign(); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; private: // not implemented @@ -3277,10 +3277,10 @@ class NetDisable : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: NetScope*target_; @@ -3309,11 +3309,11 @@ class NetDoWhile : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: NetExpr* cond_; @@ -3388,7 +3388,7 @@ class NetEvent : public LineInfo { // Locate the first event that matches my behavior and // monitors the same signals. - void find_similar_event(list&); + void find_similar_event(std::list&); // This method replaces pointers to me with pointers to // that. It is typically used to replace similar events @@ -3444,7 +3444,7 @@ class NetEvTrig : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; private: @@ -3489,20 +3489,20 @@ class NetEvWait : public NetProc { virtual bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); virtual bool synth_sync(Design*des, NetScope*scope, bool&ff_negedge, NetNet*ff_clk, NetBus&ff_ce, NetBus&ff_aclr,NetBus&ff_aset, - vector&ff_aset_value, + std::vector&ff_aset_value, NexusSet&nex_map, NetBus&nex_out, - vector&bitmasks, + std::vector&bitmasks, const std::vector&events); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; // This will ignore any statement. - virtual void dump_inline(ostream&) const; + virtual void dump_inline(std::ostream&) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -3513,7 +3513,7 @@ class NetEvWait : public NetProc { bool has_t0_trigger_; }; -ostream& operator << (ostream&out, const NetEvWait&obj); +std::ostream& operator << (std::ostream&out, const NetEvWait&obj); class NetEvProbe : public NetNode { @@ -3530,10 +3530,10 @@ class NetEvProbe : public NetNode { NetEvent* event(); const NetEvent* event() const; - void find_similar_probes(list&); + void find_similar_probes(std::list&); virtual bool emit_node(struct target_t*) const; - virtual void dump_node(ostream&, unsigned ind) const; + virtual void dump_node(std::ostream&, unsigned ind) const; private: NetEvent*event_; @@ -3553,7 +3553,7 @@ class NetForce : public NetAssignBase { explicit NetForce(NetAssign_*l, NetExpr*r); ~NetForce(); - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool emit_proc(struct target_t*) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; }; @@ -3574,11 +3574,11 @@ class NetForever : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: NetProc*statement_; @@ -3599,16 +3599,16 @@ class NetForLoop : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; // synthesize as asynchronous logic, and return true. bool synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, - NetBus&enables, vector&bitmasks); + NetBus&enables, std::vector&bitmasks); private: NetNet*index_; @@ -3630,7 +3630,7 @@ class NetFree : public NetProc { explicit NetFree(NetScope*); ~NetFree(); - const string name() const; + const std::string name() const; const NetScope* scope() const; @@ -3638,7 +3638,7 @@ class NetFree : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; private: NetScope*scope_; @@ -3677,7 +3677,7 @@ class NetFuncDef : public NetBaseDef { // cannot evaluate to a constant, this returns nil. NetExpr* evaluate_function(const LineInfo&loc, const std::vector&args) const; - void dump(ostream&, unsigned ind) const; + void dump(std::ostream&, unsigned ind) const; private: NetNet*result_sig_; @@ -3712,7 +3712,7 @@ class NetPDelay : public NetProc { virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -3740,11 +3740,11 @@ class NetRepeat : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: NetExpr*expr_; @@ -3764,7 +3764,7 @@ class NetRelease : public NetAssignBase { ~NetRelease(); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; private: @@ -3795,10 +3795,10 @@ class NetSTask : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: const char* name_; @@ -3821,11 +3821,11 @@ class NetSTask : public NetProc { class NetTaskDef : public NetBaseDef { public: - NetTaskDef(NetScope*n, const vector&po, + NetTaskDef(NetScope*n, const std::vector&po, const std::vector&pd); ~NetTaskDef(); - void dump(ostream&, unsigned) const; + void dump(std::ostream&, unsigned) const; DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -3880,7 +3880,7 @@ class NetEUFunc : public NetExpr { virtual ivl_variable_type_t expr_type() const; virtual const netenum_t* enumeration() const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual void expr_scan(struct expr_scan_t*) const; virtual NetEUFunc*dup_expr() const; @@ -3888,7 +3888,7 @@ class NetEUFunc : public NetExpr { bool nested_func = false) const; virtual NetExpr* eval_tree(); virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual NetNet* synthesize(Design*des, NetScope*scope, NetExpr*root); @@ -3917,7 +3917,7 @@ class NetEAccess : public NetExpr { NetBranch* get_branch() const { return branch_; } virtual ivl_variable_type_t expr_type() const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual void expr_scan(struct expr_scan_t*) const; virtual NetEAccess*dup_expr() const; @@ -3940,7 +3940,7 @@ class NetUTask : public NetProc { explicit NetUTask(NetScope*); ~NetUTask(); - const string name() const; + const std::string name() const; const NetScope* task() const; @@ -3948,7 +3948,7 @@ class NetUTask : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; @@ -3975,11 +3975,11 @@ class NetWhile : public NetProc { bool nested_func = false) const; virtual void nex_output(NexusSet&); virtual bool emit_proc(struct target_t*) const; - virtual void dump(ostream&, unsigned ind) const; + virtual void dump(std::ostream&, unsigned ind) const; virtual DelayType delay_type(bool print_delay=false) const; virtual bool check_synth(ivl_process_type_t pr_type, const NetScope*scope) const; virtual bool evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; private: NetExpr*cond_; @@ -4019,13 +4019,13 @@ class NetProcTop : public LineInfo, public Attrib { or return false if that cannot be done. */ bool synth_sync(Design*des); - void dump(ostream&, unsigned ind) const; + void dump(std::ostream&, unsigned ind) const; bool emit(struct target_t*tgt) const; private: bool tie_off_floating_inputs_(Design*des, NexusSet&nex_map, NetBus&nex_in, - vector&bitmasks, + std::vector&bitmasks, bool is_ff_input); const ivl_process_type_t type_; @@ -4051,7 +4051,7 @@ class NetAnalogTop : public LineInfo, public Attrib { NetScope*scope(); const NetScope*scope() const; - void dump(ostream&, unsigned ind) const; + void dump(std::ostream&, unsigned ind) const; bool emit(struct target_t*tgt) const; private: @@ -4115,12 +4115,12 @@ class NetEBinary : public NetExpr { virtual NetEBinary* dup_expr() const; virtual NetExpr* eval_tree(); virtual NetExpr* evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; protected: char op_; @@ -4376,17 +4376,17 @@ class NetEConcat : public NetExpr { virtual NetEConcat* dup_expr() const; virtual NetEConst* eval_tree(); virtual NetExpr* evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual NetNet*synthesize(Design*, NetScope*scope, NetExpr*root); virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; private: std::vectorparms_; unsigned repeat_; ivl_variable_type_t expr_type_; - NetEConst* eval_arguments_(const vector&vals, unsigned gap) const; + NetEConst* eval_arguments_(const std::vector&vals, unsigned gap) const; }; @@ -4433,10 +4433,10 @@ class NetESelect : public NetExpr { virtual void expr_scan(struct expr_scan_t*) const; virtual NetEConst* eval_tree(); virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual NetESelect* dup_expr() const; virtual NetNet*synthesize(Design*des, NetScope*scope, NetExpr*root); - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; private: NetExpr*expr_; @@ -4461,7 +4461,7 @@ class NetEEvent : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; private: NetEvent*event_; @@ -4485,7 +4485,7 @@ class NetENetenum : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; private: const netenum_t*netenum_; @@ -4510,7 +4510,7 @@ class NetENew : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; private: ivl_type_t obj_type_; @@ -4533,7 +4533,7 @@ class NetENull : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; }; /* @@ -4560,7 +4560,7 @@ class NetEProperty : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; private: NetNet*net_; @@ -4586,7 +4586,7 @@ class NetEScope : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; private: NetScope*scope_; @@ -4615,13 +4615,13 @@ class NetESFunc : public NetExpr { virtual NetExpr* eval_tree(); virtual NetExpr* evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual ivl_variable_type_t expr_type() const; virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; virtual const netenum_t* enumeration() const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual void expr_scan(struct expr_scan_t*) const; virtual NetESFunc*dup_expr() const; @@ -4757,7 +4757,7 @@ class NetEShallowCopy : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual void dump(ostream&os) const; + virtual void dump(std::ostream&os) const; void expr_scan_oper1(struct expr_scan_t*) const; void expr_scan_oper2(struct expr_scan_t*) const; @@ -4787,12 +4787,12 @@ class NetETernary : public NetExpr { virtual NetETernary* dup_expr() const; virtual NetExpr* eval_tree(); virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual ivl_variable_type_t expr_type() const; virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; virtual NetNet*synthesize(Design*, NetScope*scope, NetExpr*root); public: @@ -4841,14 +4841,14 @@ class NetEUnary : public NetExpr { virtual NetEUnary* dup_expr() const; virtual NetExpr* eval_tree(); virtual NetExpr* evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; virtual NetNet* synthesize(Design*, NetScope*scope, NetExpr*root); virtual ivl_variable_type_t expr_type() const; virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; protected: char op_; @@ -4895,7 +4895,7 @@ class NetECast : public NetEUnary { virtual NetNet* synthesize(Design*, NetScope*scope, NetExpr*root); virtual NetECast* dup_expr() const; virtual ivl_variable_type_t expr_type() const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; private: virtual NetExpr* eval_arguments_(const NetExpr*ex) const; @@ -4929,7 +4929,7 @@ class NetESignal : public NetExpr { const netenum_t*enumeration() const; virtual NetExpr*evaluate_function(const LineInfo&loc, - map&ctx) const; + std::map&ctx) const; // This is the expression for selecting an array word, if this // signal refers to an array. @@ -4947,7 +4947,7 @@ class NetESignal : public NetExpr { virtual ivl_variable_type_t expr_type() const; virtual void expr_scan(struct expr_scan_t*) const; - virtual void dump(ostream&) const; + virtual void dump(std::ostream&) const; private: NetNet*net_; @@ -4991,9 +4991,9 @@ class Design { steps can then use the get_flag() function to get the value of an interesting key. */ - void set_flags(const map&f) { flags_ = f; } + void set_flags(const std::map&f) { flags_ = f; } - const char* get_flag(const string&key) const; + const char* get_flag(const std::string&key) const; NetScope* make_root_scope(perm_string name, NetScope*unit_scope, bool program_block, bool is_interface); @@ -5039,10 +5039,10 @@ class Design { is pushed onto the scope_elaborations list. The scope elaborator will go through this list elaborating scopes until the list is empty. */ - listelaboration_work_list; + std::listelaboration_work_list; void run_elaboration_work(void); - set defparams_later; + std::set defparams_later; // PARAMETERS @@ -5081,7 +5081,7 @@ class Design { NetNet* find_discipline_reference(ivl_discipline_t dis, NetScope*scope); // Iterate over the design... - void dump(ostream&) const; + void dump(std::ostream&) const; void functor(struct functor_t*); void join_islands(void); int emit(struct target_t*) const; @@ -5099,7 +5099,7 @@ class Design { // Keep a tree of scopes. The NetScope class handles the wide // tree and per-hop searches for me. - listroot_scopes_; + std::listroot_scopes_; // Keep a map of all the elaborated packages. Note that // packages do not nest. @@ -5122,10 +5122,10 @@ class Design { NetAnalogTop*aprocs_; // Map of discipline take to NetNet for the reference node. - mapdiscipline_references_; + std::mapdiscipline_references_; // Map the design arguments to values. - map flags_; + std::map flags_; int des_precision_; delay_sel_t des_delay_sel_; @@ -5165,10 +5165,10 @@ extern Link* find_next_output(Link*lnk); const NetNet* find_link_signal(const NetObj*net, unsigned pin, unsigned&bidx); -inline ostream& operator << (ostream&o, const NetExpr&exp) +inline std::ostream& operator << (std::ostream&o, const NetExpr&exp) { exp.dump(o); return o; } -extern ostream& operator << (ostream&, NetNet::Type); +extern std::ostream& operator << (std::ostream&, NetNet::Type); /* * Manipulator to dump a scope complete path to the output. The @@ -5180,13 +5180,13 @@ struct __ScopePathManip { const NetScope*scope; }; inline __ScopePathManip scope_path(const NetScope*scope) { __ScopePathManip tmp; tmp.scope = scope; return tmp; } -extern ostream& operator << (ostream&o, __ScopePathManip); +extern std::ostream& operator << (std::ostream&o, __ScopePathManip); struct __ObjectPathManip { const NetObj*obj; }; inline __ObjectPathManip scope_path(const NetObj*obj) { __ObjectPathManip tmp; tmp.obj = obj; return tmp; } -extern ostream& operator << (ostream&o, __ObjectPathManip); +extern std::ostream& operator << (std::ostream&o, __ObjectPathManip); /* * If this link has a nexus_ pointer, then it is the last Link in the diff --git a/netmisc.cc b/netmisc.cc index 3fba3ae72..436df444a 100644 --- a/netmisc.cc +++ b/netmisc.cc @@ -30,6 +30,7 @@ # include "compiler.h" # include "ivl_assert.h" +using namespace std; NetNet* sub_net_from(Design*des, NetScope*scope, long val, NetNet*sig) { diff --git a/netmisc.h b/netmisc.h index b824b631f..ccb2e517e 100644 --- a/netmisc.h +++ b/netmisc.h @@ -130,7 +130,7 @@ extern NetExpr*normalize_variable_base(NetExpr *base, long msb, long lsb, unsigned long wid, bool is_up, long slice_off =0); extern NetExpr*normalize_variable_base(NetExpr *base, - const list&dims, + const std::list&dims, unsigned long wid, bool is_up); /* @@ -141,7 +141,7 @@ extern NetExpr*normalize_variable_base(NetExpr *base, * ... foo[1][x] ... * base is (x) and the generated expression will be (x+8). */ -extern NetExpr*normalize_variable_bit_base(const list&indices, NetExpr *base, +extern NetExpr*normalize_variable_bit_base(const std::list&indices, NetExpr *base, const NetNet*reg); /* @@ -153,7 +153,7 @@ extern NetExpr*normalize_variable_bit_base(const list&indices, NetExpr *ba * base is (x), wid input is (2), and is_up is (true). The output * expression is (x+8). */ -extern NetExpr *normalize_variable_part_base(const list&indices, NetExpr*base, +extern NetExpr *normalize_variable_part_base(const std::list&indices, NetExpr*base, const NetNet*reg, unsigned long wid, bool is_up); /* @@ -167,7 +167,7 @@ extern NetExpr *normalize_variable_part_base(const list&indices, NetExpr*b * base is (x) and the generated expression will be (x*8 - 8), with * lwid set to (8). */ -extern NetExpr*normalize_variable_slice_base(const list&indices, NetExpr *base, +extern NetExpr*normalize_variable_slice_base(const std::list&indices, NetExpr *base, const NetNet*reg, unsigned long&lwid); /* @@ -181,8 +181,8 @@ template struct __IndicesManip { template inline __IndicesManip as_indices(const std::list&indices) { return __IndicesManip(indices); } -extern ostream& operator << (ostream&o, __IndicesManip); -extern ostream& operator << (ostream&o, __IndicesManip); +extern std::ostream& operator << (std::ostream&o, __IndicesManip); +extern std::ostream& operator << (std::ostream&o, __IndicesManip); /* * Given a list of index expressions, generate elaborated expressions @@ -198,18 +198,18 @@ extern void indices_to_expressions(Design*des, NetScope*scope, const LineInfo*loc, // src is the index list, and count is // the number of items in the list to use. - const list&src, unsigned count, + const std::list&src, unsigned count, // True if the expression MUST be constant. bool need_const, // These are the outputs. indices_flags&flags, - list&indices,list&indices_const); + std::list&indices,std::list&indices_const); -extern NetExpr*normalize_variable_unpacked(const NetNet*net, list&indices); -extern NetExpr*normalize_variable_unpacked(const netsarray_t*net, list&indices); +extern NetExpr*normalize_variable_unpacked(const NetNet*net, std::list&indices); +extern NetExpr*normalize_variable_unpacked(const netsarray_t*net, std::list&indices); -extern NetExpr*normalize_variable_unpacked(const NetNet*net, list&indices); -extern NetExpr*normalize_variable_unpacked(const LineInfo&loc, const netsarray_t*net, list&indices); +extern NetExpr*normalize_variable_unpacked(const NetNet*net, std::list&indices); +extern NetExpr*normalize_variable_unpacked(const LineInfo&loc, const netsarray_t*net, std::list&indices); extern NetExpr*make_canonical_index(Design*des, NetScope*scope, // loc for error messages @@ -387,15 +387,15 @@ extern uint64_t get_scaled_time_from_real(Design*des, extern void collapse_partselect_pv_to_concat(Design*des, NetNet*sig); extern bool evaluate_index_prefix(Design*des, NetScope*scope, - list&prefix_indices, - const list&indices); + std::list&prefix_indices, + const std::list&indices); extern NetExpr*collapse_array_indices(Design*des, NetScope*scope, NetNet*net, const std::list&indices); extern NetExpr*collapse_array_exprs(Design*des, NetScope*scope, const LineInfo*loc, NetNet*net, - const list&indices); + const std::list&indices); extern void assign_unpacked_with_bufz(Design*des, NetScope*scope, const LineInfo*loc, diff --git a/nodangle.cc b/nodangle.cc index 1e7551e27..0a79846ac 100644 --- a/nodangle.cc +++ b/nodangle.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -29,6 +29,8 @@ # include "netlist.h" # include "compiler.h" +using namespace std; + class nodangle_f : public functor_t { public: void event(Design*des, NetEvent*ev); diff --git a/parse.y b/parse.y index fd14b586d..cda90be9a 100644 --- a/parse.y +++ b/parse.y @@ -31,11 +31,13 @@ # include # include +using namespace std; + class PSpecPath; extern void lex_end_table(); -static list* param_active_range = 0; +static std::list* param_active_range = 0; static bool param_active_signed = false; static ivl_variable_type_t param_active_type = IVL_VT_LOGIC; @@ -92,7 +94,7 @@ static unsigned args_after_notifier; /* The rules sometimes push attributes into a global context where sub-rules may grab them. This makes parser rules a little easier to write in some cases. */ -static list*attributes_in_context = 0; +static std::list*attributes_in_context = 0; /* Later version of bison (including 1.35) will not compile in stack extension if the output is compiled with C++ and either the YYSTYPE @@ -132,15 +134,15 @@ static list*attributes_in_context = 0; static const struct str_pair_t pull_strength = { IVL_DR_PULL, IVL_DR_PULL }; static const struct str_pair_t str_strength = { IVL_DR_STRONG, IVL_DR_STRONG }; -static list* make_port_list(char*id, list*udims, PExpr*expr) +static std::list* make_port_list(char*id, std::list*udims, PExpr*expr) { - list*tmp = new list; + std::list*tmp = new std::list; tmp->push_back(pform_port_t(lex_strings.make(id), udims, expr)); delete[]id; return tmp; } -static list* make_port_list(list*tmp, - char*id, list*udims, PExpr*expr) +static std::list* make_port_list(list*tmp, + char*id, std::list*udims, PExpr*expr) { tmp->push_back(pform_port_t(lex_strings.make(id), udims, expr)); delete[]id; @@ -153,20 +155,20 @@ list* make_range_from_width(uint64_t wid) range.first = new PENumber(new verinum(wid-1, integer_width)); range.second = new PENumber(new verinum((uint64_t)0, integer_width)); - list*rlist = new list; + std::list*rlist = new std::list; rlist->push_back(range); return rlist; } -static list* list_from_identifier(char*id) +static std::list* list_from_identifier(char*id) { - list*tmp = new list; + std::list*tmp = new std::list; tmp->push_back(lex_strings.make(id)); delete[]id; return tmp; } -static list* list_from_identifier(list*tmp, char*id) +static std::list* list_from_identifier(list*tmp, char*id) { tmp->push_back(lex_strings.make(id)); delete[]id; @@ -175,15 +177,15 @@ static list* list_from_identifier(list*tmp, char*id) list* copy_range(list* orig) { - list*copy = 0; + std::list*copy = 0; if (orig) - copy = new list (*orig); + copy = new std::list (*orig); return copy; } -template void append(vector&out, const vector&in) +template void append(vector&out, const std::vector&in) { for (size_t idx = 0 ; idx < in.size() ; idx += 1) out.push_back(in[idx]); @@ -207,7 +209,7 @@ static void strip_tail_items(list*lst) */ static PECallFunction*make_call_function(perm_string tn, PExpr*arg) { - vector parms(1); + std::vector parms(1); parms[0] = arg; PECallFunction*tmp = new PECallFunction(tn, parms); return tmp; @@ -215,16 +217,16 @@ static PECallFunction*make_call_function(perm_string tn, PExpr*arg) static PECallFunction*make_call_function(perm_string tn, PExpr*arg1, PExpr*arg2) { - vector parms(2); + std::vector parms(2); parms[0] = arg1; parms[1] = arg2; PECallFunction*tmp = new PECallFunction(tn, parms); return tmp; } -static list* make_named_numbers(perm_string name, long first, long last, PExpr*val =0) +static std::list* make_named_numbers(perm_string name, long first, long last, PExpr*val =0) { - list*lst = new list; + std::list*lst = new std::list; named_pexpr_t tmp; // We are counting up. if (first <= last) { @@ -250,9 +252,9 @@ static list* make_named_numbers(perm_string name, long first, lon return lst; } -static list* make_named_number(perm_string name, PExpr*val =0) +static std::list* make_named_number(perm_string name, PExpr*val =0) { - list*lst = new list; + std::list*lst = new std::list; named_pexpr_t tmp; tmp.name = name; tmp.parm = val; @@ -282,7 +284,7 @@ static long check_enum_seq_value(const YYLTYPE&loc, verinum *arg, bool zero_ok) return value; } -static void current_task_set_statement(const YYLTYPE&loc, vector*s) +static void current_task_set_statement(const YYLTYPE&loc, std::vector*s) { if (s == 0) { /* if the statement list is null, then the parser @@ -320,7 +322,7 @@ static void current_task_set_statement(const YYLTYPE&loc, vector*s) current_task->set_statement(tmp); } -static void current_function_set_statement(const YYLTYPE&loc, vector*s) +static void current_function_set_statement(const YYLTYPE&loc, std::vector*s) { if (s == 0) { /* if the statement list is null, then the parser @@ -369,11 +371,11 @@ static void current_function_set_statement(const YYLTYPE&loc, vector /* text items are C strings allocated by the lexor using strdup. They can be put into lists with the texts type. */ char*text; - list*perm_strings; + std::list*perm_strings; - list*port_list; + std::list*port_list; - vector* tf_ports; + std::vector* tf_ports; pform_name_t*pform_name; @@ -381,7 +383,7 @@ static void current_function_set_statement(const YYLTYPE&loc, vector hname_t*hier; - list*strings; + std::list*strings; struct str_pair_t drive; @@ -393,18 +395,18 @@ static void current_function_set_statement(const YYLTYPE&loc, vector Module::port_t *mport; LexicalScope::range_t* value_range; - vector*mports; + std::vector*mports; named_number_t* named_number; - list* named_numbers; + std::list* named_numbers; named_pexpr_t*named_pexpr; - list*named_pexprs; + std::list*named_pexprs; struct parmvalue_t*parmvalue; - list*ranges; + std::list*ranges; PExpr*expr; - list*exprs; + std::list*exprs; svector*event_expr; @@ -416,20 +418,20 @@ static void current_function_set_statement(const YYLTYPE&loc, vector PBlock::BL_TYPE join_keyword; PWire*wire; - vector*wires; + std::vector*wires; PEventStatement*event_statement; Statement*statement; - vector*statement_list; + std::vector*statement_list; net_decl_assign_t*net_decl_assign; enum_type_t*enum_type; decl_assignment_t*decl_assignment; - list*decl_assignments; + std::list*decl_assignments; struct_member_t*struct_member; - list*struct_members; + std::list*struct_members; struct_type_t*struct_type; data_type_t*data_type; @@ -445,7 +447,7 @@ static void current_function_set_statement(const YYLTYPE&loc, vector struct { data_type_t*type; - list*exprs; + std::list*exprs; } class_declaration_extends; struct { @@ -458,7 +460,7 @@ static void current_function_set_statement(const YYLTYPE&loc, vector verireal* realtime; PSpecPath* specpath; - list *dimensions; + std::list *dimensions; LexicalScope::lifetime_t lifetime; }; @@ -981,7 +983,7 @@ class_item_qualifier_opt class_new /* IEEE1800-2005 A.2.4 */ : K_new '(' expression_list_with_nuls ')' - { list*expr_list = $3; + { std::list*expr_list = $3; strip_tail_items(expr_list); PENewClass*tmp = new PENewClass(*expr_list); FILE_NAME(tmp, @1); @@ -1197,14 +1199,14 @@ data_type /* IEEE1800-2005: A.2.2.1 */ $$ = tmp; } | K_integer signed_unsigned_opt - { list*pd = make_range_from_width(integer_width); + { std::list*pd = make_range_from_width(integer_width); vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, $2, pd); tmp->reg_flag = true; tmp->integer_flag = true; $$ = tmp; } | K_time unsigned_signed_opt - { list*pd = make_range_from_width(64); + { std::list*pd = make_range_from_width(64); vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, $2, pd); tmp->reg_flag = !gn_system_verilog(); $$ = tmp; @@ -1750,12 +1752,12 @@ loop_statement /* IEEE1800-2005: A.6.8 */ /* TODO: Replace register_variable_list with list_of_variable_decl_assignments. */ list_of_variable_decl_assignments /* IEEE1800-2005 A.2.3 */ : variable_decl_assignment - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); $$ = tmp; } | list_of_variable_decl_assignments ',' variable_decl_assignment - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($3); $$ = tmp; } @@ -1800,13 +1802,13 @@ variable_decl_assignment /* IEEE1800-2005 A.2.3 */ loop_variables /* IEEE1800-2005: A.6.8 */ : loop_variables ',' IDENTIFIER - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); delete[]$3; $$ = tmp; } | IDENTIFIER - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); delete[]$1; $$ = tmp; @@ -2115,7 +2117,7 @@ simple_immediate_assertion_statement /* IEEE1800-2012 A.6.10 */ : assert_or_assume '(' expression ')' statement_or_null %prec less_than_K_else { if (gn_supported_assertions_flag) { - listarg_list; + std::listarg_list; PCallTask*tmp1 = new PCallTask(lex_strings.make("$error"), arg_list); FILE_NAME(tmp1, @1); PCondit*tmp2 = new PCondit($3, $5, tmp1); @@ -2201,14 +2203,14 @@ simple_type_or_string /* IEEE1800-2005: A.2.2.1 */ $$ = tmp; } | K_integer - { list*pd = make_range_from_width(integer_width); + { std::list*pd = make_range_from_width(integer_width); vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, true, pd); tmp->reg_flag = true; tmp->integer_flag = true; $$ = tmp; } | K_time - { list*pd = make_range_from_width(64); + { std::list*pd = make_range_from_width(64); vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd); tmp->reg_flag = !gn_system_verilog(); $$ = tmp; @@ -2388,7 +2390,7 @@ task_declaration /* IEEE1800-2005: A.2.7 */ tf_port_declaration /* IEEE1800-2005: A.2.7 */ : port_direction K_reg_opt unsigned_signed_opt dimensions_opt list_of_identifiers ';' - { vector*tmp = pform_make_task_ports(@1, $1, + { std::vector*tmp = pform_make_task_ports(@1, $1, $2 ? IVL_VT_LOGIC : IVL_VT_NO_TYPE, $3, $4, $5); @@ -2399,7 +2401,7 @@ tf_port_declaration /* IEEE1800-2005: A.2.7 */ shape. Generate a range ([31:0]) to make it work. */ | port_direction K_integer list_of_identifiers ';' - { list*range_stub = make_range_from_width(integer_width); + { std::list*range_stub = make_range_from_width(integer_width); vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_LOGIC, true, range_stub, $3, true); $$ = tmp; @@ -2408,7 +2410,7 @@ tf_port_declaration /* IEEE1800-2005: A.2.7 */ /* Ports can be time with a width of [63:0] (unsigned). */ | port_direction K_time list_of_identifiers ';' - { list*range_stub = make_range_from_width(64); + { std::list*range_stub = make_range_from_width(64); vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_LOGIC, false, range_stub, $3); $$ = tmp; @@ -2417,7 +2419,7 @@ tf_port_declaration /* IEEE1800-2005: A.2.7 */ /* Ports can be real or realtime. */ | port_direction real_or_realtime list_of_identifiers ';' - { vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_REAL, true, + { std::vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_REAL, true, 0, $3); $$ = tmp; } @@ -2426,7 +2428,7 @@ tf_port_declaration /* IEEE1800-2005: A.2.7 */ /* Ports can be string. */ | port_direction K_string list_of_identifiers ';' - { vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_STRING, true, + { std::vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_STRING, true, 0, $3); $$ = tmp; } @@ -2445,7 +2447,7 @@ tf_port_declaration /* IEEE1800-2005: A.2.7 */ tf_port_item /* IEEE1800-2005: A.2.7 */ : port_direction_opt data_type_or_implicit IDENTIFIER dimensions_opt tf_port_item_expr_opt - { vector*tmp; + { std::vector*tmp; NetNet::PortType use_port_type = $1; if ((use_port_type == NetNet::PIMPLICIT) && (gn_system_verilog() || ($2 == 0))) use_port_type = port_declaration_context.port_type; @@ -2526,7 +2528,7 @@ tf_port_list /* IEEE1800-2005: A.2.7 */ tf_port_item_list : tf_port_item_list ',' tf_port_item - { vector*tmp; + { std::vector*tmp; if ($1 && $3) { size_t s1 = $1->size(); tmp = $1; @@ -2590,7 +2592,7 @@ value_range /* IEEE1800-2005: A.8.3 */ variable_dimension /* IEEE1800-2005: A.2.5 */ : '[' expression ':' expression ']' - { list *tmp = new list; + { std::list *tmp = new std::list; pform_range_t index ($2,$4); tmp->push_back(index); $$ = tmp; @@ -2602,20 +2604,20 @@ variable_dimension /* IEEE1800-2005: A.2.5 */ cerr << @2 << ": warning: Use of SystemVerilog [size] dimension. " << "Use at least -g2005-sv to remove this warning." << endl; } - list *tmp = new list; + list *tmp = new std::list; pform_range_t index ($2,0); tmp->push_back(index); $$ = tmp; } | '[' ']' - { list *tmp = new list; + { std::list *tmp = new std::list; pform_range_t index (0,0); tmp->push_back(index); $$ = tmp; } | '[' '$' ']' { // SystemVerilog queue - list *tmp = new list; + list *tmp = new std::list; pform_range_t index (new PENull,0); if (!gn_system_verilog()) { yyerror("error: Queue declarations require SystemVerilog."); @@ -2625,7 +2627,7 @@ variable_dimension /* IEEE1800-2005: A.2.5 */ } | '[' '$' ':' expression ']' { // SystemVerilog queue with a max size - list *tmp = new list; + list *tmp = new std::list; pform_range_t index (new PENull,$4); if (!gn_system_verilog()) { yyerror("error: Queue declarations require SystemVerilog."); @@ -2663,7 +2665,7 @@ attribute_instance_list | K_PSTAR attribute_list K_STARP { $$ = $2; } | attribute_instance_list K_PSTAR K_STARP { $$ = $1; } | attribute_instance_list K_PSTAR attribute_list K_STARP - { list*tmp = $1; + { std::list*tmp = $1; if (tmp) { tmp->splice(tmp->end(), *$3); delete $3; @@ -2674,13 +2676,13 @@ attribute_instance_list attribute_list : attribute_list ',' attribute - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(*$3); delete $3; $$ = tmp; } | attribute - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(*$1); delete $1; $$ = tmp; @@ -2914,7 +2916,7 @@ enum_name_list { $$ = $1; } | enum_name_list ',' enum_name - { list*lst = $1; + { std::list*lst = $1; lst->splice(lst->end(), *$3); delete $3; $$ = lst; @@ -3018,12 +3020,12 @@ struct_data_type in IEEE 1800-2012 A.2.2.1. */ struct_union_member_list : struct_union_member_list struct_union_member - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($2); $$ = tmp; } | struct_union_member - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); $$ = tmp; } @@ -3111,12 +3113,12 @@ defparam_assign_list delay1 : '#' delay_value_simple - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($2); $$ = tmp; } | '#' '(' delay_value ')' - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($3); $$ = tmp; } @@ -3124,23 +3126,23 @@ delay1 delay3 : '#' delay_value_simple - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($2); $$ = tmp; } | '#' '(' delay_value ')' - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($3); $$ = tmp; } | '#' '(' delay_value ',' delay_value ')' - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($3); tmp->push_back($5); $$ = tmp; } | '#' '(' delay_value ',' delay_value ',' delay_value ')' - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($3); tmp->push_back($5); tmp->push_back($7); @@ -3155,12 +3157,12 @@ delay3_opt delay_value_list : delay_value - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); $$ = tmp; } | delay_value_list ',' delay_value - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($3); $$ = tmp; } @@ -3737,22 +3739,22 @@ expr_mintypmax expression_list_with_nuls : expression_list_with_nuls ',' expression - { list*tmp = $1; + { std::list*tmp = $1; if (tmp->empty()) tmp->push_back(0); tmp->push_back($3); $$ = tmp; } | expression - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); $$ = tmp; } | - { list*tmp = new list; + { std::list*tmp = new std::list; $$ = tmp; } | expression_list_with_nuls ',' - { list*tmp = $1; + { std::list*tmp = $1; if (tmp->empty()) tmp->push_back(0); tmp->push_back(0); $$ = tmp; @@ -3761,12 +3763,12 @@ expression_list_with_nuls expression_list_proper : expression_list_proper ',' expression - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($3); $$ = tmp; } | expression - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); $$ = tmp; } @@ -3848,7 +3850,7 @@ expr_primary call. It can also be a call to a class method (function). */ | hierarchy_identifier attribute_list_opt '(' expression_list_with_nuls ')' - { list*expr_list = $4; + { std::list*expr_list = $4; strip_tail_items(expr_list); PECallFunction*tmp = pform_make_call_function(@1, *$1, *expr_list); delete $1; @@ -3884,7 +3886,7 @@ expr_primary } | SYSTEM_IDENTIFIER '(' ')' { perm_string tn = lex_strings.make($1); - const vectorempty; + const std::vectorempty; PECallFunction*tmp = new PECallFunction(tn, empty); FILE_NAME(tmp, @1); delete[]$1; @@ -4120,7 +4122,7 @@ expr_primary | '{' '}' { // This is the empty queue syntax. if (gn_system_verilog()) { - list empty_list; + std::list empty_list; PEConcat*tmp = new PEConcat(empty_list); FILE_NAME(tmp, @1); $$ = tmp; @@ -4188,7 +4190,7 @@ function_item_list | function_item_list function_item { /* */ if ($1 && $2) { - vector*tmp = $1; + std::vector*tmp = $1; size_t s1 = tmp->size(); tmp->resize(s1 + $2->size()); for (size_t idx = 0 ; idx < $2->size() ; idx += 1) @@ -4488,13 +4490,13 @@ list_of_variable_port_identifiers list_of_ports : port_opt - { vector*tmp - = new vector(1); + { std::vector*tmp + = new std::vector(1); (*tmp)[0] = $1; $$ = tmp; } | list_of_ports ',' port_opt - { vector*tmp = $1; + { std::vector*tmp = $1; tmp->push_back($3); $$ = tmp; } @@ -4502,13 +4504,13 @@ list_of_ports list_of_port_declarations : port_declaration - { vector*tmp - = new vector(1); + { std::vector*tmp + = new std::vector(1); (*tmp)[0] = $1; $$ = tmp; } | list_of_port_declarations ',' port_declaration - { vector*tmp = $1; + { std::vector*tmp = $1; tmp->push_back($3); $$ = tmp; } @@ -4517,7 +4519,7 @@ list_of_port_declarations perm_string name = lex_strings.make($3); ptmp = pform_module_port_reference(name, @3.text, @3.first_line); - vector*tmp = $1; + std::vector*tmp = $1; tmp->push_back(ptmp); /* Get the port declaration details, the port type @@ -4765,7 +4767,7 @@ lpvalue cont_assign : lpvalue '=' expression - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); tmp->push_back($3); $$ = tmp; @@ -4774,7 +4776,7 @@ cont_assign cont_assign_list : cont_assign_list ',' cont_assign - { list*tmp = $1; + { std::list*tmp = $1; tmp->splice(tmp->end(), *$3); delete $3; $$ = tmp; @@ -5654,7 +5656,7 @@ parameter_value_opt FILE_NAME(tmp, @1); struct parmvalue_t*lst = new struct parmvalue_t; - lst->by_order = new list; + lst->by_order = new std::list; lst->by_order->push_back(tmp); lst->by_name = 0; $$ = lst; @@ -5666,7 +5668,7 @@ parameter_value_opt FILE_NAME(tmp, @1); struct parmvalue_t*lst = new struct parmvalue_t; - lst->by_order = new list; + lst->by_order = new std::list; lst->by_order->push_back(tmp); lst->by_name = 0; $$ = lst; @@ -5699,13 +5701,13 @@ parameter_value_byname parameter_value_byname_list : parameter_value_byname - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(*$1); delete $1; $$ = tmp; } | parameter_value_byname_list ',' parameter_value_byname - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(*$3); delete $3; $$ = tmp; @@ -5817,13 +5819,13 @@ port_name port_name_list : port_name_list ',' port_name - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(*$3); delete $3; $$ = tmp; } | port_name - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(*$1); delete $1; $$ = tmp; @@ -5832,24 +5834,24 @@ port_name_list port_conn_expression_list_with_nuls : port_conn_expression_list_with_nuls ',' attribute_list_opt expression - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($4); delete $3; $$ = tmp; } | attribute_list_opt expression - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($2); delete $1; $$ = tmp; } | - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(0); $$ = tmp; } | port_conn_expression_list_with_nuls ',' - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(0); $$ = tmp; } @@ -5954,7 +5956,7 @@ dimensions : variable_dimension { $$ = $1; } | dimensions variable_dimension - { list *tmp = $1; + { std::list *tmp = $1; if ($2) { tmp->splice(tmp->end(), *$2); delete $2; @@ -6008,13 +6010,13 @@ register_variable register_variable_list : register_variable - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); $$ = tmp; delete[]$1; } | register_variable_list ',' register_variable - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); $$ = tmp; delete[]$3; @@ -6033,13 +6035,13 @@ net_variable net_variable_list : net_variable - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); $$ = tmp; delete[]$1; } | net_variable_list ',' net_variable - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); $$ = tmp; delete[]$3; @@ -6185,7 +6187,7 @@ specify_edge_path_decl : specify_edge_path '=' '(' delay_value_list ')' { $$ = pform_assign_path_delay($1, $4); } | specify_edge_path '=' delay_value_simple - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($3); $$ = pform_assign_path_delay($1, tmp); } @@ -6222,7 +6224,7 @@ specify_simple_path_decl : specify_simple_path '=' '(' delay_value_list ')' { $$ = pform_assign_path_delay($1, $4); } | specify_simple_path '=' delay_value_simple - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($3); $$ = pform_assign_path_delay($1, tmp); } @@ -6248,7 +6250,7 @@ specify_simple_path specify_path_identifiers : IDENTIFIER - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); $$ = tmp; delete[]$1; @@ -6259,7 +6261,7 @@ specify_path_identifiers "in path declarations. The declaration " "will be applied to the whole vector."); } - list*tmp = new list; + std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); $$ = tmp; delete[]$1; @@ -6270,13 +6272,13 @@ specify_path_identifiers "in path declarations. The declaration " "will be applied to the whole vector."); } - list*tmp = new list; + std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); $$ = tmp; delete[]$1; } | specify_path_identifiers ',' IDENTIFIER - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); $$ = tmp; delete[]$3; @@ -6287,7 +6289,7 @@ specify_path_identifiers "in path declarations. The declaration " "will be applied to the whole vector."); } - list*tmp = $1; + std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); $$ = tmp; delete[]$3; @@ -6298,7 +6300,7 @@ specify_path_identifiers "in path declarations. The declaration " "will be applied to the whole vector."); } - list*tmp = $1; + std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); $$ = tmp; delete[]$3; @@ -6839,7 +6841,7 @@ statement_item /* This is roughly statement_item in the LRM */ $$ = tmp; } | SYSTEM_IDENTIFIER ';' - { listpt; + { std::listpt; PCallTask*tmp = new PCallTask(lex_strings.make($1), pt); FILE_NAME(tmp,@1); delete[]$1; @@ -6885,7 +6887,7 @@ statement_item /* This is roughly statement_item in the LRM */ } | hierarchy_identifier ';' - { listpt; + { std::listpt; PCallTask*tmp = pform_make_call_task(@1, *$1, pt); delete $1; $$ = tmp; @@ -6988,12 +6990,12 @@ statement_or_null_list_opt statement_or_null_list : statement_or_null_list statement_or_null - { vector*tmp = $1; + { std::vector*tmp = $1; if ($2) tmp->push_back($2); $$ = tmp; } | statement_or_null - { vector*tmp = new vector(0); + { std::vector*tmp = new std::vector(0); if ($1) tmp->push_back($1); $$ = tmp; } @@ -7007,13 +7009,13 @@ analog_statement /* Task items are, other than the statement, task port items and other block items. */ task_item - : block_item_decl { $$ = new vector(0); } + : block_item_decl { $$ = new std::vector(0); } | tf_port_declaration { $$ = $1; } ; task_item_list : task_item_list task_item - { vector*tmp = $1; + { std::vector*tmp = $1; size_t s1 = tmp->size(); tmp->resize(s1 + $2->size()); for (size_t idx = 0 ; idx < $2->size() ; idx += 1) @@ -7079,13 +7081,13 @@ udp_comb_entry udp_comb_entry_list : udp_comb_entry - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); delete[]$1; $$ = tmp; } | udp_comb_entry_list udp_comb_entry - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($2); delete[]$2; $$ = tmp; @@ -7094,13 +7096,13 @@ udp_comb_entry_list udp_sequ_entry_list : udp_sequ_entry - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back($1); delete[]$1; $$ = tmp; } | udp_sequ_entry_list udp_sequ_entry - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back($2); delete[]$2; $$ = tmp; @@ -7199,7 +7201,7 @@ udp_port_decl | K_output IDENTIFIER ';' { perm_string pname = lex_strings.make($2); PWire*pp = new PWire(pname, NetNet::IMPLICIT, NetNet::POUTPUT, IVL_VT_LOGIC); - vector*tmp = new vector(1); + vector*tmp = new std::vector(1); (*tmp)[0] = pp; $$ = tmp; delete[]$2; @@ -7207,7 +7209,7 @@ udp_port_decl | K_reg IDENTIFIER ';' { perm_string pname = lex_strings.make($2); PWire*pp = new PWire(pname, NetNet::REG, NetNet::PIMPLICIT, IVL_VT_LOGIC); - vector*tmp = new vector(1); + vector*tmp = new std::vector(1); (*tmp)[0] = pp; $$ = tmp; delete[]$2; @@ -7215,7 +7217,7 @@ udp_port_decl | K_reg K_output IDENTIFIER ';' { perm_string pname = lex_strings.make($3); PWire*pp = new PWire(pname, NetNet::REG, NetNet::POUTPUT, IVL_VT_LOGIC); - vector*tmp = new vector(1); + vector*tmp = new std::vector(1); (*tmp)[0] = pp; $$ = tmp; delete[]$3; @@ -7226,7 +7228,7 @@ udp_port_decls : udp_port_decl { $$ = $1; } | udp_port_decls udp_port_decl - { vector*tmp = $1; + { std::vector*tmp = $1; size_t s1 = $1->size(); tmp->resize(s1+$2->size()); for (size_t idx = 0 ; idx < $2->size() ; idx += 1) @@ -7238,13 +7240,13 @@ udp_port_decls udp_port_list : IDENTIFIER - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(lex_strings.make($1)); delete[]$1; $$ = tmp; } | udp_port_list ',' IDENTIFIER - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(lex_strings.make($3)); delete[]$3; $$ = tmp; @@ -7260,13 +7262,13 @@ udp_initial_expr_opt udp_input_declaration_list : K_input IDENTIFIER - { list*tmp = new list; + { std::list*tmp = new std::list; tmp->push_back(lex_strings.make($2)); $$ = tmp; delete[]$2; } | udp_input_declaration_list ',' K_input IDENTIFIER - { list*tmp = $1; + { std::list*tmp = $1; tmp->push_back(lex_strings.make($4)); $$ = tmp; delete[]$4; diff --git a/parse_api.h b/parse_api.h index 0ed284b3c..d95420916 100644 --- a/parse_api.h +++ b/parse_api.h @@ -58,7 +58,7 @@ extern void pform_dump(std::ostream&out, const PTaskFunc*tf); */ extern int pform_parse(const char*path); -extern string vl_file; +extern std::string vl_file; extern void pform_set_timescale(int units, int prec, const char*file, unsigned lineno); diff --git a/parse_misc.cc b/parse_misc.cc index 5ecffdea1..7ff8f1648 100644 --- a/parse_misc.cc +++ b/parse_misc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,6 +24,8 @@ # include # include +using namespace std; + extern const char*vl_file; unsigned error_count = 0; unsigned warn_count = 0; @@ -75,4 +77,3 @@ int VLwrap() { return -1; } - diff --git a/parse_misc.h b/parse_misc.h index 58f5aea98..c7a6faa2e 100644 --- a/parse_misc.h +++ b/parse_misc.h @@ -1,7 +1,7 @@ #ifndef IVL_parse_misc_H #define IVL_parse_misc_H /* - * Copyright (c) 1998-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -64,7 +64,7 @@ extern void VLwarn(const YYLTYPE&loc, const char*msg); extern void destroy_lexor(); -extern ostream& operator << (ostream&, const YYLTYPE&loc); +extern std::ostream& operator << (std::ostream&, const YYLTYPE&loc); extern unsigned error_count, warn_count; extern unsigned long based_size; diff --git a/pform.cc b/pform.cc index 0a4ebc886..749c29ab2 100644 --- a/pform.cc +++ b/pform.cc @@ -45,6 +45,8 @@ # include "ivl_assert.h" # include "ivl_alloc.h" +using namespace std; + /* * The "// synthesis translate_on/off" meta-comments cause this flag * to be turned off or on. The pform_make_behavior and similar diff --git a/pform.h b/pform.h index 7bf8faa87..ee9315468 100644 --- a/pform.h +++ b/pform.h @@ -89,8 +89,8 @@ extern bool pform_library_flag; struct parmvalue_t { - list*by_order; - list*by_name; + std::list*by_order; + std::list*by_name; }; struct str_pair_t { ivl_drive_t str0, str1; }; @@ -108,9 +108,9 @@ struct lgate { : parms(0), parms_by_name(0), file(NULL), lineno(0) { } - string name; - list*parms; - list*parms_by_name; + std::string name; + std::list*parms; + std::list*parms_by_name; pform_range_t range; @@ -123,8 +123,8 @@ extern std::list* copy_range(std::list* orig); /* Use this function to transform the parted form of the attribute list to the attribute map that is used later. */ -extern void pform_bind_attributes(map&attributes, - list*attr, +extern void pform_bind_attributes(std::map&attributes, + std::list*attr, bool keep_attr =false); /* The lexor calls this function to change the default nettype. */ @@ -168,8 +168,8 @@ extern PWire* pform_get_make_wire_in_scope(const struct vlltype&li, extern void pform_startmodule(const struct vlltype&loc, const char*name, bool program_block, bool is_interface, LexicalScope::lifetime_t lifetime, - list*attr); -extern void pform_module_set_ports(vector*); + std::list*attr); +extern void pform_module_set_ports(std::vector*); extern void pform_set_scope_timescale(const struct vlltype&loc); /* These functions are used when we have a complete port definition, either @@ -180,14 +180,14 @@ extern void pform_module_define_port(const struct vlltype&li, NetNet::PortType, NetNet::Type type, data_type_t*vtype, - list*attr, + std::list*attr, bool keep_attr =false); extern void pform_module_define_port(const struct vlltype&li, - list*ports, + std::list*ports, NetNet::PortType, NetNet::Type type, data_type_t*vtype, - list*attr); + std::list*attr); extern Module::port_t* pform_module_port_reference(perm_string name, const char*file, @@ -209,16 +209,16 @@ extern void pform_set_constructor_return(PFunction*net); extern void pform_end_class_declaration(const struct vlltype&loc); -extern void pform_make_udp(perm_string name, list*parms, - std::vector*decl, list*table, +extern void pform_make_udp(perm_string name, std::list*parms, + std::vector*decl, std::list*table, Statement*init, const char*file, unsigned lineno); extern void pform_make_udp(perm_string name, bool sync_flag, perm_string out_name, PExpr*sync_init, - list*parms, - list*table, + std::list*parms, + std::list*table, const char*file, unsigned lineno); /* * Package related functions. @@ -289,7 +289,7 @@ extern verinum* pform_verinum_with_size(verinum*s, verinum*val, * This function takes the list of names as new genvars to declare in * the current module or generate scope. */ -extern void pform_genvars(const struct vlltype&li, list*names); +extern void pform_genvars(const struct vlltype&li, std::list*names); /* * This flag is set by the parser to indicate the current generate block @@ -309,7 +309,7 @@ extern void pform_start_generate_if(const struct vlltype&li, PExpr*test); extern void pform_start_generate_else(const struct vlltype&li); extern void pform_start_generate_case(const struct vlltype&lp, PExpr*test); extern void pform_start_generate_nblock(const struct vlltype&lp, char*name); -extern void pform_generate_case_item(const struct vlltype&lp, list*test); +extern void pform_generate_case_item(const struct vlltype&lp, std::list*test); extern void pform_generate_block_name(char*name); extern void pform_endgenerate(bool end_conditional); @@ -350,22 +350,22 @@ extern void pform_makewire(const struct vlltype&li, perm_string name, NetNet::Type type, NetNet::PortType pt, ivl_variable_type_t, - list*attr); + std::list*attr); /* This form handles simple declarations */ extern void pform_makewire(const struct vlltype&li, - list*range, + std::list*range, bool signed_flag, - list*names, + std::list*names, NetNet::Type type, NetNet::PortType, ivl_variable_type_t, - list*attr, + std::list*attr, PWSRType rt = SR_NET); /* This form handles assignment declarations. */ extern void pform_makewire(const struct vlltype&li, - list*delay, + std::list*delay, str_pair_t str, net_decl_assign_t*assign_list, NetNet::Type type, @@ -382,8 +382,8 @@ extern void pform_makewire(const struct vlltype&li, extern void pform_makewire(const struct vlltype&li, struct_type_t*struct_type, NetNet::PortType, - list*names, - list*attr); + std::list*names, + std::list*attr); extern void pform_make_var_init(const struct vlltype&li, perm_string name, PExpr*expr); @@ -393,15 +393,15 @@ extern void pform_make_var_init(const struct vlltype&li, the port type, i.e. input, output or inout, and, if specified, the range and signedness. If the wire does not exist, create it. */ extern void pform_set_port_type(const struct vlltype&li, - list*ports, + std::list*ports, NetNet::PortType, data_type_t*dt, - list*attr); + std::list*attr); extern void pform_set_reg_idx(perm_string name, std::list*indices); -extern void pform_set_data_type(const struct vlltype&li, data_type_t*, list*names, NetNet::Type net_type, list*attr); +extern void pform_set_data_type(const struct vlltype&li, data_type_t*, std::list*names, NetNet::Type net_type, std::list*attr); extern void pform_set_struct_type(const struct vlltype&li, struct_type_t*struct_type, std::list*names, NetNet::Type net_type, std::list*attr); @@ -416,7 +416,7 @@ extern void pform_set_class_type(const struct vlltype&li, class_type_t*class_typ passed in. */ extern void pform_set_attrib(perm_string name, perm_string key, char*value); -extern void pform_set_type_attrib(perm_string name, const string&key, +extern void pform_set_type_attrib(perm_string name, const std::string&key, char*value); extern LexicalScope::range_t* pform_parameter_value_range(bool exclude_flag, @@ -427,24 +427,24 @@ extern void pform_set_parameter(const struct vlltype&loc, perm_string name, ivl_variable_type_t type, bool signed_flag, - list*range, + std::list*range, PExpr*expr, LexicalScope::range_t*value_range); extern void pform_set_localparam(const struct vlltype&loc, perm_string name, ivl_variable_type_t type, bool signed_flag, - list*range, + std::list*range, PExpr*expr); extern void pform_set_specparam(const struct vlltype&loc, perm_string name, - list*range, + std::list*range, PExpr*expr); extern void pform_set_defparam(const pform_name_t&name, PExpr*expr); extern void pform_set_param_from_type(const struct vlltype&loc, const data_type_t *data_type, const char *name, - list *¶m_range, + std::list *¶m_range, bool ¶m_signed, ivl_variable_type_t ¶m_type); @@ -452,14 +452,14 @@ extern void pform_set_param_from_type(const struct vlltype&loc, * Functions related to specify blocks. */ extern PSpecPath*pform_make_specify_path(const struct vlltype&li, - list*src, char pol, - bool full_flag, list*dst); + std::list*src, char pol, + bool full_flag, std::list*dst); extern PSpecPath*pform_make_specify_edge_path(const struct vlltype&li, int edge_flag, /*posedge==true */ - list*src, char pol, - bool full_flag, list*dst, + std::list*src, char pol, + bool full_flag, std::list*dst, PExpr*data_source_expression); -extern PSpecPath*pform_assign_path_delay(PSpecPath*obj, list*delays); +extern PSpecPath*pform_assign_path_delay(PSpecPath*obj, std::list*delays); extern void pform_module_specify_path(PSpecPath*obj); @@ -468,17 +468,17 @@ extern void pform_module_specify_path(PSpecPath*obj); * or initial items. */ extern PProcess* pform_make_behavior(ivl_process_type_t, Statement*, - list*attr); + std::list*attr); extern void pform_mc_translate_on(bool flag); -extern std::vector* pform_make_udp_input_ports(list*); +extern std::vector* pform_make_udp_input_ports(std::list*); -extern void pform_make_events(list*names, +extern void pform_make_events(std::list*names, const char*file, unsigned lineno); /* * Make real datum objects. */ -extern void pform_make_reals(list*names, +extern void pform_make_reals(std::list*names, const char*file, unsigned lineno); /* @@ -488,19 +488,19 @@ extern void pform_make_reals(list*names, extern void pform_makegates(const struct vlltype&loc, PGBuiltin::Type type, struct str_pair_t str, - list*delay, + std::list*delay, svector*gates, - list*attr); + std::list*attr); extern void pform_make_modgates(const struct vlltype&loc, perm_string type, struct parmvalue_t*overrides, svector*gates, - list*attr); + std::list*attr); /* Make a continuous assignment node, with optional bit- or part- select. */ -extern void pform_make_pgassign_list(list*alist, - list*del, +extern void pform_make_pgassign_list(std::list*alist, + std::list*del, struct str_pair_t str, const char* fn, unsigned lineno); @@ -510,14 +510,14 @@ extern std::vector*pform_make_task_ports(const struct vlltype&l NetNet::PortType pt, ivl_variable_type_t vtype, bool signed_flag, - list*range, - list*names, + std::list*range, + std::list*names, bool isint = false); extern std::vector*pform_make_task_ports(const struct vlltype&loc, NetNet::PortType pt, data_type_t*vtype, - list*names); + std::list*names); /* * The parser uses this function to convert a unary @@ -540,7 +540,7 @@ extern PExpr* pform_genvar_inc_dec(const struct vlltype&loc, const char*name, * parses the source file and places all the modules it finds into the * mod list. The dump function dumps a module to the output stream. */ -extern void pform_dump(ostream&out, Module*mod); +extern void pform_dump(std::ostream&out, Module*mod); /* ** pform_discipline.cc * Functions for handling the parse of natures and disciplines. These @@ -560,10 +560,10 @@ extern void pform_discipline_potential(const struct vlltype&loc, const char*name extern void pform_discipline_flow(const struct vlltype&loc, const char*name); extern void pform_attach_discipline(const struct vlltype&loc, - ivl_discipline_t discipline, list*names); + ivl_discipline_t discipline, std::list*names); -extern void pform_dump(ostream&out, const ivl_nature_s*); -extern void pform_dump(ostream&out, const ivl_discipline_s*); +extern void pform_dump(std::ostream&out, const ivl_nature_s*); +extern void pform_dump(std::ostream&out, const ivl_discipline_s*); /* ** pform_analog.cc */ @@ -584,7 +584,7 @@ extern PExpr* pform_make_branch_probe_expression(const struct vlltype&loc, * is the hierarchical name of a valid parameter name and value * is the value user wants to assign to. The value should be constant. */ -extern void parm_to_defparam_list(const string¶m); +extern void parm_to_defparam_list(const std::string¶m); /* * Tasks to set the timeunit or timeprecision for SystemVerilog. diff --git a/pform_analog.cc b/pform_analog.cc index 0ff9647a5..4f76ead38 100644 --- a/pform_analog.cc +++ b/pform_analog.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -23,6 +23,8 @@ # include "parse_misc.h" # include "AStatement.h" +using namespace std; + AContrib* pform_contribution_statement(const struct vlltype&loc, PExpr*lval, PExpr*rval) { diff --git a/pform_class_type.cc b/pform_class_type.cc index 84b78a83c..2408eb39d 100644 --- a/pform_class_type.cc +++ b/pform_class_type.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 Picture Elements, Inc. + * Copyright (c) 2012-2021 Picture Elements, Inc. * Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -22,6 +22,8 @@ # include "parse_misc.h" # include "ivl_assert.h" +using namespace std; + static void pform_set_class_type(const struct vlltype&li, class_type_t*, perm_string name, NetNet::Type net_type, list*attr) { PWire*net = pform_get_make_wire_in_scope(li, name, net_type, NetNet::NOT_A_PORT, IVL_VT_CLASS); diff --git a/pform_disciplines.cc b/pform_disciplines.cc index bc738fb9d..3e9ce838a 100644 --- a/pform_disciplines.cc +++ b/pform_disciplines.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -23,6 +23,8 @@ # include "parse_misc.h" # include "discipline.h" +using namespace std; + map natures; map disciplines; map access_function_nature; diff --git a/pform_dump.cc b/pform_dump.cc index ec53a13de..7259779ef 100644 --- a/pform_dump.cc +++ b/pform_dump.cc @@ -38,6 +38,8 @@ # include # include +using namespace std; + ostream& operator << (ostream&out, const PExpr&obj) { obj.dump(out); diff --git a/pform_pclass.cc b/pform_pclass.cc index c294f6000..512a4b725 100644 --- a/pform_pclass.cc +++ b/pform_pclass.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2012-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -21,6 +21,8 @@ # include "PClass.h" # include "parse_misc.h" +using namespace std; + /* * The functions here help the parser put together class type declarations. */ diff --git a/pform_string_type.cc b/pform_string_type.cc index 9d1ec73bc..9976225dc 100644 --- a/pform_string_type.cc +++ b/pform_string_type.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2012-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -21,6 +21,8 @@ # include "parse_misc.h" # include "ivl_assert.h" +using namespace std; + static void pform_set_string_type(const struct vlltype&li, const string_type_t*, perm_string name, NetNet::Type net_type, list*attr) { PWire*net = pform_get_make_wire_in_scope(li, name, net_type, NetNet::NOT_A_PORT, IVL_VT_STRING); diff --git a/pform_struct_type.cc b/pform_struct_type.cc index 4dcf4886f..108b197b6 100644 --- a/pform_struct_type.cc +++ b/pform_struct_type.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -21,6 +21,8 @@ # include "parse_misc.h" # include "ivl_assert.h" +using namespace std; + ivl_variable_type_t struct_type_t::figure_packed_base_type(void) const { if (! packed_flag) diff --git a/pform_types.h b/pform_types.h index e961369b9..e81772090 100644 --- a/pform_types.h +++ b/pform_types.h @@ -1,7 +1,7 @@ #ifndef IVL_pform_types_H #define IVL_pform_types_H /* - * Copyright (c) 2007-2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 2007-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -82,12 +82,12 @@ typedef std::pair pform_range_t; * declarations. */ struct pform_port_t { - pform_port_t(perm_string n, list*ud, PExpr*e) + pform_port_t(perm_string n, std::list*ud, PExpr*e) : name(n), udims(ud), expr(e) { } ~pform_port_t() { } perm_string name; - list*udims; + std::list*udims; PExpr*expr; }; @@ -180,14 +180,14 @@ struct enum_type_t : public data_type_t { ivl_variable_type_t base_type; bool signed_flag; bool integer_flag; // True if "integer" was used - std::unique_ptr< list > range; - std::unique_ptr< list > names; + std::unique_ptr< std::list > range; + std::unique_ptr< std::list > names; LineInfo li; }; struct struct_member_t : public LineInfo { std::unique_ptr type; - std::unique_ptr< list > names; + std::unique_ptr< std::list > names; void pform_dump(std::ostream&out, unsigned indent) const; }; @@ -198,7 +198,7 @@ struct struct_type_t : public data_type_t { bool packed_flag; bool union_flag; - std::unique_ptr< list > members; + std::unique_ptr< std::list > members; }; struct atom2_type_t : public data_type_t { @@ -244,7 +244,7 @@ struct vector_type_t : public data_type_t { bool reg_flag; // True if "reg" was used bool integer_flag; // True if "integer" was used bool implicit_flag; // True if this type is implicitly logic/reg - std::unique_ptr< list > pdims; + std::unique_ptr< std::list > pdims; }; struct array_base_t : public data_type_t { @@ -253,7 +253,7 @@ struct array_base_t : public data_type_t { : base_type(btype), dims(pd) { } data_type_t*base_type; - std::unique_ptr< list > dims; + std::unique_ptr< std::list > dims; }; /* diff --git a/symbol_search.cc b/symbol_search.cc index 013a0064c..9a7bf6be5 100644 --- a/symbol_search.cc +++ b/symbol_search.cc @@ -22,6 +22,7 @@ # include "netmisc.h" # include "ivl_assert.h" +using namespace std; /* * Search for the hierarchical name. diff --git a/syn-rules.y b/syn-rules.y index cb9bf50d4..201db1b63 100644 --- a/syn-rules.y +++ b/syn-rules.y @@ -1,7 +1,7 @@ %{ /* - * Copyright (c) 2000-2017 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -36,6 +36,8 @@ # include "functor.h" # include +using namespace std; + struct syn_token_t { int token; diff --git a/t-dll-api.cc b/t-dll-api.cc index c0a8a9006..b71c21f25 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -32,6 +32,8 @@ # include # include "ivl_alloc.h" +using namespace std; + static StringHeap api_strings; /* THE FOLLOWING ARE FUNCTIONS THAT ARE CALLED FROM THE TARGET. */ diff --git a/t-dll-expr.cc b/t-dll-expr.cc index c54a6d9aa..f46dd9c9e 100644 --- a/t-dll-expr.cc +++ b/t-dll-expr.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -30,6 +30,8 @@ # include "ivl_alloc.h" # include "ivl_assert.h" +using namespace std; + /* * This is a little convenience function for converting a NetExpr * expression type to the expression type used by ivl_expr_t objects. diff --git a/t-dll.cc b/t-dll.cc index 8e7b1e5da..977c65800 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -34,6 +34,8 @@ # include "ivl_assert.h" # include "ivl_alloc.h" +using namespace std; + struct dll_target dll_target_obj; #if defined(__WIN32__) diff --git a/t-dll.h b/t-dll.h index aa675bc66..47cc37b7b 100644 --- a/t-dll.h +++ b/t-dll.h @@ -575,7 +575,7 @@ struct ivl_udp_s { ccharp_t*table; // zero terminated array of pointers perm_string file; unsigned lineno; - string*ports; + std::string*ports; }; /* @@ -616,7 +616,7 @@ struct ivl_nexus_ptr_s { */ struct ivl_nexus_s { ivl_nexus_s() : ptrs_(1), nexus_(0), name_(0), private_data(0) { } - vectorptrs_; + std::vectorptrs_; const Nexus*nexus_; const char*name_; void*private_data; diff --git a/target.cc b/target.cc index 15cc27c5c..44493d32f 100644 --- a/target.cc +++ b/target.cc @@ -24,6 +24,8 @@ # include "target.h" # include +using namespace std; + target_t::~target_t() { } diff --git a/target.h b/target.h index be39f7ca4..e62e0d5bf 100644 --- a/target.h +++ b/target.h @@ -185,10 +185,10 @@ struct expr_scan_t { /* This function takes a fully qualified Verilog name (which may have, for example, dots in it) and produces a mangled version that can be used by most any language. */ -extern string mangle(const string&str); +extern std::string mangle(const std::string&str); /* This function takes a string and produces an escaped version that can be used inside a string constant for a C++ compiler. */ -extern string stresc(const string&str); +extern std::string stresc(const std::string&str); #endif /* IVL_target_H */ diff --git a/util.h b/util.h index d0ebc90ea..c8b712b7b 100644 --- a/util.h +++ b/util.h @@ -1,7 +1,7 @@ #ifndef IVL_util_H #define IVL_util_H /* - * Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -43,7 +43,7 @@ struct attrib_list_t { verinum val; }; -extern attrib_list_t* evaluate_attributes(const map&att, +extern attrib_list_t* evaluate_attributes(const std::map&att, unsigned&natt, Design*des, NetScope*scope); diff --git a/verinum.cc b/verinum.cc index 7b466053b..850cf7ce6 100644 --- a/verinum.cc +++ b/verinum.cc @@ -27,6 +27,8 @@ # include // Needed to get snprintf for as_string(). # include +using namespace std; + #if !defined(HAVE_LROUND) /* * If the system doesn't provide the lround function, then we provide diff --git a/verinum.h b/verinum.h index 9d087f685..d4a7f4819 100644 --- a/verinum.h +++ b/verinum.h @@ -1,7 +1,7 @@ #ifndef IVL_verinum_H #define IVL_verinum_H /* - * Copyright (c) 1998-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -25,11 +25,9 @@ #ifdef HAVE_IOSFWD # include #else -class ostream; +# include #endif -using namespace std; - /* * Numbers in Verilog are multibit strings, where each bit has 4 * possible values: 0, 1, x or z. The verinum number is store in @@ -42,7 +40,7 @@ class verinum { enum V { V0 = 0, V1, Vx, Vz }; verinum(); - explicit verinum(const string&str); + explicit verinum(const std::string&str); verinum(const V*v, unsigned nbits, bool has_len =true); explicit verinum(V, unsigned nbits =1, bool has_len =true); verinum(uint64_t val, unsigned bits); @@ -110,7 +108,7 @@ class verinum { signed long as_long() const; double as_double() const; - string as_string() const; + std::string as_string() const; private: void signed_trim(); @@ -154,8 +152,8 @@ extern verinum cast_to_width(const verinum&, unsigned width); needed to accurately represent the contained value, signed or not. */ extern verinum trim_vnum(const verinum&); -extern ostream& operator<< (ostream&, const verinum&); -extern ostream& operator<< (ostream&, verinum::V); +extern std::ostream& operator<< (std::ostream&, const verinum&); +extern std::ostream& operator<< (std::ostream&, verinum::V); inline verinum::V bit4_z2x(verinum::V bit) { return bit<2? bit : verinum::Vx; /* Relies on V0 and V1 being <2 */} diff --git a/verireal.cc b/verireal.cc index 4ef092af4..0cdc8ed32 100644 --- a/verireal.cc +++ b/verireal.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -29,6 +29,8 @@ # include # include +using namespace std; + verireal::verireal() { value_ = 0.0; diff --git a/verireal.h b/verireal.h index a7be1555f..084c0c6e6 100644 --- a/verireal.h +++ b/verireal.h @@ -1,7 +1,7 @@ #ifndef IVL_verireal_H #define IVL_verireal_H /* - * Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -23,11 +23,9 @@ #ifdef HAVE_IOSFWD # include #else -class ostream; +# include #endif -using namespace std; - class verinum; /* @@ -39,7 +37,7 @@ class verinum; class verireal { - friend ostream& operator<< (ostream&, const verireal&); + friend std::ostream& operator<< (std::ostream&, const verireal&); friend verireal operator+ (const verireal&, const verireal&); friend verireal operator- (const verireal&, const verireal&); friend verireal operator* (const verireal&, const verireal&); @@ -73,7 +71,7 @@ class verireal { double value_; }; -extern ostream& operator<< (ostream&, const verireal&); +extern std::ostream& operator<< (std::ostream&, const verireal&); extern verireal operator* (const verireal&, const verireal&); extern verireal operator/ (const verireal&, const verireal&); extern verireal operator/ (const verireal&, const verinum&); diff --git a/vhdlpp/architec.h b/vhdlpp/architec.h index 052628f0d..a5dccb71a 100644 --- a/vhdlpp/architec.h +++ b/vhdlpp/architec.h @@ -53,8 +53,8 @@ class Architecture : public Scope, public LineInfo { virtual ~Statement() =0; virtual int elaborate(Entity*ent, Architecture*arc); - virtual int emit(ostream&out, Entity*ent, Architecture*arc); - virtual void dump(ostream&out, int indent = 0) const; + virtual int emit(std::ostream&out, Entity*ent, Architecture*arc); + virtual void dump(std::ostream&out, int indent = 0) const; }; public: @@ -100,10 +100,10 @@ class Architecture : public Scope, public LineInfo { // of the specified entity. This method is used by the // elaborate code to display generated code to the specified // output. - int emit(ostream&out, Entity*entity); + int emit(std::ostream&out, Entity*entity); // The dump method writes a debug display to the given output. - void dump(ostream&out, perm_string of_entity, int indent = 0) const; + void dump(std::ostream&out, perm_string of_entity, int indent = 0) const; private: perm_string name_; @@ -143,8 +143,8 @@ class GenerateStatement : public Architecture::Statement { protected: int elaborate_statements(Entity*ent, Architecture*arc); - int emit_statements(ostream&out, Entity*ent, Architecture*arc); - void dump_statements(ostream&out, int indent) const; + int emit_statements(std::ostream&out, Entity*ent, Architecture*arc); + void dump_statements(std::ostream&out, int indent) const; private: perm_string name_; @@ -159,8 +159,8 @@ class ForGenerate : public GenerateStatement { ~ForGenerate(); int elaborate(Entity*ent, Architecture*arc); - int emit(ostream&out, Entity*entity, Architecture*arc); - void dump(ostream&out, int ident =0) const; + int emit(std::ostream&out, Entity*entity, Architecture*arc); + void dump(std::ostream&out, int ident =0) const; private: perm_string genvar_; @@ -176,7 +176,7 @@ class IfGenerate : public GenerateStatement { ~IfGenerate(); int elaborate(Entity*ent, Architecture*arc); - int emit(ostream&out, Entity*entity, Architecture*arc); + int emit(std::ostream&out, Entity*entity, Architecture*arc); private: Expression*cond_; @@ -194,8 +194,8 @@ class SignalAssignment : public Architecture::Statement { ~SignalAssignment(); virtual int elaborate(Entity*ent, Architecture*arc); - virtual int emit(ostream&out, Entity*entity, Architecture*arc); - virtual void dump(ostream&out, int ident =0) const; + virtual int emit(std::ostream&out, Entity*entity, Architecture*arc); + virtual void dump(std::ostream&out, int ident =0) const; private: ExpName*lval_; @@ -209,8 +209,8 @@ class CondSignalAssignment : public Architecture::Statement { ~CondSignalAssignment(); int elaborate(Entity*ent, Architecture*arc); - int emit(ostream&out, Entity*entity, Architecture*arc); - void dump(ostream&out, int ident =0) const; + int emit(std::ostream&out, Entity*entity, Architecture*arc); + void dump(std::ostream&out, int ident =0) const; private: ExpName*lval_; @@ -230,8 +230,8 @@ class ComponentInstantiation : public Architecture::Statement { ~ComponentInstantiation(); virtual int elaborate(Entity*ent, Architecture*arc); - virtual int emit(ostream&out, Entity*entity, Architecture*arc); - virtual void dump(ostream&out, int indent =0) const; + virtual int emit(std::ostream&out, Entity*entity, Architecture*arc); + virtual void dump(std::ostream&out, int indent =0) const; // Returns the expression that initializes a generic (or NULL if not found). Expression*find_generic_map(perm_string by_name) const; @@ -256,13 +256,13 @@ class StatementList : public Architecture::Statement { return elaborate(ent, static_cast(arc)); } - int emit(ostream&out, Entity*ent, Architecture*arc) { + int emit(std::ostream&out, Entity*ent, Architecture*arc) { return emit(out, ent, static_cast(arc)); } virtual int elaborate(Entity*ent, ScopeBase*scope); - virtual int emit(ostream&out, Entity*entity, ScopeBase*scope); - virtual void dump(ostream&out, int indent =0) const; + virtual int emit(std::ostream&out, Entity*entity, ScopeBase*scope); + virtual void dump(std::ostream&out, int indent =0) const; std::list& stmt_list() { return statements_; } @@ -277,8 +277,8 @@ class InitialStatement : public StatementList { InitialStatement(std::list*statement_list) : StatementList(statement_list) {} - int emit(ostream&out, Entity*entity, ScopeBase*scope); - void dump(ostream&out, int indent =0) const; + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); + void dump(std::ostream&out, int indent =0) const; }; // There is no direct VHDL counterpart to SV 'final' statement, @@ -288,8 +288,8 @@ class FinalStatement : public StatementList { FinalStatement(std::list*statement_list) : StatementList(statement_list) {} - int emit(ostream&out, Entity*entity, ScopeBase*scope); - void dump(ostream&out, int indent =0) const; + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); + void dump(std::ostream&out, int indent =0) const; }; class ProcessStatement : public StatementList, public Scope { @@ -302,8 +302,8 @@ class ProcessStatement : public StatementList, public Scope { ~ProcessStatement(); int elaborate(Entity*ent, Architecture*arc); - int emit(ostream&out, Entity*entity, Architecture*arc); - void dump(ostream&out, int indent =0) const; + int emit(std::ostream&out, Entity*entity, Architecture*arc); + void dump(std::ostream&out, int indent =0) const; private: perm_string iname_; diff --git a/vhdlpp/architec_elaborate.cc b/vhdlpp/architec_elaborate.cc index cb472977a..25b5b04eb 100644 --- a/vhdlpp/architec_elaborate.cc +++ b/vhdlpp/architec_elaborate.cc @@ -25,6 +25,8 @@ # include # include +using namespace std; + int Architecture::elaborate(Entity*entity) { int errors = 0; diff --git a/vhdlpp/architec_emit.cc b/vhdlpp/architec_emit.cc index 0c72d3bd3..900dfe8c0 100644 --- a/vhdlpp/architec_emit.cc +++ b/vhdlpp/architec_emit.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -28,6 +28,8 @@ # include # include +using namespace std; + int Scope::emit_signals(ostream&out, Entity*entity, ScopeBase*scope) { int errors = 0; diff --git a/vhdlpp/debug.cc b/vhdlpp/debug.cc index 717687d68..db1df1d01 100644 --- a/vhdlpp/debug.cc +++ b/vhdlpp/debug.cc @@ -32,6 +32,8 @@ # include # include +using namespace std; + static ostream& operator << (ostream&out, port_mode_t that) { switch (that) { diff --git a/vhdlpp/entity.h b/vhdlpp/entity.h index 01a5e15fb..eced5eab8 100644 --- a/vhdlpp/entity.h +++ b/vhdlpp/entity.h @@ -1,7 +1,7 @@ #ifndef IVL_entity_H #define IVL_entity_H /* - * Copyright (c) 2011-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -127,15 +127,15 @@ class Entity : public ComponentBase { // declaration to allow for that case. void set_declaration_l_value(perm_string by_name, bool flag); - int emit(ostream&out); + int emit(std::ostream&out); - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; private: std::maparch_; Architecture*bind_arch_; - map declarations_; + std::map declarations_; int elaborate_generic_exprs_(void); int elaborate_ports_(void); @@ -159,6 +159,6 @@ extern int emit_entities(void); * Use this function to dump a description of the design entities to a * file. This is for debug, not for any useful purpose. */ -extern void dump_design_entities(ostream&file); +extern void dump_design_entities(std::ostream&file); #endif /* IVL_entity_H */ diff --git a/vhdlpp/entity_emit.cc b/vhdlpp/entity_emit.cc index 62acac193..968339bd3 100644 --- a/vhdlpp/entity_emit.cc +++ b/vhdlpp/entity_emit.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -24,6 +24,8 @@ # include # include +using namespace std; + int emit_entities(void) { int errors = 0; diff --git a/vhdlpp/expression.h b/vhdlpp/expression.h index 10cfcfb31..9b084645e 100644 --- a/vhdlpp/expression.h +++ b/vhdlpp/expression.h @@ -118,7 +118,7 @@ class Expression : public LineInfo { // The emit virtual method is called by architecture emit to // output the generated code for the expression. The derived // class fills in the details of what exactly happened. - virtual int emit(ostream&out, Entity*ent, ScopeBase*scope) const =0; + virtual int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const =0; // The emit_package virtual message is similar, but is called // in a package context and to emit SV packages. @@ -143,8 +143,8 @@ class Expression : public LineInfo { virtual bool is_primary(void) const; // Debug dump of the expression. - virtual void dump(ostream&out, int indent = 0) const =0; - virtual ostream& dump_inline(ostream&out) const; + virtual void dump(std::ostream&out, int indent = 0) const =0; + virtual std::ostream& dump_inline(std::ostream&out) const; // Recursively visits a tree of expressions (useful for complex expressions). virtual void visit(ExprVisitor& func) { func.down(); func(this); func.up(); } @@ -175,7 +175,7 @@ static inline void FILE_NAME(Expression*tgt, const LineInfo*src) tgt->set_line(*src); } -static inline ostream& operator <<(ostream&out, const Expression&exp) +static inline std::ostream& operator <<(std::ostream&out, const Expression&exp) { return exp.dump_inline(out); } @@ -197,8 +197,8 @@ class ExpUnary : public Expression { inline void write_to_stream_operand1(std::ostream&fd) const { operand1_->write_to_stream(fd); } - int emit_operand1(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump_operand1(ostream&out, int indent = 0) const; + int emit_operand1(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump_operand1(std::ostream&out, int indent = 0) const; private: Expression*operand1_; @@ -223,8 +223,8 @@ class ExpBinary : public Expression { protected: int elaborate_exprs(Entity*, ScopeBase*, const VType*); - int emit_operand1(ostream&out, Entity*ent, ScopeBase*scope) const; - int emit_operand2(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit_operand1(std::ostream&out, Entity*ent, ScopeBase*scope) const; + int emit_operand2(std::ostream&out, Entity*ent, ScopeBase*scope) const; bool eval_operand1(Entity*ent, ScopeBase*scope, int64_t&val) const; bool eval_operand2(Entity*ent, ScopeBase*scope, int64_t&val) const; @@ -234,7 +234,7 @@ class ExpBinary : public Expression { inline void write_to_stream_operand2(std::ostream&out) const { operand2_->write_to_stream(out); } - void dump_operands(ostream&out, int indent = 0) const; + void dump_operands(std::ostream&out, int indent = 0) const; private: virtual const VType*resolve_operand_types_(const VType*t1, const VType*t2) const; @@ -274,7 +274,7 @@ class ExpAggregate : public Expression { ExpRange*range_expressions(void); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: std::unique_ptrexpr_; @@ -315,7 +315,7 @@ class ExpAggregate : public Expression { inline Expression* extract_expression() { return val_; } void write_to_stream(std::ostream&fd) const; - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: std::vectorfields_; @@ -333,15 +333,15 @@ class ExpAggregate : public Expression { const VType*fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*atype) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); private: int elaborate_expr_array_(Entity*ent, ScopeBase*scope, const VTypeArray*ltype); int elaborate_expr_record_(Entity*ent, ScopeBase*scope, const VTypeRecord*ltype); - int emit_array_(ostream&out, Entity*ent, ScopeBase*scope, const VTypeArray*ltype) const; - int emit_record_(ostream&out, Entity*ent, ScopeBase*scope, const VTypeRecord*ltype) const; + int emit_array_(std::ostream&out, Entity*ent, ScopeBase*scope, const VTypeArray*ltype) const; + int emit_record_(std::ostream&out, Entity*ent, ScopeBase*scope, const VTypeRecord*ltype) const; private: // This is the elements as directly parsed. @@ -367,9 +367,9 @@ class ExpArithmetic : public ExpBinary { int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; virtual bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; private: const VType* resolve_operand_types_(const VType*t1, const VType*t2) const; @@ -411,13 +411,13 @@ class ExpObjAttribute : public ExpAttribute { inline const ExpName* peek_base() const { return base_; } - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; const VType*probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; // Some attributes can be evaluated at compile time bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); private: @@ -433,14 +433,14 @@ class ExpTypeAttribute : public ExpAttribute { inline const VType* peek_base() const { return base_; } - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; const VType*probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; // Some attributes can be evaluated at compile time bool evaluate(ScopeBase*scope, int64_t&val) const; bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); private: @@ -459,8 +459,8 @@ class ExpBitstring : public Expression { const VType*fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*atype) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; private: std::vectorvalue_; @@ -479,14 +479,14 @@ class ExpCharacter : public Expression { const VType*fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*atype) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; bool is_primary(void) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; char value() const { return value_; } private: - int emit_primitive_bit_(ostream&out, Entity*ent, ScopeBase*scope, + int emit_primitive_bit_(std::ostream&out, Entity*ent, ScopeBase*scope, const VTypePrimitive*etype) const; private: @@ -507,9 +507,9 @@ class ExpConcat : public Expression { const VType*fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*atype) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; bool is_primary(void) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); private: @@ -539,9 +539,9 @@ class ExpConditional : public Expression { inline const std::list& true_clause() const { return true_clause_; } int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*lt); - int emit_option(ostream&out, Entity*ent, ScopeBase*scope) const; - int emit_default(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit_option(std::ostream&out, Entity*ent, ScopeBase*scope) const; + int emit_default(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; std::list& extract_true_clause() { return true_clause_; } void visit(ExprVisitor& func); @@ -560,8 +560,8 @@ class ExpConditional : public Expression { const VType*probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); protected: @@ -600,8 +600,8 @@ class ExpEdge : public ExpUnary { inline fun_t edge_fun() const { return fun_; } void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; private: fun_t fun_; @@ -626,8 +626,8 @@ class ExpFunc : public Expression { const VType*probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); // NOTE: does not handle expressions in subprogram body // Returns a subprogram header that matches the function call @@ -651,12 +651,12 @@ class ExpInteger : public Expression { const VType*probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; int emit_package(std::ostream&out) const; bool is_primary(void) const { return true; } bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; - void dump(ostream&out, int indent = 0) const; - virtual ostream& dump_inline(ostream&out) const; + void dump(std::ostream&out, int indent = 0) const; + virtual std::ostream& dump_inline(std::ostream&out) const; private: int64_t value_; @@ -674,11 +674,11 @@ class ExpReal : public Expression { const VType*probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; int emit_package(std::ostream&out) const; bool is_primary(void) const; - void dump(ostream&out, int indent = 0) const; - virtual ostream& dump_inline(ostream&out) const; + void dump(std::ostream&out, int indent = 0) const; + virtual std::ostream& dump_inline(std::ostream&out) const; private: double value_; @@ -701,8 +701,8 @@ class ExpLogical : public ExpBinary { int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; private: fun_t fun_; @@ -729,12 +729,12 @@ class ExpName : public Expression { const VType* fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*host) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit_indices(ostream&out, Entity*ent, ScopeBase*scope) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit_indices(std::ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; bool is_primary(void) const; bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; bool symbolic_compare(const Expression*that) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; inline const char* name() const { return name_; } inline const perm_string& peek_name() const { return name_; } void add_index(std::list*idx); @@ -751,7 +751,7 @@ class ExpName : public Expression { delete offset_; } - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; private: Expression*idx_; @@ -765,23 +765,23 @@ class ExpName : public Expression { const VType* probe_prefix_type_(Entity*ent, ScopeBase*scope) const; const VType* probe_prefixed_type_(Entity*ent, ScopeBase*scope) const; - int emit_as_prefix_(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit_as_prefix_(std::ostream&out, Entity*ent, ScopeBase*scope) const; // There are some workarounds required for constant arrays/records, as // they are currently emitted as flat localparams (without any type // information). The following workarounds adjust the access indices // to select appropriate parts of the localparam. - bool try_workarounds_(ostream&out, Entity*ent, ScopeBase*scope, - list&indices, int&data_size) const; + bool try_workarounds_(std::ostream&out, Entity*ent, ScopeBase*scope, + std::list&indices, int&data_size) const; bool check_const_array_workaround_(const VTypeArray*arr, ScopeBase*scope, - list&indices, int&data_size) const; + std::list&indices, int&data_size) const; bool check_const_record_workaround_(const VTypeRecord*rec, ScopeBase*scope, - list&indices, int&data_size) const; + std::list&indices, int&data_size) const; - int emit_workaround_(ostream&out, Entity*ent, ScopeBase*scope, - const list&indices, int field_size) const; + int emit_workaround_(std::ostream&out, Entity*ent, ScopeBase*scope, + const std::list&indices, int field_size) const; private: Expression*index(unsigned int number) const; @@ -798,7 +798,7 @@ class ExpNameALL : public ExpName { public: const VType* probe_type(Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent =0) const; + void dump(std::ostream&out, int indent =0) const; }; class ExpRelation : public ExpBinary { @@ -819,8 +819,8 @@ class ExpRelation : public ExpBinary { const VType* probe_type(Entity*ent, ScopeBase*scope) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; private: fun_t fun_; @@ -856,7 +856,7 @@ class ExpScopedName : public Expression { void write_to_stream(std::ostream&fd) const { name_->write_to_stream(fd); } - int emit(ostream&out, Entity*ent, ScopeBase*scope) const { + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const { out << scope_name_ << "."; return name_->emit(out, ent, scope); } @@ -870,7 +870,7 @@ class ExpScopedName : public Expression { bool symbolic_compare(const Expression*that) const { return name_->symbolic_compare(that); } - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor&func); @@ -897,9 +897,9 @@ class ExpShift : public ExpBinary { int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; private: shift_t shift_; @@ -917,9 +917,9 @@ class ExpString : public Expression { const VType*fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*atype) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; bool is_primary(void) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; const std::string& get_value() const { return value_; } // Converts quotation marks (") to its escaped @@ -927,7 +927,7 @@ class ExpString : public Expression { static std::string escape_quot(const std::string& str); private: - int emit_as_array_(ostream&out, Entity*ent, ScopeBase*scope, const VTypeArray*arr) const; + int emit_as_array_(std::ostream&out, Entity*ent, ScopeBase*scope, const VTypeArray*arr) const; private: std::string value_; @@ -942,8 +942,8 @@ class ExpUAbs : public ExpUnary { Expression*clone() const { return new ExpUAbs(peek_operand()->clone()); } void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; }; class ExpUNot : public ExpUnary { @@ -955,8 +955,8 @@ class ExpUNot : public ExpUnary { Expression*clone() const { return new ExpUNot(peek_operand()->clone()); } void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; }; class ExpUMinus : public ExpUnary { @@ -968,8 +968,8 @@ class ExpUMinus : public ExpUnary { Expression*clone() const { return new ExpUMinus(peek_operand()->clone()); } void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; }; /* @@ -987,8 +987,8 @@ class ExpCast : public Expression { return base_->elaborate_expr(ent, scope, type_); } void write_to_stream(std::ostream&fd) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); private: @@ -1010,8 +1010,8 @@ class ExpNew : public Expression { // There is no 'new' in VHDL - do not emit anything void write_to_stream(std::ostream&) const {}; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); private: @@ -1028,9 +1028,9 @@ class ExpTime : public Expression { int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; //bool evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const; - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; private: // Returns the time value expressed in femtoseconds @@ -1063,8 +1063,8 @@ class ExpRange : public Expression { int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; private: // Regular range related fields Expression*left_, *right_; @@ -1089,8 +1089,8 @@ public: int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); void write_to_stream(std::ostream&) const; - int emit(ostream&out, Entity*ent, ScopeBase*scope) const; - void dump(ostream&out, int indent = 0) const; + int emit(std::ostream&out, Entity*ent, ScopeBase*scope) const; + void dump(std::ostream&out, int indent = 0) const; void visit(ExprVisitor& func); const Expression*peek_expr() const { return expr_; } diff --git a/vhdlpp/expression_evaluate.cc b/vhdlpp/expression_evaluate.cc index 56b2b7eec..6dd07efd9 100644 --- a/vhdlpp/expression_evaluate.cc +++ b/vhdlpp/expression_evaluate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2015 * @author Maciej Suminski (maciej.suminski@cern.ch) * @@ -25,6 +25,8 @@ # include # include +using namespace std; + bool ExpArithmetic::evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const { int64_t val1, val2; diff --git a/vhdlpp/library.h b/vhdlpp/library.h index 5596db870..59a7e4428 100644 --- a/vhdlpp/library.h +++ b/vhdlpp/library.h @@ -1,7 +1,7 @@ #ifndef IVL_library_H #define IVL_library_H /* - * Copyright (c) 2011-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -30,7 +30,6 @@ void library_add_directory(const char*directory); int elaborate_libraries(void); int emit_packages(void); -SubprogramHeader*library_match_subprogram(perm_string name, const list*params); +SubprogramHeader*library_match_subprogram(perm_string name, const std::list*params); #endif /* IVL_library_H */ - diff --git a/vhdlpp/main.cc b/vhdlpp/main.cc index d6f3a51d4..35a708543 100644 --- a/vhdlpp/main.cc +++ b/vhdlpp/main.cc @@ -22,6 +22,8 @@ const char COPYRIGHT[] = # include "version_base.h" # include "version_tag.h" +using namespace std; + /* * Usage: vhdlpp [flags] sourcefile... * Flags: diff --git a/vhdlpp/package.cc b/vhdlpp/package.cc index c8ff5b466..5e92a4b59 100644 --- a/vhdlpp/package.cc +++ b/vhdlpp/package.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -27,6 +27,8 @@ # include # include +using namespace std; + Package::Package(perm_string n, const ActiveScope&ref) : Scope(ref), name_(n) { diff --git a/vhdlpp/parse.y b/vhdlpp/parse.y index ece7a0b70..535a57890 100644 --- a/vhdlpp/parse.y +++ b/vhdlpp/parse.y @@ -6,7 +6,7 @@ %parse-param {perm_string parse_library_name} %{ /* - * Copyright (c) 2011-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2012-2016 / Stephen Williams (steve@icarus.com), * @author Maciej Suminski (maciej.suminski@cern.ch) * @@ -51,6 +51,8 @@ # include # include +using namespace std; + inline void FILE_NAME(LineInfo*tmp, const struct yyltype&where) { tmp->set_lineno(where.first_line); diff --git a/vhdlpp/parse_types.h b/vhdlpp/parse_types.h index 711d45a0b..bdef7a5c3 100644 --- a/vhdlpp/parse_types.h +++ b/vhdlpp/parse_types.h @@ -31,7 +31,7 @@ class named_expr_t { perm_string name() const { return name_; } Expression* expr() const { return expr_; } - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: perm_string name_; Expression* expr_; diff --git a/vhdlpp/scope.h b/vhdlpp/scope.h index f92a74403..43752e9f0 100644 --- a/vhdlpp/scope.h +++ b/vhdlpp/scope.h @@ -1,7 +1,7 @@ #ifndef IVL_scope_H #define IVL_scope_H /* - * Copyright (c) 2011-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -36,7 +36,7 @@ class SubprogramHeader; class VType; class SequentialStmt; -typedef list SubHeaderList; +typedef std::list SubHeaderList; template struct delete_object{ @@ -45,7 +45,7 @@ struct delete_object{ template struct delete_pair_second{ - void operator()(pair item){ delete item.second; } + void operator()(std::pair item){ delete item.second; } }; class ScopeBase { @@ -75,7 +75,7 @@ class ScopeBase { void transfer_from(ScopeBase&ref, transfer_type_t what = ALL); inline void bind_subprogram(perm_string name, SubprogramHeader*obj) - { map::iterator it; + { std::map::iterator it; if((it = use_subprograms_.find(name)) != use_subprograms_.end() ) it->second.remove(obj); cur_subprograms_[name].push_back(obj); @@ -95,11 +95,11 @@ class ScopeBase { finalizers_.push_back(s); } - void dump_scope(ostream&out) const; + void dump_scope(std::ostream&out) const; // Looks for a subprogram with specified name and parameter types. SubprogramHeader*match_subprogram(perm_string name, - const list*params) const; + const std::list*params) const; perm_string peek_name() const { return name_; } @@ -112,11 +112,11 @@ class ScopeBase { void cleanup(); //containers' cleaning helper functions - template void delete_all(list& c) + template void delete_all(std::list& c) { for_each(c.begin(), c.end(), ::delete_object()); } - template void delete_all(map& c) + template void delete_all(std::map& c) { for_each(c.begin(), c.end(), ::delete_pair_second()); } @@ -186,8 +186,8 @@ class Scope : public ScopeBase { protected: // Helper method for emitting signals in the scope. - int emit_signals(ostream&out, Entity*ent, ScopeBase*scope); - int emit_variables(ostream&out, Entity*ent, ScopeBase*scope); + int emit_signals(std::ostream&out, Entity*ent, ScopeBase*scope); + int emit_variables(std::ostream&out, Entity*ent, ScopeBase*scope); }; /* @@ -226,28 +226,28 @@ class ActiveScope : public ScopeBase { * done in ScopeBase::cleanup() function .*/ void bind_name(perm_string name, Signal*obj) - { map::iterator it; + { std::map::iterator it; if((it = old_signals_.find(name)) != old_signals_.end() ) old_signals_.erase(it); new_signals_[name] = obj; } void bind_name(perm_string name, Variable*obj) - { map::iterator it; + { std::map::iterator it; if((it = old_variables_.find(name)) != old_variables_.end() ) old_variables_.erase(it); new_variables_[name] = obj; } void bind_name(perm_string name, ComponentBase*obj) - { map::iterator it; + { std::map::iterator it; if((it = old_components_.find(name)) != old_components_.end() ) old_components_.erase(it); new_components_[name] = obj; } void bind_name(perm_string name, const VType* t) - { map::iterator it; + { std::map::iterator it; if((it = use_types_.find(name)) != use_types_.end() ) use_types_.erase(it); cur_types_[name] = t; @@ -266,7 +266,7 @@ class ActiveScope : public ScopeBase { { use_types_[name] = t; } void bind_name(perm_string name, const VType*obj, Expression*val) - { map::iterator it; + { std::map::iterator it; if((it = use_constants_.find(name)) != use_constants_.end() ) use_constants_.erase(it); cur_constants_[name] = new const_t(obj, val); diff --git a/vhdlpp/sequential.cc b/vhdlpp/sequential.cc index 9f83c1372..82ce7d1a7 100644 --- a/vhdlpp/sequential.cc +++ b/vhdlpp/sequential.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -21,6 +21,8 @@ # include "expression.h" # include +using namespace std; + template inline static void visit_stmt_list(std::list& stmts, SeqStmtVisitor& func) { diff --git a/vhdlpp/sequential.h b/vhdlpp/sequential.h index b0fa8ac07..f809e6f0a 100644 --- a/vhdlpp/sequential.h +++ b/vhdlpp/sequential.h @@ -1,7 +1,7 @@ #ifndef IVL_sequential_H #define IVL_sequential_H /* - * Copyright (c) 2011-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -42,8 +42,8 @@ class SequentialStmt : public LineInfo { public: virtual int elaborate(Entity*ent, ScopeBase*scope); - virtual int emit(ostream&out, Entity*entity, ScopeBase*scope); - virtual void dump(ostream&out, int indent) const; + virtual int emit(std::ostream&out, Entity*entity, ScopeBase*scope); + virtual void dump(std::ostream&out, int indent) const; virtual void write_to_stream(std::ostream&fd); // Recursively visits a tree of sequential statements. @@ -56,18 +56,18 @@ class SequentialStmt : public LineInfo { */ class LoopStatement : public SequentialStmt { public: - LoopStatement(perm_string block_name, list*); + LoopStatement(perm_string block_name, std::list*); virtual ~LoopStatement(); inline perm_string loop_name() const { return name_; } - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; void visit(SeqStmtVisitor& func); protected: int elaborate_substatements(Entity*ent, ScopeBase*scope); int emit_substatements(std::ostream&out, Entity*ent, ScopeBase*scope); - void write_to_stream_substatements(ostream&fd); + void write_to_stream_substatements(std::ostream&fd); private: perm_string name_; @@ -83,13 +83,13 @@ class IfSequential : public SequentialStmt { ~Elsif(); int elaborate(Entity*entity, ScopeBase*scope); - int condition_emit(ostream&out, Entity*entity, ScopeBase*scope); - int statement_emit(ostream&out, Entity*entity, ScopeBase*scope); + int condition_emit(std::ostream&out, Entity*entity, ScopeBase*scope); + int statement_emit(std::ostream&out, Entity*entity, ScopeBase*scope); - void condition_write_to_stream(ostream&fd); - void statement_write_to_stream(ostream&fd); + void condition_write_to_stream(std::ostream&fd); + void statement_write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; void visit(SeqStmtVisitor& func); private: @@ -108,9 +108,9 @@ class IfSequential : public SequentialStmt { public: int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; void visit(SeqStmtVisitor& func); const Expression*peek_condition() const { return cond_; } @@ -136,9 +136,9 @@ class ReturnStmt : public SequentialStmt { public: int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; const Expression*peek_expr() const { return val_; }; void cast_to(const VType*type); @@ -154,9 +154,9 @@ class SignalSeqAssignment : public SequentialStmt { public: int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: Expression*lval_; @@ -172,7 +172,7 @@ class CaseSeqStmt : public SequentialStmt { void dump(std::ostream& out, int indent) const; int elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype); int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); void visit(SeqStmtVisitor& func); @@ -189,9 +189,9 @@ class CaseSeqStmt : public SequentialStmt { ~CaseSeqStmt(); public: - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); void visit(SeqStmtVisitor& func); @@ -208,8 +208,8 @@ class ProcedureCall : public SequentialStmt { ~ProcedureCall(); int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); - void dump(ostream&out, int indent) const; + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); + void dump(std::ostream&out, int indent) const; private: perm_string name_; @@ -224,9 +224,9 @@ class VariableSeqAssignment : public SequentialStmt { public: int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: Expression*lval_; @@ -236,13 +236,13 @@ class VariableSeqAssignment : public SequentialStmt { class WhileLoopStatement : public LoopStatement { public: WhileLoopStatement(perm_string loop_name, - Expression*, list*); + Expression*, std::list*); ~WhileLoopStatement(); int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*ent, ScopeBase*scope); + int emit(std::ostream&out, Entity*ent, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: Expression* cond_; @@ -251,18 +251,18 @@ class WhileLoopStatement : public LoopStatement { class ForLoopStatement : public LoopStatement { public: ForLoopStatement(perm_string loop_name, - perm_string index, ExpRange*, list*); + perm_string index, ExpRange*, std::list*); ~ForLoopStatement(); int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*ent, ScopeBase*scope); + int emit(std::ostream&out, Entity*ent, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; private: // Emits for-loop which direction is determined at run-time. // It is used for 'range & 'reverse_range attributes. - int emit_runtime_(ostream&out, Entity*ent, ScopeBase*scope); + int emit_runtime_(std::ostream&out, Entity*ent, ScopeBase*scope); perm_string it_; ExpRange* range_; @@ -270,13 +270,13 @@ class ForLoopStatement : public LoopStatement { class BasicLoopStatement : public LoopStatement { public: - BasicLoopStatement(perm_string lname, list*); + BasicLoopStatement(perm_string lname, std::list*); ~BasicLoopStatement(); int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*ent, ScopeBase*scope); + int emit(std::ostream&out, Entity*ent, ScopeBase*scope); void write_to_stream(std::ostream&fd); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; }; class ReportStmt : public SequentialStmt { @@ -286,16 +286,16 @@ class ReportStmt : public SequentialStmt { ReportStmt(Expression*message, severity_t severity); virtual ~ReportStmt() {} - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); inline Expression*message() const { return msg_; } inline severity_t severity() const { return severity_; } protected: - void dump_sev_msg(ostream&out, int indent) const; + void dump_sev_msg(std::ostream&out, int indent) const; Expression*msg_; severity_t severity_; @@ -306,9 +306,9 @@ class AssertStmt : public ReportStmt { AssertStmt(Expression*condition, Expression*message, ReportStmt::severity_t severity = ReportStmt::ERROR); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); private: @@ -322,9 +322,9 @@ class WaitForStmt : public SequentialStmt { public: explicit WaitForStmt(Expression*delay); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); private: @@ -336,9 +336,9 @@ class WaitStmt : public SequentialStmt { typedef enum { ON, UNTIL, FINAL } wait_type_t; WaitStmt(wait_type_t typ, Expression*expression); - void dump(ostream&out, int indent) const; + void dump(std::ostream&out, int indent) const; int elaborate(Entity*ent, ScopeBase*scope); - int emit(ostream&out, Entity*entity, ScopeBase*scope); + int emit(std::ostream&out, Entity*entity, ScopeBase*scope); void write_to_stream(std::ostream&fd); inline wait_type_t type() const { return type_; } diff --git a/vhdlpp/sequential_elaborate.cc b/vhdlpp/sequential_elaborate.cc index 84a48f55b..d6f42efdf 100644 --- a/vhdlpp/sequential_elaborate.cc +++ b/vhdlpp/sequential_elaborate.cc @@ -24,6 +24,8 @@ # include "subprogram.h" # include "std_types.h" +using namespace std; + int SequentialStmt::elaborate(Entity*, ScopeBase*) { return 0; diff --git a/vhdlpp/sequential_emit.cc b/vhdlpp/sequential_emit.cc index 25dc6f60d..a951b6f77 100644 --- a/vhdlpp/sequential_emit.cc +++ b/vhdlpp/sequential_emit.cc @@ -33,6 +33,8 @@ # include # include +using namespace std; + int SequentialStmt::emit(ostream&out, Entity*, ScopeBase*) { out << " // " << get_fileline() << ": internal error: " diff --git a/vhdlpp/std_funcs.cc b/vhdlpp/std_funcs.cc index 2880bba98..f6986989e 100644 --- a/vhdlpp/std_funcs.cc +++ b/vhdlpp/std_funcs.cc @@ -1,5 +1,5 @@ /* - * Copyright CERN 2016-2018 + * Copyright CERN 2016-2021 * @author Maciej Suminski (maciej.suminski@cern.ch) * * This source code is free software; you can redistribute it @@ -22,6 +22,8 @@ #include "std_types.h" #include "scope.h" +using namespace std; + static std::map std_subprograms; void register_std_subprogram(SubprogramHeader*header) diff --git a/vhdlpp/std_types.cc b/vhdlpp/std_types.cc index 51f6eaa2d..dfa38a73c 100644 --- a/vhdlpp/std_types.cc +++ b/vhdlpp/std_types.cc @@ -21,6 +21,8 @@ #include "std_types.h" #include "scope.h" +using namespace std; + static map std_types; // this list contains enums used by typedefs in the std_types map static list std_enums; @@ -141,4 +143,3 @@ bool is_global_type(perm_string name) return std_types.count(name) > 0; } - diff --git a/vhdlpp/std_types.h b/vhdlpp/std_types.h index 8a91890a3..1e3147ac5 100644 --- a/vhdlpp/std_types.h +++ b/vhdlpp/std_types.h @@ -1,5 +1,5 @@ /* - * Copyright CERN 2015 + * Copyright CERN 2015-2021 * @author Maciej Suminski (maciej.suminski@cern.ch) * * This source code is free software; you can redistribute it @@ -22,7 +22,7 @@ class ActiveScope; -void emit_std_types(ostream&out); +void emit_std_types(std::ostream&out); void generate_global_types(ActiveScope*res); bool is_global_type(perm_string type_name); void delete_global_types(); diff --git a/vhdlpp/subprogram.h b/vhdlpp/subprogram.h index a03b8da92..a032871d5 100644 --- a/vhdlpp/subprogram.h +++ b/vhdlpp/subprogram.h @@ -1,7 +1,7 @@ #ifndef IVL_subprogram_H #define IVL_subprogram_H /* - * Copyright (c) 2013-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2013-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * Copyright CERN 2015 * @author Maciej Suminski (maciej.suminski@cern.ch) @@ -46,7 +46,7 @@ class SubprogramBody : public LineInfo, public ScopeBase { inline bool empty_statements() const { return !statements_ || statements_->empty(); } int elaborate(); - int emit(ostream&out, Entity*ent, ScopeBase*scope); + int emit(std::ostream&out, Entity*ent, ScopeBase*scope); // Emit body as it would show up in a package. int emit_package(std::ostream&fd); diff --git a/vhdlpp/vhdlpp_config.h.in b/vhdlpp/vhdlpp_config.h.in index a736dc7d9..ced507de0 100644 --- a/vhdlpp/vhdlpp_config.h.in +++ b/vhdlpp/vhdlpp_config.h.in @@ -19,14 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if defined(__cplusplus) -# if !defined(__GNUC__) - using namespace std; -# elif (__GNUC__ == 3) - using namespace std; -# endif -#endif - # undef HAVE_GETOPT_H # undef HAVE_INTTYPES_H # undef HAVE_LIBIBERTY_H diff --git a/vhdlpp/vsignal.h b/vhdlpp/vsignal.h index 27de1d778..850e7dd42 100644 --- a/vhdlpp/vsignal.h +++ b/vhdlpp/vsignal.h @@ -1,7 +1,7 @@ #ifndef IVL_vsignal_H #define IVL_vsignal_H /* - * Copyright (c) 2011-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2011-2021 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -40,7 +40,7 @@ class SigVarBase : public LineInfo { // l-value of a sequential assignment. void count_ref_sequ(); - void dump(ostream&out, int indent = 0) const; + void dump(std::ostream&out, int indent = 0) const; // Elaborates type & initializer expressions. void elaborate(Entity*ent, ScopeBase*scope); @@ -70,7 +70,7 @@ class Signal : public SigVarBase { public: Signal(perm_string name, const VType*type, Expression*init_expr); - int emit(ostream&out, Entity*ent, ScopeBase*scope, bool initalize = true); + int emit(std::ostream&out, Entity*ent, ScopeBase*scope, bool initalize = true); }; class Variable : public SigVarBase { @@ -78,7 +78,7 @@ class Variable : public SigVarBase { public: Variable(perm_string name, const VType*type, Expression*init_expr = NULL); - int emit(ostream&out, Entity*ent, ScopeBase*scope, bool initialize = true); + int emit(std::ostream&out, Entity*ent, ScopeBase*scope, bool initialize = true); void write_to_stream(std::ostream&fd); }; diff --git a/vhdlpp/vtype_elaborate.cc b/vhdlpp/vtype_elaborate.cc index e32d4d28e..5a38cf027 100644 --- a/vhdlpp/vtype_elaborate.cc +++ b/vhdlpp/vtype_elaborate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2013-2021 Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -21,6 +21,8 @@ # include "vtype.h" # include "expression.h" +using namespace std; + int VType::elaborate(Entity*, ScopeBase*) const { return 0; diff --git a/vpi_modules.cc b/vpi_modules.cc index ea0ccde2f..5d0b8c3aa 100644 --- a/vpi_modules.cc +++ b/vpi_modules.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Martin Whitaker (icarus@martin-whitaker.me.uk) + * Copyright (c) 2019-2021 Martin Whitaker (icarus@martin-whitaker.me.uk) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -23,6 +23,8 @@ #include "sv_vpi_user.h" #include "vvp/ivl_dlfcn.h" +using namespace std; + /* The only VPI routines that can be legally called when the functions in the vlog_startup_routines[] array are executed are vpi_register_systf() and vpi_register_cb(), so we can simply provide stubs for the rest. We