Extern function/task definition in generate-block scope within scope of class definition

In reply to nachumk:

Please use code tags making your code easier to read. I have added them for you.

“same scope” means the scope with the same name. The generate block creates an unnamed sub scope, so this is not legal.

Without knowing exactly why you want to do this (see the XY problem), it’s hard to suggest a better alternative.

You might want to look at this paper which was awarded the Best Paper at the Design and Verification Conference (DVCon) 2016.