diff --git a/vvp/compile.cc b/vvp/compile.cc index 0714fe5eb..c0792191d 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2017 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2018 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -495,8 +495,8 @@ bool vvp_net_resolv_list_s::resolve(bool mes) // the compiler output instead of implicitly in this code. assert(! vpip_peek_current_scope()->is_automatic()); t0_trigger_generated = true; - // Create an event with no name for the T0 trigger - compile_named_event(strdup(label()), strcpy(new char [1],"")); + // Create a local event with no name for the T0 trigger + compile_named_event(strdup(label()), strcpy(new char [1],""), true); tmp = vvp_net_lookup(label()); assert(tmp); tmp->link(port); diff --git a/vvp/compile.h b/vvp/compile.h index b49a6dea4..6ef0b122d 100644 --- a/vvp/compile.h +++ b/vvp/compile.h @@ -1,7 +1,7 @@ #ifndef IVL_compile_H #define IVL_compile_H /* - * Copyright (c) 2001-2017 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2018 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -418,7 +418,7 @@ extern void compile_ufunc_vec4(char*label, char*code, unsigned wid, */ extern void compile_event(char*label, char*type, unsigned argc, struct symb_s*argv); -extern void compile_named_event(char*label, char*type); +extern void compile_named_event(char*label, char*type, bool local_flag=false); /* diff --git a/vvp/event.cc b/vvp/event.cc index 64504d9cc..6c6c7fe00 100644 --- a/vvp/event.cc +++ b/vvp/event.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2004-2018 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -829,7 +829,7 @@ static void compile_event_or(char*label, unsigned argc, struct symb_s*argv) * inputs, it is only accessed by behavioral trigger statements, which * in vvp are %set instructions. */ -void compile_named_event(char*label, char*name) +void compile_named_event(char*label, char*name, bool local_flag) { vvp_net_t*ptr = new vvp_net_t; @@ -842,7 +842,7 @@ void compile_named_event(char*label, char*name) } define_functor_symbol(label, ptr); compile_vpi_symbol(label, obj); - vpip_attach_to_current_scope(obj); + if (! local_flag) vpip_attach_to_current_scope(obj); free(label); delete[] name;