Add concurrent assignments
This commit is contained in:
parent
b96e471fa2
commit
d08f5af9c6
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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 << ";";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,6 +136,20 @@ private:
|
|||
|
||||
typedef std::list<vhdl_conc_stmt*> 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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue