ADDER4_func_call.nsl


/* ************************************************************ */
declare adder4 {

    input       A_in[4] ;           // Add value input. Port-A
    input       B_in[4] ;           // Add value input. Port-B
    output      Q_out[4] ;          // Add result out

    func_in exec( A_in, B_in ) ;    // Add function execution request with parameter.
    func_out    done( Q_out ) ;     // Add function complete acknowledge with parameter.

}

/* ************************************************************ */
// Declare module
module adder4 {

/* ************************************************************ */
// Internal operation signals

/* ************************************************************ */
// Pallarel equation

/* ************************************************************ */
// Function independent equation
    function    exec {
        done ( A_in + B_in ) ;
    }

}
/* ************************************************************ */

declare ADDER4_func_call {

    input       Add_A_in[4] ;               // Add value input. Port-A
    input       Add_B_in[4] ;               // Add value input. Port-B
    output      Add_result[4] ;             // Add result out

    func_in Add_exec(Add_A_in,Add_B_in) ;   // Add function execution request.
    func_out    Add_done(Add_result) ;

}

module  ADDER4_func_call {
/* ************************************************************ */
// Declare lower module
    adder4      u_adder4 ;  // Declare lower 4bit adder module as "u_adder4"

/* ************************************************************ */
// Internal operation signals

/* ************************************************************ */
// Pallarel equation

/* ************************************************************ */
// Function independent equation
    function    Add_exec {
        Add_done ( u_adder4.exec( Add_A_in, Add_B_in ).Q_out ) ;
        // Declaration
        //  A 'Add_exec' call a 'Add_done' function.
        //  This statement provide 2 parameters with 'exec()' fuction
        //  to lower iniciated 'u_adder4' module.
        //  A result from 'u_adder4' is reflected on 'Q_out'signal.
        //  It send via 'Add_result' pins.
        //
        //  This code shown 'Lower module call', 'Path an input parameter'
        //  and 'Get result' on this single statement.
    }
}
/* ************************************************************ */
PAGE TOP