Merge branch 'vhdl'
This commit is contained in:
commit
d06092d7d7
|
|
@ -446,22 +446,25 @@ static vhdl_expr *translate_binary(ivl_expr_t e)
|
|||
|
||||
static vhdl_expr *translate_select(ivl_expr_t e)
|
||||
{
|
||||
vhdl_var_ref *from =
|
||||
dynamic_cast<vhdl_var_ref*>(translate_expr(ivl_expr_oper1(e)));
|
||||
if (NULL == from) {
|
||||
error("Can only select from variable reference");
|
||||
vhdl_expr *from = translate_expr(ivl_expr_oper1(e));
|
||||
if (NULL == from)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ivl_expr_t o2 = ivl_expr_oper2(e);
|
||||
if (o2) {
|
||||
vhdl_var_ref *from_var_ref = dynamic_cast<vhdl_var_ref*>(from);
|
||||
if (NULL == from_var_ref) {
|
||||
error("Can only select from variable reference");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
vhdl_expr *base = translate_expr(ivl_expr_oper2(e));
|
||||
if (NULL == base)
|
||||
return NULL;
|
||||
|
||||
vhdl_type integer(VHDL_TYPE_INTEGER);
|
||||
from->set_slice(base->cast(&integer), ivl_expr_width(e) - 1);
|
||||
return from;
|
||||
from_var_ref->set_slice(base->cast(&integer), ivl_expr_width(e) - 1);
|
||||
return from_var_ref;
|
||||
}
|
||||
else
|
||||
return from->resize(ivl_expr_width(e));
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ static string make_safe_name(ivl_signal_t sig)
|
|||
const char *base = ivl_signal_basename(sig);
|
||||
if (base[0] == '_')
|
||||
return string("VL") + base;
|
||||
|
||||
|
||||
const char *vhdl_reserved[] = {
|
||||
"in", "out", "entity", "architecture", "inout", "array",
|
||||
"is", "not", "and", "or", "bus", "bit", "line", // Etc...
|
||||
|
|
|
|||
Loading…
Reference in New Issue