Control Internal Terminals

NSL uses control internal terminals for sending message to a object. Control internal terminals are declared with 'func_self'. We can refer the value of the terminal as input or output terminals. To activate a control insternal terminal, use a syntax 'control()' just like a function call of C language. Also control internal terminals can have arguments. A control internal terminal is a control signal of an object and the arguments are the associated data for the object which are required for the control operation. Arguments are declared as:

func_self control_terminal_name ( argument1, argument2, ... ) ;

Even if there is no argument at all, you cannot eliminate the parensis. We also declare associated behavior to the control terminal with func syntax.

func control_terminal_name behavior_description

Example-NS09

declare NS09 { input a,b; output f; } module NS09 { wire c; func_self do(c); any { a & ~b: do(a); ~a & b: do(b); } func do { f = c; } }



We will make a simulation on this circuitry as following command:

# ./exe NS09



The result will be available on your console.



a:0, b:0, do:0, c:x, f:x a:1, b:0, do:1, c:1, f:1 a:0, b:1, do:1, c:1, f:1 a:1, b:1, do:0, c:x, f:x



PREV UP NEXT