From d7b85c42a0ec4305af01e24b76815e14f5776198 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Wed, 13 Aug 2008 11:57:05 +0100 Subject: [PATCH] Split sequential and combinatorial UDPs into separate functions --- tgt-vhdl/logic.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tgt-vhdl/logic.cc b/tgt-vhdl/logic.cc index ca77c45d2..a5bc92fb5 100644 --- a/tgt-vhdl/logic.cc +++ b/tgt-vhdl/logic.cc @@ -95,15 +95,10 @@ static void bufif_logic(vhdl_arch *arch, ivl_net_logic_t log, bool if0) arch->add_stmt(cass); } -static void udp_logic(vhdl_arch *arch, ivl_net_logic_t log) +static void comb_udp_logic(vhdl_arch *arch, ivl_net_logic_t log) { ivl_udp_t udp = ivl_logic_udp(log); - - if (ivl_udp_sequ(udp)) { - error("Sequential UDP devices not supported yet"); - return; - } - + // As with regular case statements, the expression in a // `with .. select' statement must be "locally static". // This is achieved by first combining the inputs into @@ -164,6 +159,19 @@ static void udp_logic(vhdl_arch *arch, ivl_net_logic_t log) arch->add_stmt(ws); } +static void seq_udp_logic(vhdl_arch *arch, ivl_net_logic_t log) +{ + error("Sequential UDP devices not supported yet"); +} + +static void udp_logic(vhdl_arch *arch, ivl_net_logic_t log) +{ + if (ivl_udp_sequ(ivl_logic_udp(log))) + seq_udp_logic(arch, log); + else + comb_udp_logic(arch, log); +} + static vhdl_expr *translate_logic_inputs(vhdl_scope *scope, ivl_net_logic_t log) { switch (ivl_logic_type(log)) {