diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 5768f3b7b..60e7d6dfd 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -625,8 +625,20 @@ static void create_skeleton_entity_for(ivl_scope_t scope) */ static int draw_skeleton_scope(ivl_scope_t scope, void *_parent) { - if (ivl_scope_type(scope) == IVL_SCT_MODULE) + switch (ivl_scope_type(scope)) { + case IVL_SCT_MODULE: create_skeleton_entity_for(scope); + break; + case IVL_SCT_GENERATE: + error("No translation for generate statements yet"); + return 1; + case IVL_SCT_FORK: + error("No translation for fork statements yet"); + return 1; + default: + // The other scope types are expanded later on + break; + } return ivl_scope_children(scope, draw_skeleton_scope, scope); } diff --git a/tgt-vhdl/vhdl.cc b/tgt-vhdl/vhdl.cc index a82f583d3..875e38ebf 100644 --- a/tgt-vhdl/vhdl.cc +++ b/tgt-vhdl/vhdl.cc @@ -159,10 +159,13 @@ extern "C" int target_design(ivl_design_t des) for (unsigned int i = 0; i < nroots; i++) draw_scope(roots[i], NULL); - ivl_design_process(des, draw_process, NULL); + // Only generate processes if there were no errors generating entities + // (otherwise the necessary information won't be present) + if (0 == g_errors) + ivl_design_process(des, draw_process, NULL); // Write the generated elements to the output file - // only if there are no errors + // only if there were no errors generating entities or processes if (0 == g_errors) { const char *ofname = ivl_design_flag(des, "-o"); ofstream outfile(ofname);