From db992e808f24013eb64d9b7293aa6d72bd2ca1c7 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 24 Jun 2008 19:54:22 +0100 Subject: [PATCH] Start using vhdl_procedural instead of vhdl_process --- tgt-vhdl/display.cc | 2 +- tgt-vhdl/process.cc | 4 ++-- tgt-vhdl/vhdl_syntax.hh | 4 ++-- tgt-vhdl/vhdl_target.h | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tgt-vhdl/display.cc b/tgt-vhdl/display.cc index 1b40c8c82..24e30c66e 100644 --- a/tgt-vhdl/display.cc +++ b/tgt-vhdl/display.cc @@ -112,7 +112,7 @@ static void flush_string(std::ostringstream &ss, stmt_container *container) * name collision with an existing variable called * `Verilog_Display_Line' -- do something about this? */ -int draw_stask_display(vhdl_process *proc, stmt_container *container, +int draw_stask_display(vhdl_procedural *proc, stmt_container *container, ivl_statement_t stmt, bool newline) { if (!proc->get_scope()->have_declared(DISPLAY_LINE)) { diff --git a/tgt-vhdl/process.cc b/tgt-vhdl/process.cc index 5783e71b2..5833cb5b3 100644 --- a/tgt-vhdl/process.cc +++ b/tgt-vhdl/process.cc @@ -77,7 +77,7 @@ static var_temp_set_t g_assign_vars; /* * Called whenever a blocking assignment is made to sig. */ -void blocking_assign_to(vhdl_process *proc, ivl_signal_t sig) +void blocking_assign_to(vhdl_procedural *proc, ivl_signal_t sig) { std::string var(get_renamed_signal(sig)); std::string tmpname(var + "_Var"); @@ -104,7 +104,7 @@ void blocking_assign_to(vhdl_process *proc, ivl_signal_t sig) * the new values visible outside the current process. This should be * called before any `wait' statement or the end of the process. */ -void draw_blocking_assigns(vhdl_process *proc, stmt_container *container) +void draw_blocking_assigns(vhdl_procedural *proc, stmt_container *container) { var_temp_set_t::const_iterator it; for (it = g_assign_vars.begin(); it != g_assign_vars.end(); ++it) { diff --git a/tgt-vhdl/vhdl_syntax.hh b/tgt-vhdl/vhdl_syntax.hh index 7bac65751..35ccf64cb 100644 --- a/tgt-vhdl/vhdl_syntax.hh +++ b/tgt-vhdl/vhdl_syntax.hh @@ -545,8 +545,10 @@ private: class vhdl_procedural { public: stmt_container *get_container() { return &stmts_; } + vhdl_scope *get_scope() { return &scope_; } protected: stmt_container stmts_; + vhdl_scope scope_; }; class vhdl_process : public vhdl_conc_stmt, public vhdl_procedural { @@ -555,9 +557,7 @@ public: void emit(std::ofstream &of, int level) const; void add_sensitivity(const char *name); - vhdl_scope *get_scope() { return &scope_; } private: - vhdl_scope scope_; std::string name_; string_list_t sens_; }; diff --git a/tgt-vhdl/vhdl_target.h b/tgt-vhdl/vhdl_target.h index fbabc5e30..710152bea 100644 --- a/tgt-vhdl/vhdl_target.h +++ b/tgt-vhdl/vhdl_target.h @@ -32,11 +32,11 @@ void rename_signal(ivl_signal_t sig, const std::string &renamed); const vhdl_entity *find_entity_for_signal(ivl_signal_t sig); const std::string &get_renamed_signal(ivl_signal_t sig); -void blocking_assign_to(vhdl_process *proc, ivl_signal_t sig); +void blocking_assign_to(vhdl_procedural *proc, ivl_signal_t sig); std::string strip_var(const std::string &str); -void draw_blocking_assigns(vhdl_process *proc, stmt_container *container); +void draw_blocking_assigns(vhdl_procedural *proc, stmt_container *container); -int draw_stask_display(vhdl_process *proc, stmt_container *container, +int draw_stask_display(vhdl_procedural *proc, stmt_container *container, ivl_statement_t stmt, bool newline = true); #endif /* #ifndef INC_VHDL_TARGET_H */