added N=1 cases
This commit is contained in:
parent
f7cd7006d0
commit
da5948f493
|
@ -48,6 +48,9 @@ defproc ortree (bool? in[N]; bool! out; power supply)
|
|||
|
||||
{ N > 0 : "What?" };
|
||||
|
||||
[N = 1 -> BUF_X1 b(.vss=supply.vss, .vdd = supply.vdd, .a = in[0], .y = out);
|
||||
[] N > 1 ->
|
||||
|
||||
pint i, end, j;
|
||||
i = 0;
|
||||
end = N-1;
|
||||
|
@ -148,6 +151,8 @@ defproc ortree (bool? in[N]; bool! out; power supply)
|
|||
]
|
||||
|
||||
out = tmp[end];
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
export template<pint N>
|
||||
|
@ -157,6 +162,11 @@ defproc andtree (bool? in[N]; bool! out; power supply)
|
|||
|
||||
{ N > 0 : "What?" };
|
||||
|
||||
|
||||
|
||||
[N = 1 -> BUF_X1 b(.vss=supply.vss, .vdd = supply.vdd, .a = in[0], .y = out);
|
||||
[] N > 1 ->
|
||||
|
||||
pint i, end, j;
|
||||
i = 0;
|
||||
end = N-1;
|
||||
|
@ -257,6 +267,8 @@ defproc andtree (bool? in[N]; bool! out; power supply)
|
|||
]
|
||||
|
||||
out = tmp[end];
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -270,6 +282,10 @@ defproc ctree (bool? in[N]; bool! out; power supply)
|
|||
|
||||
{ N > 0 : "What?" };
|
||||
|
||||
bool meaningless_var;
|
||||
|
||||
[N = 1 -> BUF_X1 b(.vss=supply.vss, .vdd = supply.vdd, .a = in[0], .y = out);
|
||||
[] N > 1 ->
|
||||
pint i, end, j;
|
||||
i = 0;
|
||||
end = N-1;
|
||||
|
@ -374,6 +390,11 @@ defproc ctree (bool? in[N]; bool! out; power supply)
|
|||
|
||||
out = tmp[end];
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export template<pint N>
|
||||
|
|
Loading…
Reference in New Issue