From 7865264de0eef3261dd88da375e856f38665b19b Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 18 Aug 2008 15:34:58 +0100 Subject: [PATCH] Implement IVL_LPM_REPEAT --- tgt-vhdl/lpm.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tgt-vhdl/lpm.cc b/tgt-vhdl/lpm.cc index 7dc25ddf5..3c2af5ead 100644 --- a/tgt-vhdl/lpm.cc +++ b/tgt-vhdl/lpm.cc @@ -218,6 +218,12 @@ static vhdl_expr *shift_lpm_to_expr(vhdl_scope *scope, ivl_lpm_t lpm, return new vhdl_binop_expr(lhs, shift_op, r_cast, rtype); } +static vhdl_expr *repeat_lpm_to_expr(vhdl_scope *scope, ivl_lpm_t lpm) +{ + vhdl_expr *in = nexus_to_var_ref(scope, ivl_lpm_data(lpm, 0)); + return new vhdl_bit_spec_expr(NULL, in); +} + static vhdl_expr *lpm_to_expr(vhdl_scope *scope, ivl_lpm_t lpm) { switch (ivl_lpm_type(lpm)) { @@ -264,6 +270,8 @@ static vhdl_expr *lpm_to_expr(vhdl_scope *scope, ivl_lpm_t lpm) return shift_lpm_to_expr(scope, lpm, VHDL_BINOP_SL); case IVL_LPM_SHIFTR: return shift_lpm_to_expr(scope, lpm, VHDL_BINOP_SR); + case IVL_LPM_REPEAT: + return repeat_lpm_to_expr(scope, lpm); default: error("Unsupported LPM type: %d", ivl_lpm_type(lpm)); return NULL;