module p_pack #( parameter PipeSpec = `PS_def ) (
        input                               start,
        input                               stop,
        input [`P_Data_w(PipeSpec)-1:0]     data,
        input [`P_DataSize_w(PipeSpec)-1:0] datasize,
        input                               valid,
        output                              ready,

        inout [`P_w(PipeSpec)-1:0]            pipe
    );

    generate
        if ( `P_Start_w( PipeSpec ) )
            assign pipe[ `P_Start_b(PipeSpec) ] = start;
        if ( `P_Stop_w( PipeSpec ) )
            assign pipe[ `P_Stop_b(PipeSpec) ]  = stop;
    endgenerate

    generate
        if ( `P_DataSize_w( PipeSpec ) )
            assign pipe[ `P_DataSize_m(PipeSpec):`P_DataSize_l(PipeSpec) ] = datasize;
    endgenerate

    assign pipe[ `P_Data_m(PipeSpec):`P_Data_l(PipeSpec) ] = data;
    assign pipe[ `P_Valid_b(PipeSpec) ] = valid;
    assign ready = pipe[ `P_Ready_b(PipeSpec) ];

endmodule