Add (temporary) error for ICT_SCOPE_GENERATE

Generate scopes were previously ignored, and this would cause a segfault
later on. This patch gives an error whenever it encounters a generate
scope. This should be removed once generate statements are implemented.
This commit is contained in:
Nick Gasson 2008-09-06 10:56:52 +01:00
parent 8717a85f7f
commit a34348bb35
2 changed files with 18 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);