Reply by Kevin Neilson September 30, 20162016-09-30
On Tuesday, September 27, 2016 at 7:31:56 PM UTC-6, Marvin L wrote:
> I am implementing the gamma correction LUT as in https://ptpb.pw/ZwYS >=20 > if I want to share a single combinatorial lookup table with multiple inpu=
t, it is not possible, right ?
>=20 > because in this case, the lookup table would just assign to one output re=
g
>=20 > say all r, g and b channels want to use the same combinatorial lookup tab=
le, how would I do it ?
>=20
You can share a blockRAM-based lookup table between two users. A LUT-ram-b= ased lookup can't be shared unless you timeslice it. Yes, you can do a 256= ->1 lookup in one Virtex-7 slice (using 4 LUTs, 2 F7, and 1 F8 mux). I looked at your function and it doesn't look like you can use a lookup tab= le. There is a 3x3 matrix multiplication so the output is a function of R,= G, and B, so if you wanted to do a lookup the table would have to be 3-dim= ensional and have 256^3 elements. I think you actually have to implement t= he logic in this case. Because the R,G,B inputs are only 8 bits each, you = can still implement the multiplications in 256-deep lookup tables, but you'= d still need to sum the results together to get the result of the matrix mu= lt.
Reply by Marvin L September 27, 20162016-09-27
I am implementing the gamma correction LUT as in https://ptpb.pw/ZwYS

if I want to share a single combinatorial lookup table with multiple input, it is not possible, right ?

because in this case, the lookup table would just assign to one output reg

say all r, g and b channels want to use the same combinatorial lookup table, how would I do it ?

Someone suggested the following, could anyone advice ?
mux -> lut -> demux


But my friend told me the following instead:
A 256-sized table can be done in one slice, containing 4-luts--for every output bit.  It will consume all 4 luts of the slice.

So ... we're talking about 8 slices, or 32-luts, per color.

96 LUTs is reasonable.  Now, if you wished to somehow re-use those 96 LUTs to get your logic down to a smaller size, be prepared for the fact that it will cost logic to make any logic change--perhaps as much as the 96 LUTs that you would originally need.