csadder5b.v 4.25 KB
// Module instances modified by /home/rws/workarea/rf/sw/bbplayer/tools/necprimfix 
//
//    6 instances of ad01d1 changed to j_ad01.
//    5 instances of ad01d1h changed to j_ad01.
//    1 instance of an02d1h changed to j_an02.
//    3 instances of mx21d1 changed to j_mx21.
//    5 instances of mx21d1h changed to j_mx21.
//    5 instances of ni01d2 changed to j_ni01.
//    1 instance of nr05d2 changed to j_nr05.
//    1 instance of xo02d1 changed to j_xo02.
//

/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1994, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 *************************************************************************/
// $Id: csadder5b.v,v 1.2 2002/11/13 02:11:41 rws Exp $
   /////////////////////////////////////////////////////////////////////////
   //
   // Project Reality
   //
   // module:      csadder5b
   // description: a 5-bit adder
   //   
   //
   // designer:    Mike M. Cai   10/5/94
   //
   /////////////////////////////////////////////////////////////////////////

module csadder5b(sum, a, base_adrs, shf_state);
output [4:0]   sum;
input [4:0]    a, base_adrs;
input [4:0]    shf_state;

wire [4:0]  sum0, sum1;
wire [4:0]  sum0_co, sum1_co;
wire  	    state_zero;
wire [4:0]  sum_m;
wire [4:0]  base_adrsbuf;

j_nr05 state0(.zn(state_zero), .a1(shf_state[0]), .a2(shf_state[1]), 
      	    .a3(shf_state[2]), .a4(shf_state[3]), .a5(shf_state[4]));
/*
j_ad01 sum0b2(.s(sum0[2]), .co(sum0_co[3]), 
                .a(a[2]), .b(base_adrs[2]), .ci(1'h0));
j_ad01 sum1b2(.s(sum1[2]), .co(sum1_co[3]), 
                .a(a[2]), .b(base_adrs[2]), .ci(1'h1));
j_ad01 sum0b3(.s(sum0[3]), .co(sum0_co[4]), 
                .a(a[3]), .b(base_adrs[3]), .ci(sum0_co[3]));
j_ad01 sum1b3(.s(sum1[3]), .co(sum1_co[4]), 
                .a(a[3]), .b(base_adrs[3]), .ci(sum1_co[3]));
j_ad01 sum0b4(.s(sum0[4]), // .co(sum0_co[5]), 
                .a(a[4]), .b(base_adrs[4]), .ci(sum0_co[4]));
j_ad01 sum1b4(.s(sum1[4]), // .co(sum1_co[5]), 
                .a(a[4]), .b(base_adrs[4]), .ci(sum1_co[4]));

j_mx21 sum2(.z(sum_m[2]), .i0(sum0[2]), .i1(sum1[2]), .s(sum0_co[2]));
j_mx21 sum3(.z(sum_m[3]), .i0(sum0[3]), .i1(sum1[3]), .s(sum0_co[2]));
j_mx21 sum4(.z(sum_m[4]), .i0(sum0[4]), .i1(sum1[4]), .s(sum0_co[2]));
j_ad01 sumb0(.s(sum_m[0]), .co(sum0_co[1]), 
                .a(a[0]), .b(base_adrs[0]), .ci(1'h0));
*/

j_ni01 base0(.z(base_adrsbuf[0]), .i(base_adrs[0]));
j_ni01 base1(.z(base_adrsbuf[1]), .i(base_adrs[1]));
j_ni01 base2(.z(base_adrsbuf[2]), .i(base_adrs[2]));
j_ni01 base3(.z(base_adrsbuf[3]), .i(base_adrs[3]));
j_ni01 base4(.z(base_adrsbuf[4]), .i(base_adrs[4]));

j_an02 sumb0_co(.z(sum0_co[1]), .a1(a[0]), .a2(base_adrsbuf[0]));
j_xo02  sumb0_sum(.z(sum_m[0]), .a1(a[0]), .a2(base_adrsbuf[0]));
j_ad01 sumb1(.s(sum_m[1]), .co(sum0_co[2]), 
                .a(a[1]), .b(base_adrsbuf[1]), .ci(sum0_co[1]));
j_ad01 sumb2(.s(sum_m[2]), .co(sum0_co[3]), 
                .a(a[2]), .b(base_adrsbuf[2]), .ci(sum0_co[2]));
j_ad01 sumb3(.s(sum_m[3]), .co(sum0_co[4]), 
                .a(a[3]), .b(base_adrsbuf[3]), .ci(sum0_co[3]));
j_ad01 sumb4(.s(sum_m[4]), // .co(sum0_co[1]), 
                .a(a[4]), .b(base_adrsbuf[4]), .ci(sum0_co[4]));

j_mx21 muxbout0(.z(sum[0]), .i0(sum_m[0]), .i1(base_adrsbuf[0]), .s(state_zero));
j_mx21 muxbout1(.z(sum[1]), .i0(sum_m[1]), .i1(base_adrsbuf[1]), .s(state_zero));
j_mx21 muxbout2(.z(sum[2]), .i0(sum_m[2]), .i1(base_adrsbuf[2]), .s(state_zero));
j_mx21 muxbout3(.z(sum[3]), .i0(sum_m[3]), .i1(base_adrsbuf[3]), .s(state_zero));
j_mx21 muxbout4(.z(sum[4]), .i0(sum_m[4]), .i1(base_adrsbuf[4]), .s(state_zero));

//initial
//   $monitor($time, "sum = %b %h", sum, sum);

endmodule  //  csadder5b