Commit c6bdde56 authored by Andrey Filippov's avatar Andrey Filippov

Working on MCLT version for Bayer data, exploiting symmetry of DTT of

checker board data (half zeros)
parent f69ec863
This diff is collapsed.
......@@ -18,9 +18,10 @@ from __future__ import division
#
'''
Calculate ROM for MCLT fold indices:
A0..A1 - variant, folding to the same 8x8 sample
A2..A4 - sample column in folded 8x8 tile
A5..A7 - sample row in folded 8x8 tile
A0..A2 - sample column in folded 8x8 tile
A3..A5 - sample row in folded 8x8 tile
A6..A7 - variant, folding to the same 8x8 sample
D0..D4 - pixel column in 16x16 tile
D5..D7 - pixel row in 16x16 tile
D8 - negate for mode 0 (CC)
......@@ -207,9 +208,9 @@ def create_fold(n = 8): # n - DCT and window size
'''
Calculate ROM for MCLT fold indices:
A0..A1 - variant, folding to the same 8x8 sample
A2..A4 - sample column in folded 8x8 tile
A5..A7 - sample row in folded 8x8 tile
A0..A2 - sample column in folded 8x8 tile
A3..A5 - sample row in folded 8x8 tile
A6..A7 - variant, folding to the same 8x8 sample
D0..D4 - pixel column in 16x16 tile
D5..D7 - pixel row in 16x16 tile
D8 - negate for mode 0 (CC)
......
......@@ -79,7 +79,7 @@ module dsp_ma_preadd #(
2'b01,
2'b01};
initial begin
$display("dsp_ma_preadd, using DSP48E1");
$display("dsp_ma_preadd, using DSP48E1. FIXME: implement BREG=2 for undef INSTANTIATE_DSP48E1");
end
DSP48E1 #(
......
......@@ -286,8 +286,6 @@ D11 - negate for mode 3 (SS)
.clk_a (clk), // input
.addr_a ({2'b0,in_cntr[1:0],in_cntr[7:2]}), // input[9:0]
/// .en_a (in_busy[1]), // input
/// .regen_a (in_busy[2]), // input
.en_a (in_busy[0]), // input
.regen_a (in_busy[1]), // input
.we_a (1'b0), // input
......@@ -303,7 +301,7 @@ D11 - negate for mode 3 (SS)
.data_in_b (18'b0) // input[17:0]
);
// Latency = 5
// Latency = 6
mclt_wnd_mul #(
.SHIFT_WIDTH (SHIFT_WIDTH),
.COORD_WIDTH (COORD_WIDTH),
......@@ -315,7 +313,8 @@ D11 - negate for mode 3 (SS)
.x_in (mpix_a_w[3:0]), // input[3:0]
.y_in (mpix_a_w[7:4]), // input[3:0]
.x_shft (x_shft_r2), // input[7:0]
.y_shft (y_shft_r2), // input[7:0]
.y_shft (y_shft_r2), // input[7:0]
.zero_in (1'b0), // input TODO: covert from mpix_use_r?
.wnd_out (window_w) // output[17:0] valid with in_busy[8]
);
......@@ -349,7 +348,6 @@ D11 - negate for mode 3 (SS)
) dly_var_first_i (
.clk (clk), // input
.rst (rst), // input
/// .dly (4'h8), // input[3:0]
.dly (4'h9), // input[3:0]
.din (in_busy[0] && (in_cntr[1:0] == 0)), // input[0:0]
.dout (var_first_d) // output[0:0]
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -43,12 +43,13 @@ module mclt_wnd_mul#(
parameter COORD_WIDTH = 10, // bits in full coordinate 10 for 18K RAM
parameter OUT_WIDTH = 18 // bits in window value (positive)
)(
input clk, //!< system clock, posedge
input en, //!< re (both re and ren - just for power)
input [3:0] x_in, //!< tile pixel X
input [3:0] y_in, //!< tile pixel Y
input clk, //!< system clock, posedge
input en, //!< re (both re and ren - just for power)
input [3:0] x_in, //!< tile pixel X
input [3:0] y_in, //!< tile pixel Y
input [SHIFT_WIDTH-1:0] x_shft, //!< tile pixel X
input [SHIFT_WIDTH-1:0] y_shft, //!< tile pixel Y
input zero_in, // set window to zero (2 cycles after other inputs)
output signed [OUT_WIDTH - 1 : 0] wnd_out
);
wire [COORD_WIDTH - 1 : 0] x_full;
......@@ -77,7 +78,7 @@ module mclt_wnd_mul#(
wnd_out_x_r <= wnd_out_x;
wnd_out_y_r <= wnd_out_y;
// zero <= {zero[0], x_zero | y_zero};
zero <= x_zero | y_zero;
zero <= x_zero | y_zero | zero_in;
wnd_out_r <= wnd_out_w; // wnd_out_x_r * wnd_out_y_r;
end
......
// Created with ./create_bayer_fold_rom.py
// MCLT 16x16...22x22 Bayer -> 8x8 fold indices
, .INIT_00 (256'hA4A4A2A2A6A6A0A0A8A8AEAEAAAAACACB3B3B5B5B1B1B7B7BFBFB9B9BDBDBBBB)
, .INIT_01 (256'h848482828686808088888E8E8A8A8C8C93939595919197979F9F99999D9D9B9B)
, .INIT_02 (256'h13131515111117171F1F19191D1D1B1B040402020606000008080E0E0A0A0C0C)
, .INIT_03 (256'h33333535313137373F3F39393D3D3B3B242422222626202028282E2E2A2A2C2C)
, .INIT_04 (256'hD3D3D5D5D1D1D7D7DFDFD9D9DDDDDBDBC4C4C2C2C6C6C0C0C8C8CECECACACCCC)
, .INIT_05 (256'hF3F3F5F5F1F1F7F7FFFFF9F9FDFDFBFBE4E4E2E2E6E6E0E0E8E8EEEEEAEAECEC)
, .INIT_06 (256'h646462626666606068686E6E6A6A6C6C73737575717177777F7F79797D7D7B7B)
, .INIT_07 (256'h444442424646404048484E4E4A4A4C4C53535555515157575F5F59595D5D5B5B)
, .INIT_08 (256'hA3A3A5A5A1A1A7A7AFAFA9A9ADADABABB4B4B2B2B6B6B0B0B8B8BEBEBABABCBC)
, .INIT_09 (256'h83838585818187878F8F89898D8D8B8B949492929696909098989E9E9A9A9C9C)
, .INIT_0A (256'h141412121616101018181E1E1A1A1C1C03030505010107070F0F09090D0D0B0B)
, .INIT_0B (256'h343432323636303038383E3E3A3A3C3C23232525212127272F2F29292D2D2B2B)
, .INIT_0C (256'hD4D4D2D2D6D6D0D0D8D8DEDEDADADCDCC3C3C5C5C1C1C7C7CFCFC9C9CDCDCBCB)
, .INIT_0D (256'hF4F4F2F2F6F6F0F0F8F8FEFEFAFAFCFCE3E3E5E5E1E1E7E7EFEFE9E9EDEDEBEB)
, .INIT_0E (256'h63636565616167676F6F69696D6D6B6B747472727676707078787E7E7A7A7C7C)
, .INIT_0F (256'h43434545414147474F4F49494D4D4B4B545452525656505058585E5E5A5A5C5C)
, .INIT_10 (256'hB8A4B6A2BAA6B4A0BCA8C2AEBEAAC0ACC9B3CBB5C7B1CDB7D5BFCFB9D3BDD1BB)
, .INIT_11 (256'h948492829686908098889E8E9A8A9C8CA593A795A391A997B19FAB99AF9DAD9B)
, .INIT_12 (256'h1513171513111917211F1B191F1D1D1B040402020606000008080E0E0A0A0C0C)
, .INIT_13 (256'h39333B3537313D37453F3F39433D413B282426222A2624202C28322E2E2A302C)
, .INIT_14 (256'hEDD3EFD5EBD1F1D7F9DFF3D9F7DDF5DBDCC4DAC2DEC6D8C0E0C8E6CEE2CAE4CC)
, .INIT_15 (256'h11F313F50FF115F71DFF17F91BFD19FB00E4FEE202E6FCE004E80AEE06EA08EC)
, .INIT_16 (256'h70646E6272666C6074687A6E766A786C817383757F7185778D7F87798B7D897B)
, .INIT_17 (256'h4C444A424E4648405048564E524A544C5D535F555B516157695F6359675D655B)
, .INIT_18 (256'hB7A3B9A5B5A1BBA7C3AFBDA9C1ADBFABCAB4C8B2CCB6C6B0CEB8D4BED0BAD2BC)
, .INIT_19 (256'h93839585918197879F8F99899D8D9B8BA694A492A896A290AA98B09EAC9AAE9C)
, .INIT_1A (256'h16141412181612101A18201E1C1A1E1C03030505010107070F0F09090D0D0B0B)
, .INIT_1B (256'h3A3438323C3636303E38443E403A423C2723292525212B27332F2D29312D2F2B)
, .INIT_1C (256'hEED4ECD2F0D6EAD0F2D8F8DEF4DAF6DCDBC3DDC5D9C1DFC7E7CFE1C9E5CDE3CB)
, .INIT_1D (256'h12F410F214F60EF016F81CFE18FA1AFCFFE301E5FDE103E70BEF05E909ED07EB)
, .INIT_1E (256'h6F6371656D6173677B6F7569796D776B8274807284767E7086788C7E887A8A7C)
, .INIT_1F (256'h4B434D4549414F47574F5149554D534B5E545C5260565A506258685E645A665C)
, .INIT_20 (256'hCCA4CAA2CEA6C8A0D0A8D6AED2AAD4ACDFB3E1B5DDB1E3B7EBBFE5B9E9BDE7BB)
, .INIT_21 (256'hA484A282A686A080A888AE8EAA8AAC8CB793B995B591BB97C39FBD99C19DBF9B)
, .INIT_22 (256'h1713191515111B17231F1D19211D1F1B040402020606000008080E0E0A0A0C0C)
, .INIT_23 (256'h3F3341353D3143374B3F4539493D473B2C242A222E2628203028362E322A342C)
, .INIT_24 (256'h07D309D505D10BD713DF0DD911DD0FDBF4C4F2C2F6C6F0C0F8C8FECEFACAFCCC)
, .INIT_25 (256'h2FF331F52DF133F73BFF35F939FD37FB1CE41AE21EE618E020E826EE22EA24EC)
, .INIT_26 (256'h7C647A627E6678608068866E826A846C8F7391758D7193779B7F9579997D977B)
, .INIT_27 (256'h544452425646504058485E4E5A4A5C4C6753695565516B57735F6D59715D6F5B)
, .INIT_28 (256'hCBA3CDA5C9A1CFA7D7AFD1A9D5ADD3ABE0B4DEB2E2B6DCB0E4B8EABEE6BAE8BC)
, .INIT_29 (256'hA383A585A181A787AF8FA989AD8DAB8BB894B692BA96B490BC98C29EBE9AC09C)
, .INIT_2A (256'h181416121A1614101C18221E1E1A201C03030505010107070F0F09090D0D0B0B)
, .INIT_2B (256'h40343E3242363C3044384A3E463A483C2B232D2529212F27372F3129352D332B)
, .INIT_2C (256'h08D406D20AD604D00CD812DE0EDA10DCF3C3F5C5F1C1F7C7FFCFF9C9FDCDFBCB)
, .INIT_2D (256'h30F42EF232F62CF034F83AFE36FA38FC1BE31DE519E11FE727EF21E925ED23EB)
, .INIT_2E (256'h7B637D6579617F67876F8169856D836B90748E7292768C7094789A7E967A987C)
, .INIT_2F (256'h53435545514157475F4F59495D4D5B4B685466526A5664506C58725E6E5A705C)
, .INIT_30 (256'hE0A4DEA2E2A6DCA0E4A8EAAEE6AAE8ACF5B3F7B5F3B1F9B701BFFBB9FFBDFDBB)
, .INIT_31 (256'hB484B282B686B080B888BE8EBA8ABC8CC993CB95C791CD97D59FCF99D39DD19B)
, .INIT_32 (256'h19131B1517111D17251F1F19231D211B040402020606000008080E0E0A0A0C0C)
, .INIT_33 (256'h4533473543314937513F4B394F3D4D3B30242E2232262C2034283A2E362A382C)
, .INIT_34 (256'h21D323D51FD125D72DDF27D92BDD29DB0CC40AC20EC608C010C816CE12CA14CC)
, .INIT_35 (256'h4DF34FF54BF151F759FF53F957FD55FB38E436E23AE634E03CE842EE3EEA40EC)
, .INIT_36 (256'h886486628A6684608C68926E8E6A906C9D739F759B71A177A97FA379A77DA57B)
, .INIT_37 (256'h5C445A425E4658406048664E624A644C715373556F5175577D5F77597B5D795B)
, .INIT_38 (256'hDFA3E1A5DDA1E3A7EBAFE5A9E9ADE7ABF6B4F4B2F8B6F2B0FAB800BEFCBAFEBC)
, .INIT_39 (256'hB383B585B181B787BF8FB989BD8DBB8BCA94C892CC96C690CE98D49ED09AD29C)
, .INIT_3A (256'h1A1418121C1616101E18241E201A221C03030505010107070F0F09090D0D0B0B)
, .INIT_3B (256'h46344432483642304A38503E4C3A4E3C2F2331252D2133273B2F3529392D372B)
, .INIT_3C (256'h22D420D224D61ED026D82CDE28DA2ADC0BC30DC509C10FC717CF11C915CD13CB)
, .INIT_3D (256'h4EF44CF250F64AF052F858FE54FA56FC37E339E535E13BE743EF3DE941ED3FEB)
, .INIT_3E (256'h8763896585618B67936F8D69916D8F6B9E749C72A0769A70A278A87EA47AA67C)
, .INIT_3F (256'h5B435D4559415F47674F6149654D634B7254705274566E5076587C5E785A7A5C)
, .INITP_00 (256'hBB88EE22BB88EE22EE22BB88EE22BB8811DD447711DD4477BB88EE22BB88EE22)
, .INITP_01 (256'hEE22BB88EE22BB88BB88EE22BB88EE22447711DD447711DDEE22BB88EE22BB88)
, .INITP_02 (256'hBB88EE22BB88EE22EE22BB88EE22BB8811DD447711DD4477BB88EE22BB88EE22)
, .INITP_03 (256'hEE22BB88EE22BB88BB88EE22BB88EE22447711DD447711DDEE22BB88EE22BB88)
, .INITP_04 (256'hBB88EE22BB88EE22EE22BB88EE22BB8811DD447711DD4477BB88EE22BB88EE22)
, .INITP_05 (256'hEE22BB88EE22BB88BB88EE22BB88EE22447711DD447711DDEE22BB88EE22BB88)
, .INITP_06 (256'hBB88EE22BB88EE22EE22BB88EE22BB8811DD447711DD4477BB88EE22BB88EE22)
, .INITP_07 (256'hEE22BB88EE22BB88BB88EE22BB88EE22447711DD447711DDEE22BB88EE22BB88)
// Pixels input range: 0.000000 ... 390.304718
//1490.0 951.0
//Full Bayer fpga tile data
177d 2fbe 19b7 2941 16c6 288f 1899 3143 1d9d 3c50 1e6e 4236 1c09 3fa9 2155 493c 23e9 3ed5 1cd6 39e8 19bd 294b
379e 18f8 3370 150d 3443 1618 36c9 15bf 36c9 1ba0 3ea6 1f33 4248 1c68 4337 1e66 4603 21b1 3dc6 2008 3b20 1842
1a79 2aa7 14ab 2527 1453 25d2 1351 2529 13fd 2944 1a1b 3dfb 1d9f 4082 1c6f 377c 1ba6 3b85 1da2 3b88 2157 3e03
3879 14b4 3443 14b5 35ef 1565 3372 13b3 30ff 14b6 395d 1d97 4334 1b3f 3ce0 16d0 3520 1787 3c01 18a0 3eab 2008
12fa 1ff6 13fc 2941 1503 2c17 14ab 247e 14ab 2730 1a1b 3844 1ed6 4235 16c9 252d 166e 2ab0 1457 27e7 17e0 314b
329b 145d 3958 16cc 37a0 18f9 35f2 195a 3dbe 1b3d 415d 1d97 638a 5ce5 4cbc 195c 3883 16d0 32a7 1676 3962 161c
1721 2e43 166a 2b5f 13a5 29f5 1c6c 3775 1e04 3452 195a 35e4 261c 6e90 1e07 3ab3 1e07 36b0 183e 2cda 1507 2333
3879 150c 329e 14b5 3518 189b 3a39 1b3d 3bf8 195a 5c00 1e64 4334 189d 4424 26e6 5e26 1ecd 3dc6 18a0 37aa 1361
134f 2329 13a5 288e 1a18 313f 19b8 3082 1454 2c19 6194 6a51 1a7c 2893 1a7e 4856 5216 4dc4 1ed9 2d94 13a9 29fe
31cb 12b4 35ef 1727 3958 17e0 3cda 189c 37a3 16cd 46f2 183f 3cdd 1ba1 4161 1ecd 4fb2 2006 4516 1c07 3b20 1adf
1669 293e 177e 29f4 1503 288e 1351 21e1 14ab 2528 1505 2d8f 1a1b 3d25 1ae0 3087 1a1c 3914 1da2 3b87 17e0 314a
31cb 1616 36c7 14b5 329e 1408 30ff 1409 35f2 150e 3881 18fc 3ea6 1add 3b1d 1ade 36cf 1ade 3ce3 1cd0 3962 19bd
13fb 21dd 14aa 21df 166a 313f 183b 2942 1504 25d3 155e 2945 183c 3206 16c9 2f09 183d 35e6 195c 3394 19bc 35e9
336e 150c 3519 1671 36c7 183d 387e 14b6 3446 1566 3448 13b4 351d 189d 35f7 15c1 3960 18fd 3a41 17e5 3886 16d1
15b4 27db 177e 2ccf 160f 2f01 14ab 247d 13fd 2cd2 1780 2945 17de 2fc5 13ff 252c 1725 3087 1457 21e6 13a9 2332
36c5 1616 329e 150d 302f 1408 3446 15bf 395b 15bf 37a5 140a 3375 19ba 344b 14b8 35f7 1568 31d6 13b6 3522 1676
160e 288b 15b5 27dc 1252 2098 1504 2d8b 1a19 2aaa 1352 1ffa 1455 2e49 1255 252b 14ad 2733 1457 27e5 12fe 228b
30fb 14b4 3030 1565 37a1 135d 2dd1 14b6 3446 1409 2e9d 1619 3449 189d 31d4 130b 32a5 161b 337a 1462 3039 116f
13fb 1e1b 13fc 213b 13a5 288d 177f 2e47 1351 25d3 12fc 1ffa 12fc 2944 1613 21e4 12fd 2733 13a9 20a0 1256 20a0
302e 120d 31cd 12b4 30fe 1b9f 4245 1c03 3372 13b3 31d2 13b4 351e 183f 3520 12b7 32a5 1461 2f6d 12b8 2d10 1361
134f 2281 12a6 25d1 1957 272d 1958 2d8b 166b 1f59 1352 27e1 189a 2fc4 1506 1f5d 115d 1e21 1256 1e23 12aa 23da
329c 111a 329e 135d 3030 145e 351c 15bf 31d0 120f 3034 12b6 3449 1674 32a5 1510 2b82 111d 2f6d 1212 31d7 11c0
// 28 padding 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
//Full Bayer fpga tile data
177d 2fbe 19b7 2941 16c6 288f 1899 3143 1d9d 3c50 1e6e 4236 1c09 3fa9 2155 493c 23e9 3ed5 1cd6 39e8 19bd 294b
379e 18f8 3370 150d 3443 1618 36c9 15bf 36c9 1ba0 3ea6 1f33 4248 1c68 4337 1e66 4603 21b1 3dc6 2008 3b20 1842
1a79 2aa7 14ab 2527 1453 25d2 1351 2529 13fd 2944 1a1b 3dfb 1d9f 4082 1c6f 377c 1ba6 3b85 1da2 3b88 2157 3e03
3879 14b4 3443 14b5 35ef 1565 3372 13b3 30ff 14b6 395d 1d97 4334 1b3f 3ce0 16d0 3520 1787 3c01 18a0 3eab 2008
12fa 1ff6 13fc 2941 1503 2c17 14ab 247e 14ab 2730 1a1b 3844 1ed6 4235 16c9 252d 166e 2ab0 1457 27e7 17e0 314b
329b 145d 3958 16cc 37a0 18f9 35f2 195a 3dbe 1b3d 415d 1d97 638a 5ce5 4cbc 195c 3883 16d0 32a7 1676 3962 161c
1721 2e43 166a 2b5f 13a5 29f5 1c6c 3775 1e04 3452 195a 35e4 261c 6e90 1e07 3ab3 1e07 36b0 183e 2cda 1507 2333
3879 150c 329e 14b5 3518 189b 3a39 1b3d 3bf8 195a 5c00 1e64 4334 189d 4424 26e6 5e26 1ecd 3dc6 18a0 37aa 1361
134f 2329 13a5 288e 1a18 313f 19b8 3082 1454 2c19 6194 6a51 1a7c 2893 1a7e 4856 5216 4dc4 1ed9 2d94 13a9 29fe
31cb 12b4 35ef 1727 3958 17e0 3cda 189c 37a3 16cd 46f2 183f 3cdd 1ba1 4161 1ecd 4fb2 2006 4516 1c07 3b20 1adf
1669 293e 177e 29f4 1503 288e 1351 21e1 14ab 2528 1505 2d8f 1a1b 3d25 1ae0 3087 1a1c 3914 1da2 3b87 17e0 314a
31cb 1616 36c7 14b5 329e 1408 30ff 1409 35f2 150e 3881 18fc 3ea6 1add 3b1d 1ade 36cf 1ade 3ce3 1cd0 3962 19bd
13fb 21dd 14aa 21df 166a 313f 183b 2942 1504 25d3 155e 2945 183c 3206 16c9 2f09 183d 35e6 195c 3394 19bc 35e9
336e 150c 3519 1671 36c7 183d 387e 14b6 3446 1566 3448 13b4 351d 189d 35f7 15c1 3960 18fd 3a41 17e5 3886 16d1
15b4 27db 177e 2ccf 160f 2f01 14ab 247d 13fd 2cd2 1780 2945 17de 2fc5 13ff 252c 1725 3087 1457 21e6 13a9 2332
36c5 1616 329e 150d 302f 1408 3446 15bf 395b 15bf 37a5 140a 3375 19ba 344b 14b8 35f7 1568 31d6 13b6 3522 1676
160e 288b 15b5 27dc 1252 2098 1504 2d8b 1a19 2aaa 1352 1ffa 1455 2e49 1255 252b 14ad 2733 1457 27e5 12fe 228b
30fb 14b4 3030 1565 37a1 135d 2dd1 14b6 3446 1409 2e9d 1619 3449 189d 31d4 130b 32a5 161b 337a 1462 3039 116f
13fb 1e1b 13fc 213b 13a5 288d 177f 2e47 1351 25d3 12fc 1ffa 12fc 2944 1613 21e4 12fd 2733 13a9 20a0 1256 20a0
302e 120d 31cd 12b4 30fe 1b9f 4245 1c03 3372 13b3 31d2 13b4 351e 183f 3520 12b7 32a5 1461 2f6d 12b8 2d10 1361
134f 2281 12a6 25d1 1957 272d 1958 2d8b 166b 1f59 1352 27e1 189a 2fc4 1506 1f5d 115d 1e21 1256 1e23 12aa 23da
329c 111a 329e 135d 3030 145e 351c 15bf 31d0 120f 3034 12b6 3449 1674 32a5 1510 2b82 111d 2f6d 1212 31d7 11c0
// 28 padding 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment