1 (* techmap_celltype = "$reduce_or" *)
2 module my_opt_reduce_or(...);
3 parameter A_SIGNED = 0;
8 output reg [Y_WIDTH-1:0] Y;
10 parameter _TECHMAP_CONSTMSK_A_ = 0;
11 parameter _TECHMAP_CONSTVAL_A_ = 0;
13 wire _TECHMAP_FAIL_ = count_nonconst_bits() == A_WIDTH;
14 wire [1024:0] _TECHMAP_DO_ = "proc;;";
16 function integer count_nonconst_bits;
19 count_nonconst_bits = 0;
20 for (i = 0; i < A_WIDTH; i=i+1)
21 if (!_TECHMAP_CONSTMSK_A_[i])
22 count_nonconst_bits = count_nonconst_bits+1;
26 function has_const_one;
30 for (i = 0; i < A_WIDTH; i=i+1)
31 if (_TECHMAP_CONSTMSK_A_[i] && _TECHMAP_CONSTVAL_A_[i] === 1'b1)
37 reg [count_nonconst_bits()-1:0] tmp;
40 if (has_const_one()) begin
43 for (i = 0; i < A_WIDTH; i=i+1)
44 if (!_TECHMAP_CONSTMSK_A_[i])
45 tmp = {A[i], tmp[count_nonconst_bits()-1:1]};