diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 44c47bc1f..bc4492231 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -31,7 +31,23 @@ */ static void declare_logic(vhdl_arch *arch, ivl_scope_t scope) { - + int nlogs = ivl_scope_logs(scope); + for (int i = 0; i < nlogs; i++) { + ivl_net_logic_t log = ivl_scope_log(scope, i); + + switch (ivl_logic_type(log)) { + case IVL_LO_NOT: + break; + case IVL_LO_AND: + break; + case IVL_LO_OR: + break; + default: + error("Don't know how to translate logic type = %d", + ivl_logic_type(log)); + break; + } + } } /* diff --git a/tgt-vhdl/vhdl_syntax.cc b/tgt-vhdl/vhdl_syntax.cc index 99ec94d5b..9a9717156 100644 --- a/tgt-vhdl/vhdl_syntax.cc +++ b/tgt-vhdl/vhdl_syntax.cc @@ -442,3 +442,16 @@ void vhdl_const_int::emit(std::ofstream &of, int level) const of << value_; } +vhdl_cassign_stmt::~vhdl_cassign_stmt() +{ + delete lhs_; + delete rhs_; +} + +void vhdl_cassign_stmt::emit(std::ofstream &of, int level) const +{ + lhs_->emit(of, level); + of << " <= "; + rhs_->emit(of, level); + of << ";"; +} diff --git a/tgt-vhdl/vhdl_syntax.hh b/tgt-vhdl/vhdl_syntax.hh index a027221d3..600bea11c 100644 --- a/tgt-vhdl/vhdl_syntax.hh +++ b/tgt-vhdl/vhdl_syntax.hh @@ -136,6 +136,20 @@ private: typedef std::list conc_stmt_list_t; +/* + * A concurrent signal assignment (i.e. not part of a process). + */ +class vhdl_cassign_stmt : public vhdl_conc_stmt { +public: + vhdl_cassign_stmt(vhdl_var_ref *lhs, vhdl_expr *rhs) + : lhs_(lhs), rhs_(rhs) {} + ~vhdl_cassign_stmt(); + + void emit(std::ofstream &of, int level) const; +private: + vhdl_var_ref *lhs_; + vhdl_expr *rhs_; +}; /* * Any sequential statement in a process.