LIBRARY ieee, work;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_unsigned.all;

ENTITY multi_palet IS

	PORT (
		line_in		: IN  integer range 0 to 511;
		row_in	    : IN  integer range 0 to 1023;

		row_out		: OUT integer range 0 to 1023;
		line_out	: OUT integer range 0 to 511;

		code_out    : OUT integer range 0 to 7;
		code_in     : IN  integer range 0 to 7;

		choix_in	: IN  std_logic_vector(7 downto 0);
		donnee      : OUT std_logic_vector(11 downto 0);
    
		win_in		: IN  std_logic;
		win_out		: OUT std_logic;

		blank_in    : in std_logic;
		sync_in     : in std_logic;
		burst_in	: in std_logic;
		blank_out   : out std_logic;
		sync_out    : out std_logic;
		burst_out	: out std_logic;

		reset_n     : IN  std_logic;
		clock       : IN  std_logic;

		code_detect : in integer range 0 to 7;
		code_ok     : in integer range 0 to 7;

		seuilpixel  : in integer range 0 to 15;
		seuilligne  : in integer range 0 to 15;

		write_code  : in std_logic;
		select_code : in std_logic_vector(5 downto 0)
	);

END multi_palet ;


ARCHITECTURE a OF multi_palet IS

component palet
	PORT (
		cpt_line	: IN  integer range 0 to 511;
		cpt_row	    : IN  integer range 0 to 1023;

		cpt_row_out : OUT integer range 0 to 1023;
		cpt_line_out: OUT integer range 0 to 511;

		code_out    : OUT integer range 0 to 7;
		code_in     : IN  integer range 0 to 7;

		choix       : IN  std_logic_vector(1 downto 0);
		donnee      : OUT std_logic_vector(11 downto 0); -- demuxeur
    
		en_win      : IN  std_logic;
		so_win      : OUT std_logic;

		blank_in    : in std_logic;
		sync_in     : in std_logic;
		burst_in	: in std_logic;
		blank_out   : out std_logic;
		sync_out    : out std_logic;
		burst_out	: out std_logic;

		reset_n     : IN  std_logic;
		clock       : IN  std_logic;

		code_detect : in integer range 0 to 7; -- a gerer
		code_ok     : in integer range 0 to 7; -- a gerer

		seuilpixel  : in integer range 0 to 15;
		seuilligne  : in integer range 0 to 15
	);
END component ;

signal choixdata : std_logic_vector(1 downto 0);
signal choixpalet : std_logic_vector(5 downto 0);

signal p0line_in, p1line_in, p2line_in, p3line_in, p4line_in, p5line_in, p6line_in, p7line_in, p8line_in, p9line_in, p10line_in, p11line_in, p12line_in, p13line_in, p14line_in, p15line_in, p16line_in, p17line_in, p18line_in, p19line_in, p20line_in, p21line_in, p22line_in, p23line_in, p24line_in, p25line_in, p26line_in, p27line_in, p28line_in, p29line_in, p30line_in, p31line_in, p32line_in, p33line_in, p34line_in, p35line_in, p36line_in, p37line_in, p38line_in, p39line_in, p40line_in, p41line_in, p42line_in, p43line_in, p44line_in, p45line_in, p46line_in, p47line_in, p48line_in, p49line_in, p50line_in, p51line_in, p52line_in, p53line_in, p54line_in, p55line_in, p56line_in, p57line_in, p58line_in : integer range 0 to 511;
signal p0row_in, p1row_in, p2row_in, p3row_in, p4row_in, p5row_in, p6row_in, p7row_in, p8row_in, p9row_in, p10row_in, p11row_in, p12row_in, p13row_in, p14row_in, p15row_in, p16row_in, p17row_in, p18row_in, p19row_in, p20row_in, p21row_in, p22row_in, p23row_in, p24row_in, p25row_in, p26row_in, p27row_in, p28row_in, p29row_in, p30row_in, p31row_in, p32row_in, p33row_in, p34row_in, p35row_in, p36row_in, p37row_in, p38row_in, p39row_in, p40row_in, p41row_in, p42row_in, p43row_in, p44row_in, p45row_in, p46row_in, p47row_in, p48row_in, p49row_in, p50row_in, p51row_in, p52row_in, p53row_in, p54row_in, p55row_in, p56row_in, p57row_in, p58row_in : integer range 0 to 1023;
signal p0code_in, p1code_in, p2code_in, p3code_in, p4code_in, p5code_in, p6code_in, p7code_in, p8code_in, p9code_in, p10code_in, p11code_in, p12code_in, p13code_in, p14code_in, p15code_in, p16code_in, p17code_in, p18code_in, p19code_in, p20code_in, p21code_in, p22code_in, p23code_in, p24code_in, p25code_in, p26code_in, p27code_in, p28code_in, p29code_in, p30code_in, p31code_in, p32code_in, p33code_in, p34code_in, p35code_in, p36code_in, p37code_in, p38code_in, p39code_in, p40code_in, p41code_in, p42code_in, p43code_in, p44code_in, p45code_in, p46code_in, p47code_in, p48code_in, p49code_in, p50code_in, p51code_in, p52code_in, p53code_in, p54code_in, p55code_in, p56code_in, p57code_in, p58code_in : integer range 0 to 7;
signal p0donnee, p1donnee, p2donnee, p3donnee, p4donnee, p5donnee, p6donnee, p7donnee, p8donnee, p9donnee, p10donnee, p11donnee, p12donnee, p13donnee, p14donnee, p15donnee, p16donnee, p17donnee, p18donnee, p19donnee, p20donnee, p21donnee, p22donnee, p23donnee, p24donnee, p25donnee, p26donnee, p27donnee, p28donnee, p29donnee, p30donnee, p31donnee, p32donnee, p33donnee, p34donnee, p35donnee, p36donnee, p37donnee, p38donnee, p39donnee, p40donnee, p41donnee, p42donnee, p43donnee, p44donnee, p45donnee, p46donnee, p47donnee, p48donnee, p49donnee, p50donnee, p51donnee, p52donnee, p53donnee, p54donnee, p55donnee, p56donnee, p57donnee, p58donnee : std_logic_vector(11 downto 0);
signal p0en_win, p1en_win, p2en_win, p3en_win, p4en_win, p5en_win, p6en_win, p7en_win, p8en_win, p9en_win, p10en_win, p11en_win, p12en_win, p13en_win, p14en_win, p15en_win, p16en_win, p17en_win, p18en_win, p19en_win, p20en_win, p21en_win, p22en_win, p23en_win, p24en_win, p25en_win, p26en_win, p27en_win, p28en_win, p29en_win, p30en_win, p31en_win, p32en_win, p33en_win, p34en_win, p35en_win, p36en_win, p37en_win, p38en_win, p39en_win, p40en_win, p41en_win, p42en_win, p43en_win, p44en_win, p45en_win, p46en_win, p47en_win, p48en_win, p49en_win, p50en_win, p51en_win, p52en_win, p53en_win, p54en_win, p55en_win, p56en_win, p57en_win, p58en_win : std_logic;
signal p0blank_in, p1blank_in, p2blank_in, p3blank_in, p4blank_in, p5blank_in, p6blank_in, p7blank_in, p8blank_in, p9blank_in, p10blank_in, p11blank_in, p12blank_in, p13blank_in, p14blank_in, p15blank_in, p16blank_in, p17blank_in, p18blank_in, p19blank_in, p20blank_in, p21blank_in, p22blank_in, p23blank_in, p24blank_in, p25blank_in, p26blank_in, p27blank_in, p28blank_in, p29blank_in, p30blank_in, p31blank_in, p32blank_in, p33blank_in, p34blank_in, p35blank_in, p36blank_in, p37blank_in, p38blank_in, p39blank_in, p40blank_in, p41blank_in, p42blank_in, p43blank_in, p44blank_in, p45blank_in, p46blank_in, p47blank_in, p48blank_in, p49blank_in, p50blank_in, p51blank_in, p52blank_in, p53blank_in, p54blank_in, p55blank_in, p56blank_in, p57blank_in, p58blank_in : std_logic;
signal p0sync_in, p1sync_in, p2sync_in, p3sync_in, p4sync_in, p5sync_in, p6sync_in, p7sync_in, p8sync_in, p9sync_in, p10sync_in, p11sync_in, p12sync_in, p13sync_in, p14sync_in, p15sync_in, p16sync_in, p17sync_in, p18sync_in, p19sync_in, p20sync_in, p21sync_in, p22sync_in, p23sync_in, p24sync_in, p25sync_in, p26sync_in, p27sync_in, p28sync_in, p29sync_in, p30sync_in, p31sync_in, p32sync_in, p33sync_in, p34sync_in, p35sync_in, p36sync_in, p37sync_in, p38sync_in, p39sync_in, p40sync_in, p41sync_in, p42sync_in, p43sync_in, p44sync_in, p45sync_in, p46sync_in, p47sync_in, p48sync_in, p49sync_in, p50sync_in, p51sync_in, p52sync_in, p53sync_in, p54sync_in, p55sync_in, p56sync_in, p57sync_in, p58sync_in : std_logic;
signal p0burst_in, p1burst_in, p2burst_in, p3burst_in, p4burst_in, p5burst_in, p6burst_in, p7burst_in, p8burst_in, p9burst_in, p10burst_in, p11burst_in, p12burst_in, p13burst_in, p14burst_in, p15burst_in, p16burst_in, p17burst_in, p18burst_in, p19burst_in, p20burst_in, p21burst_in, p22burst_in, p23burst_in, p24burst_in, p25burst_in, p26burst_in, p27burst_in, p28burst_in, p29burst_in, p30burst_in, p31burst_in, p32burst_in, p33burst_in, p34burst_in, p35burst_in, p36burst_in, p37burst_in, p38burst_in, p39burst_in, p40burst_in, p41burst_in, p42burst_in, p43burst_in, p44burst_in, p45burst_in, p46burst_in, p47burst_in, p48burst_in, p49burst_in, p50burst_in, p51burst_in, p52burst_in, p53burst_in, p54burst_in, p55burst_in, p56burst_in, p57burst_in, p58burst_in : std_logic;
signal p0code_detect, p1code_detect, p2code_detect, p3code_detect, p4code_detect, p5code_detect, p6code_detect, p7code_detect, p8code_detect, p9code_detect, p10code_detect, p11code_detect, p12code_detect, p13code_detect, p14code_detect, p15code_detect, p16code_detect, p17code_detect, p18code_detect, p19code_detect, p20code_detect, p21code_detect, p22code_detect, p23code_detect, p24code_detect, p25code_detect, p26code_detect, p27code_detect, p28code_detect, p29code_detect, p30code_detect, p31code_detect, p32code_detect, p33code_detect, p34code_detect, p35code_detect, p36code_detect, p37code_detect, p38code_detect, p39code_detect, p40code_detect, p41code_detect, p42code_detect, p43code_detect, p44code_detect, p45code_detect, p46code_detect, p47code_detect, p48code_detect, p49code_detect, p50code_detect, p51code_detect, p52code_detect, p53code_detect, p54code_detect, p55code_detect, p56code_detect, p57code_detect, p58code_detect : integer range 0 to 7;
signal p0code_ok, p1code_ok, p2code_ok, p3code_ok, p4code_ok, p5code_ok, p6code_ok, p7code_ok, p8code_ok, p9code_ok, p10code_ok, p11code_ok, p12code_ok, p13code_ok, p14code_ok, p15code_ok, p16code_ok, p17code_ok, p18code_ok, p19code_ok, p20code_ok, p21code_ok, p22code_ok, p23code_ok, p24code_ok, p25code_ok, p26code_ok, p27code_ok, p28code_ok, p29code_ok, p30code_ok, p31code_ok, p32code_ok, p33code_ok, p34code_ok, p35code_ok, p36code_ok, p37code_ok, p38code_ok, p39code_ok, p40code_ok, p41code_ok, p42code_ok, p43code_ok, p44code_ok, p45code_ok, p46code_ok, p47code_ok, p48code_ok, p49code_ok, p50code_ok, p51code_ok, p52code_ok, p53code_ok, p54code_ok, p55code_ok, p56code_ok, p57code_ok, p58code_ok : integer range 0 to 7;

BEGIN

choixdata <= choix_in(1 downto 0);
choixpalet <= choix_in(7 downto 2);

p0line_in <= line_in;
p0row_in <= row_in;
p0code_in <= code_in;
p0en_win <= win_in;
p0blank_in <= blank_in;
p0sync_in <= sync_in;
p0burst_in <= burst_in;

--row_out   <= p57row_in;
--line_out  <= p57line_in;
--code_out  <= p57code_in;
--win_out   <= p57en_win;
--blank_out <= p57blank_in;
--sync_out  <= p57sync_in;

row_out   <= p30row_in;
line_out  <= p30line_in;
code_out  <= p30code_in;
win_out   <= p30en_win;
blank_out <= p30blank_in;
sync_out  <= p30sync_in;
burst_out <= p30burst_in;

demuxeur : process(choixpalet, p0donnee, p1donnee, p2donnee, p3donnee, p4donnee, p5donnee, p6donnee, p7donnee, p8donnee, p9donnee, p10donnee, p11donnee, p12donnee, p13donnee, p14donnee, p15donnee, p16donnee, p17donnee, p18donnee, p19donnee, p20donnee, p21donnee, p22donnee, p23donnee, p24donnee, p25donnee, p26donnee, p27donnee, p28donnee, p29donnee, p30donnee, p31donnee, p32donnee, p33donnee, p34donnee, p35donnee, p36donnee, p37donnee, p38donnee, p39donnee, p40donnee, p41donnee, p42donnee, p43donnee, p44donnee, p45donnee, p46donnee, p47donnee, p48donnee, p49donnee, p50donnee, p51donnee, p52donnee, p53donnee, p54donnee, p55donnee, p56donnee, p57donnee)
begin
	case choixpalet is
		when "000000" => donnee <= p0donnee;
		when "000001" => donnee <= p1donnee;
		when "000010" => donnee <= p2donnee;
		when "000011" => donnee <= p3donnee;
		when "000100" => donnee <= p4donnee;
		when "000101" => donnee <= p5donnee;
		when "000110" => donnee <= p6donnee;
		when "000111" => donnee <= p7donnee;
		when "001000" => donnee <= p8donnee;
		when "001001" => donnee <= p9donnee;
		when "001010" => donnee <= p10donnee;
		when "001011" => donnee <= p11donnee;
		when "001100" => donnee <= p12donnee;
		when "001101" => donnee <= p13donnee;
		when "001110" => donnee <= p14donnee;
		when "001111" => donnee <= p15donnee;
		when "010000" => donnee <= p16donnee;
		when "010001" => donnee <= p17donnee;
		when "010010" => donnee <= p18donnee;
		when "010011" => donnee <= p19donnee;
		when "010100" => donnee <= p20donnee;
		when "010101" => donnee <= p21donnee;
		when "010110" => donnee <= p22donnee;
		when "010111" => donnee <= p23donnee;
		when "011000" => donnee <= p24donnee;
		when "011001" => donnee <= p25donnee;
		when "011010" => donnee <= p26donnee;
		when "011011" => donnee <= p27donnee;
		when "011100" => donnee <= p28donnee;
		when "011101" => donnee <= p29donnee;
		-- when "011110" => donnee <= p30donnee;
		-- when "011111" => donnee <= p31donnee;
		-- when "100000" => donnee <= p32donnee;
		-- when "100001" => donnee <= p33donnee;
		-- when "100010" => donnee <= p34donnee;
		-- when "100011" => donnee <= p35donnee;
		-- when "100100" => donnee <= p36donnee;
		-- when "100101" => donnee <= p37donnee;
		-- when "100110" => donnee <= p38donnee;
		-- when "100111" => donnee <= p39donnee;
		-- when "101000" => donnee <= p40donnee;
		-- when "101001" => donnee <= p41donnee;
		-- when "101010" => donnee <= p42donnee;
		-- when "101011" => donnee <= p43donnee;
		-- when "101100" => donnee <= p44donnee;
		-- when "101101" => donnee <= p45donnee;
		-- when "101110" => donnee <= p46donnee;
		-- when "101111" => donnee <= p47donnee;
		-- when "110000" => donnee <= p48donnee;
		-- when "110001" => donnee <= p49donnee;
		-- when "110010" => donnee <= p50donnee;
		-- when "110011" => donnee <= p51donnee;
		-- when "110100" => donnee <= p52donnee;
		-- when "110101" => donnee <= p53donnee;
		-- when "110110" => donnee <= p54donnee;
		-- when "110111" => donnee <= p55donnee;
		-- when "111000" => donnee <= p56donnee;
		-- when "111001" => donnee <= p57donnee;
		-- when "111010" => donnee <= p58donnee;
		when others => donnee <= "000000000000";
	end case;
end process;

muxeur : process(select_code, code_ok, code_detect, write_code)
begin
	if write_code = '1' then
	case select_code is
		when "000000" => p0code_ok <= code_ok; p0code_detect <= code_detect;
		when "000001" => p1code_ok <= code_ok; p1code_detect <= code_detect;
		when "000010" => p2code_ok <= code_ok; p2code_detect <= code_detect;
		when "000011" => p3code_ok <= code_ok; p3code_detect <= code_detect;
		when "000100" => p4code_ok <= code_ok; p4code_detect <= code_detect;
		when "000101" => p5code_ok <= code_ok; p5code_detect <= code_detect;
		when "000110" => p6code_ok <= code_ok; p6code_detect <= code_detect;
		when "000111" => p7code_ok <= code_ok; p7code_detect <= code_detect;
		when "001000" => p8code_ok <= code_ok; p8code_detect <= code_detect;
		when "001001" => p9code_ok <= code_ok; p9code_detect <= code_detect;
		when "001010" => p10code_ok <= code_ok; p10code_detect <= code_detect;
		when "001011" => p11code_ok <= code_ok; p11code_detect <= code_detect;
		when "001100" => p12code_ok <= code_ok; p12code_detect <= code_detect;
		when "001101" => p13code_ok <= code_ok; p13code_detect <= code_detect;
		when "001110" => p14code_ok <= code_ok; p14code_detect <= code_detect;
		when "001111" => p15code_ok <= code_ok; p15code_detect <= code_detect;
		when "010000" => p16code_ok <= code_ok; p16code_detect <= code_detect;
		when "010001" => p17code_ok <= code_ok; p17code_detect <= code_detect;
		when "010010" => p18code_ok <= code_ok; p18code_detect <= code_detect;
		when "010011" => p19code_ok <= code_ok; p19code_detect <= code_detect;
		when "010100" => p20code_ok <= code_ok; p20code_detect <= code_detect;
		when "010101" => p21code_ok <= code_ok; p21code_detect <= code_detect;
		when "010110" => p22code_ok <= code_ok; p22code_detect <= code_detect;
		when "010111" => p23code_ok <= code_ok; p23code_detect <= code_detect;
		when "011000" => p24code_ok <= code_ok; p24code_detect <= code_detect;
		when "011001" => p25code_ok <= code_ok; p25code_detect <= code_detect;
		when "011010" => p26code_ok <= code_ok; p26code_detect <= code_detect;
		when "011011" => p27code_ok <= code_ok; p27code_detect <= code_detect;
		when "011100" => p28code_ok <= code_ok; p28code_detect <= code_detect;
		when "011101" => p29code_ok <= code_ok; p29code_detect <= code_detect;
		when "011110" => p30code_ok <= code_ok; p30code_detect <= code_detect;
		when "011111" => p31code_ok <= code_ok; p31code_detect <= code_detect;
		when "100000" => p32code_ok <= code_ok; p32code_detect <= code_detect;
		when "100001" => p33code_ok <= code_ok; p33code_detect <= code_detect;
		when "100010" => p34code_ok <= code_ok; p34code_detect <= code_detect;
		when "100011" => p35code_ok <= code_ok; p35code_detect <= code_detect;
		when "100100" => p36code_ok <= code_ok; p36code_detect <= code_detect;
		when "100101" => p37code_ok <= code_ok; p37code_detect <= code_detect;
		when "100110" => p38code_ok <= code_ok; p38code_detect <= code_detect;
		when "100111" => p39code_ok <= code_ok; p39code_detect <= code_detect;
		when "101000" => p40code_ok <= code_ok; p40code_detect <= code_detect;
		when "101001" => p41code_ok <= code_ok; p41code_detect <= code_detect;
		when "101010" => p42code_ok <= code_ok; p42code_detect <= code_detect;
		when "101011" => p43code_ok <= code_ok; p43code_detect <= code_detect;
		when "101100" => p44code_ok <= code_ok; p44code_detect <= code_detect;
		when "101101" => p45code_ok <= code_ok; p45code_detect <= code_detect;
		when "101110" => p46code_ok <= code_ok; p46code_detect <= code_detect;
		when "101111" => p47code_ok <= code_ok; p47code_detect <= code_detect;
		when "110000" => p48code_ok <= code_ok; p48code_detect <= code_detect;
		when "110001" => p49code_ok <= code_ok; p49code_detect <= code_detect;
		when "110010" => p50code_ok <= code_ok; p50code_detect <= code_detect;
		when "110011" => p51code_ok <= code_ok; p51code_detect <= code_detect;
		when "110100" => p52code_ok <= code_ok; p52code_detect <= code_detect;
		when "110101" => p53code_ok <= code_ok; p53code_detect <= code_detect;
		when "110110" => p54code_ok <= code_ok; p54code_detect <= code_detect;
		when "110111" => p55code_ok <= code_ok; p55code_detect <= code_detect;
		when "111000" => p56code_ok <= code_ok; p56code_detect <= code_detect;
		when "111001" => p57code_ok <= code_ok; p57code_detect <= code_detect;
		--when "111010" => p58code_ok <= code_ok; p58code_detect <= code_detect;
		when others => null;
	end case;
	end if;
end process;

p0_palet : palet
	PORT MAP
	(
		cpt_line => p0line_in,
		cpt_row => p0row_in,
		cpt_row_out => p1row_in,
		cpt_line_out => p1line_in,
		code_out => p1code_in,
		code_in => p0code_in,
		choix => choixdata,
		donnee => p0donnee,
		en_win => p0en_win,
		so_win => p1en_win,
		blank_in => p0blank_in,
		burst_in => p0burst_in,
		sync_in => p0sync_in,
		blank_out => p1blank_in,
		burst_out => p1burst_in,
		sync_out => p1sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p0code_detect,
		code_ok => p0code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p1_palet : palet
	PORT MAP
	(
		cpt_line => p1line_in,
		cpt_row => p1row_in,
		cpt_row_out => p2row_in,
		cpt_line_out => p2line_in,
		code_out => p2code_in,
		code_in => p1code_in,
		choix => choixdata,
		donnee => p1donnee,
		en_win => p1en_win,
		so_win => p2en_win,
		blank_in => p1blank_in,
		burst_in => p1burst_in,
		sync_in => p1sync_in,
		blank_out => p2blank_in,
		burst_out => p2burst_in,
		sync_out => p2sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p1code_detect,
		code_ok => p1code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p2_palet : palet
	PORT MAP
	(
		cpt_line => p2line_in,
		cpt_row => p2row_in,
		cpt_row_out => p3row_in,
		cpt_line_out => p3line_in,
		code_out => p3code_in,
		code_in => p2code_in,
		choix => choixdata,
		donnee => p2donnee,
		en_win => p2en_win,
		so_win => p3en_win,
		blank_in => p2blank_in,
		burst_in => p2burst_in,
		sync_in => p2sync_in,
		blank_out => p3blank_in,
		burst_out => p3burst_in,
		sync_out => p3sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p2code_detect,
		code_ok => p2code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p3_palet : palet
	PORT MAP
	(
		cpt_line => p3line_in,
		cpt_row => p3row_in,
		cpt_row_out => p4row_in,
		cpt_line_out => p4line_in,
		code_out => p4code_in,
		code_in => p3code_in,
		choix => choixdata,
		donnee => p3donnee,
		en_win => p3en_win,
		so_win => p4en_win,
		blank_in => p3blank_in,
		burst_in => p3burst_in,
		sync_in => p3sync_in,
		blank_out => p4blank_in,
		burst_out => p4burst_in,
		sync_out => p4sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p3code_detect,
		code_ok => p3code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p4_palet : palet
	PORT MAP
	(
		cpt_line => p4line_in,
		cpt_row => p4row_in,
		cpt_row_out => p5row_in,
		cpt_line_out => p5line_in,
		code_out => p5code_in,
		code_in => p4code_in,
		choix => choixdata,
		donnee => p4donnee,
		en_win => p4en_win,
		so_win => p5en_win,
		blank_in => p4blank_in,
		burst_in => p4burst_in,
		sync_in => p4sync_in,
		blank_out => p5blank_in,
		burst_out => p5burst_in,
		sync_out => p5sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p4code_detect,
		code_ok => p4code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p5_palet : palet
	PORT MAP
	(
		cpt_line => p5line_in,
		cpt_row => p5row_in,
		cpt_row_out => p6row_in,
		cpt_line_out => p6line_in,
		code_out => p6code_in,
		code_in => p5code_in,
		choix => choixdata,
		donnee => p5donnee,
		en_win => p5en_win,
		so_win => p6en_win,
		blank_in => p5blank_in,
		burst_in => p5burst_in,
		sync_in => p5sync_in,
		blank_out => p6blank_in,
		burst_out => p6burst_in,
		sync_out => p6sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p5code_detect,
		code_ok => p5code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p6_palet : palet
	PORT MAP
	(
		cpt_line => p6line_in,
		cpt_row => p6row_in,
		cpt_row_out => p7row_in,
		cpt_line_out => p7line_in,
		code_out => p7code_in,
		code_in => p6code_in,
		choix => choixdata,
		donnee => p6donnee,
		en_win => p6en_win,
		so_win => p7en_win,
		blank_in => p6blank_in,
		burst_in => p6burst_in,
		sync_in => p6sync_in,
		blank_out => p7blank_in,
		burst_out => p7burst_in,
		sync_out => p7sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p6code_detect,
		code_ok => p6code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p7_palet : palet
	PORT MAP
	(
		cpt_line => p7line_in,
		cpt_row => p7row_in,
		cpt_row_out => p8row_in,
		cpt_line_out => p8line_in,
		code_out => p8code_in,
		code_in => p7code_in,
		choix => choixdata,
		donnee => p7donnee,
		en_win => p7en_win,
		so_win => p8en_win,
		blank_in => p7blank_in,
		burst_in => p7burst_in,
		sync_in => p7sync_in,
		blank_out => p8blank_in,
		burst_out => p8burst_in,
		sync_out => p8sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p7code_detect,
		code_ok => p7code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p8_palet : palet
	PORT MAP
	(
		cpt_line => p8line_in,
		cpt_row => p8row_in,
		cpt_row_out => p9row_in,
		cpt_line_out => p9line_in,
		code_out => p9code_in,
		code_in => p8code_in,
		choix => choixdata,
		donnee => p8donnee,
		en_win => p8en_win,
		so_win => p9en_win,
		blank_in => p8blank_in,
		burst_in => p8burst_in,
		sync_in => p8sync_in,
		blank_out => p9blank_in,
		burst_out => p9burst_in,
		sync_out => p9sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p8code_detect,
		code_ok => p8code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p9_palet : palet
	PORT MAP
	(
		cpt_line => p9line_in,
		cpt_row => p9row_in,
		cpt_row_out => p10row_in,
		cpt_line_out => p10line_in,
		code_out => p10code_in,
		code_in => p9code_in,
		choix => choixdata,
		donnee => p9donnee,
		en_win => p9en_win,
		so_win => p10en_win,
		blank_in => p9blank_in,
		burst_in => p9burst_in,
		sync_in => p9sync_in,
		blank_out => p10blank_in,
		burst_out => p10burst_in,
		sync_out => p10sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p9code_detect,
		code_ok => p9code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p10_palet : palet
	PORT MAP
	(
		cpt_line => p10line_in,
		cpt_row => p10row_in,
		cpt_row_out => p11row_in,
		cpt_line_out => p11line_in,
		code_out => p11code_in,
		code_in => p10code_in,
		choix => choixdata,
		donnee => p10donnee,
		en_win => p10en_win,
		so_win => p11en_win,
		blank_in => p10blank_in,
		burst_in => p10burst_in,
		sync_in => p10sync_in,
		blank_out => p11blank_in,
		burst_out => p11burst_in,
		sync_out => p11sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p10code_detect,
		code_ok => p10code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p11_palet : palet
	PORT MAP
	(
		cpt_line => p11line_in,
		cpt_row => p11row_in,
		cpt_row_out => p12row_in,
		cpt_line_out => p12line_in,
		code_out => p12code_in,
		code_in => p11code_in,
		choix => choixdata,
		donnee => p11donnee,
		en_win => p11en_win,
		so_win => p12en_win,
		blank_in => p11blank_in,
		burst_in => p11burst_in,
		sync_in => p11sync_in,
		blank_out => p12blank_in,
		burst_out => p12burst_in,
		sync_out => p12sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p11code_detect,
		code_ok => p11code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p12_palet : palet
	PORT MAP
	(
		cpt_line => p12line_in,
		cpt_row => p12row_in,
		cpt_row_out => p13row_in,
		cpt_line_out => p13line_in,
		code_out => p13code_in,
		code_in => p12code_in,
		choix => choixdata,
		donnee => p12donnee,
		en_win => p12en_win,
		so_win => p13en_win,
		blank_in => p12blank_in,
		burst_in => p12burst_in,
		sync_in => p12sync_in,
		blank_out => p13blank_in,
		burst_out => p13burst_in,
		sync_out => p13sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p12code_detect,
		code_ok => p12code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p13_palet : palet
	PORT MAP
	(
		cpt_line => p13line_in,
		cpt_row => p13row_in,
		cpt_row_out => p14row_in,
		cpt_line_out => p14line_in,
		code_out => p14code_in,
		code_in => p13code_in,
		choix => choixdata,
		donnee => p13donnee,
		en_win => p13en_win,
		so_win => p14en_win,
		blank_in => p13blank_in,
		burst_in => p13burst_in,
		sync_in => p13sync_in,
		blank_out => p14blank_in,
		burst_out => p14burst_in,
		sync_out => p14sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p13code_detect,
		code_ok => p13code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p14_palet : palet
	PORT MAP
	(
		cpt_line => p14line_in,
		cpt_row => p14row_in,
		cpt_row_out => p15row_in,
		cpt_line_out => p15line_in,
		code_out => p15code_in,
		code_in => p14code_in,
		choix => choixdata,
		donnee => p14donnee,
		en_win => p14en_win,
		so_win => p15en_win,
		blank_in => p14blank_in,
		burst_in => p14burst_in,
		sync_in => p14sync_in,
		blank_out => p15blank_in,
		burst_out => p15burst_in,
		sync_out => p15sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p14code_detect,
		code_ok => p14code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p15_palet : palet
	PORT MAP
	(
		cpt_line => p15line_in,
		cpt_row => p15row_in,
		cpt_row_out => p16row_in,
		cpt_line_out => p16line_in,
		code_out => p16code_in,
		code_in => p15code_in,
		choix => choixdata,
		donnee => p15donnee,
		en_win => p15en_win,
		so_win => p16en_win,
		blank_in => p15blank_in,
		burst_in => p15burst_in,
		sync_in => p15sync_in,
		blank_out => p16blank_in,
		burst_out => p16burst_in,
		sync_out => p16sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p15code_detect,
		code_ok => p15code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p16_palet : palet
	PORT MAP
	(
		cpt_line => p16line_in,
		cpt_row => p16row_in,
		cpt_row_out => p17row_in,
		cpt_line_out => p17line_in,
		code_out => p17code_in,
		code_in => p16code_in,
		choix => choixdata,
		donnee => p16donnee,
		en_win => p16en_win,
		so_win => p17en_win,
		blank_in => p16blank_in,
		burst_in => p16burst_in,
		sync_in => p16sync_in,
		blank_out => p17blank_in,
		burst_out => p17burst_in,
		sync_out => p17sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p16code_detect,
		code_ok => p16code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p17_palet : palet
	PORT MAP
	(
		cpt_line => p17line_in,
		cpt_row => p17row_in,
		cpt_row_out => p18row_in,
		cpt_line_out => p18line_in,
		code_out => p18code_in,
		code_in => p17code_in,
		choix => choixdata,
		donnee => p17donnee,
		en_win => p17en_win,
		so_win => p18en_win,
		blank_in => p17blank_in,
		burst_in => p17burst_in,
		sync_in => p17sync_in,
		blank_out => p18blank_in,
		burst_out => p18burst_in,
		sync_out => p18sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p17code_detect,
		code_ok => p17code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p18_palet : palet
	PORT MAP
	(
		cpt_line => p18line_in,
		cpt_row => p18row_in,
		cpt_row_out => p19row_in,
		cpt_line_out => p19line_in,
		code_out => p19code_in,
		code_in => p18code_in,
		choix => choixdata,
		donnee => p18donnee,
		en_win => p18en_win,
		so_win => p19en_win,
		blank_in => p18blank_in,
		burst_in => p18burst_in,
		sync_in => p18sync_in,
		blank_out => p19blank_in,
		burst_out => p19burst_in,
		sync_out => p19sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p18code_detect,
		code_ok => p18code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p19_palet : palet
	PORT MAP
	(
		cpt_line => p19line_in,
		cpt_row => p19row_in,
		cpt_row_out => p20row_in,
		cpt_line_out => p20line_in,
		code_out => p20code_in,
		code_in => p19code_in,
		choix => choixdata,
		donnee => p19donnee,
		en_win => p19en_win,
		so_win => p20en_win,
		blank_in => p19blank_in,
		burst_in => p19burst_in,
		sync_in => p19sync_in,
		blank_out => p20blank_in,
		burst_out => p20burst_in,
		sync_out => p20sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p19code_detect,
		code_ok => p19code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p20_palet : palet
	PORT MAP
	(
		cpt_line => p20line_in,
		cpt_row => p20row_in,
		cpt_row_out => p21row_in,
		cpt_line_out => p21line_in,
		code_out => p21code_in,
		code_in => p20code_in,
		choix => choixdata,
		donnee => p20donnee,
		en_win => p20en_win,
		so_win => p21en_win,
		blank_in => p20blank_in,
		burst_in => p20burst_in,
		sync_in => p20sync_in,
		blank_out => p21blank_in,
		burst_out => p21burst_in,
		sync_out => p21sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p20code_detect,
		code_ok => p20code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p21_palet : palet
	PORT MAP
	(
		cpt_line => p21line_in,
		cpt_row => p21row_in,
		cpt_row_out => p22row_in,
		cpt_line_out => p22line_in,
		code_out => p22code_in,
		code_in => p21code_in,
		choix => choixdata,
		donnee => p21donnee,
		en_win => p21en_win,
		so_win => p22en_win,
		blank_in => p21blank_in,
		burst_in => p21burst_in,
		sync_in => p21sync_in,
		blank_out => p22blank_in,
		burst_out => p22burst_in,
		sync_out => p22sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p21code_detect,
		code_ok => p21code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p22_palet : palet
	PORT MAP
	(
		cpt_line => p22line_in,
		cpt_row => p22row_in,
		cpt_row_out => p23row_in,
		cpt_line_out => p23line_in,
		code_out => p23code_in,
		code_in => p22code_in,
		choix => choixdata,
		donnee => p22donnee,
		en_win => p22en_win,
		so_win => p23en_win,
		blank_in => p22blank_in,
		burst_in => p22burst_in,
		sync_in => p22sync_in,
		blank_out => p23blank_in,
		burst_out => p23burst_in,
		sync_out => p23sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p22code_detect,
		code_ok => p22code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p23_palet : palet
	PORT MAP
	(
		cpt_line => p23line_in,
		cpt_row => p23row_in,
		cpt_row_out => p24row_in,
		cpt_line_out => p24line_in,
		code_out => p24code_in,
		code_in => p23code_in,
		choix => choixdata,
		donnee => p23donnee,
		en_win => p23en_win,
		so_win => p24en_win,
		blank_in => p23blank_in,
		burst_in => p23burst_in,
		sync_in => p23sync_in,
		blank_out => p24blank_in,
		burst_out => p24burst_in,
		sync_out => p24sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p23code_detect,
		code_ok => p23code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p24_palet : palet
	PORT MAP
	(
		cpt_line => p24line_in,
		cpt_row => p24row_in,
		cpt_row_out => p25row_in,
		cpt_line_out => p25line_in,
		code_out => p25code_in,
		code_in => p24code_in,
		choix => choixdata,
		donnee => p24donnee,
		en_win => p24en_win,
		so_win => p25en_win,
		blank_in => p24blank_in,
		burst_in => p24burst_in,
		sync_in => p24sync_in,
		blank_out => p25blank_in,
		burst_out => p25burst_in,
		sync_out => p25sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p24code_detect,
		code_ok => p24code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p25_palet : palet
	PORT MAP
	(
		cpt_line => p25line_in,
		cpt_row => p25row_in,
		cpt_row_out => p26row_in,
		cpt_line_out => p26line_in,
		code_out => p26code_in,
		code_in => p25code_in,
		choix => choixdata,
		donnee => p25donnee,
		en_win => p25en_win,
		so_win => p26en_win,
		blank_in => p25blank_in,
		burst_in => p25burst_in,
		sync_in => p25sync_in,
		blank_out => p26blank_in,
		burst_out => p26burst_in,
		sync_out => p26sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p25code_detect,
		code_ok => p25code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p26_palet : palet
	PORT MAP
	(
		cpt_line => p26line_in,
		cpt_row => p26row_in,
		cpt_row_out => p27row_in,
		cpt_line_out => p27line_in,
		code_out => p27code_in,
		code_in => p26code_in,
		choix => choixdata,
		donnee => p26donnee,
		en_win => p26en_win,
		so_win => p27en_win,
		blank_in => p26blank_in,
		burst_in => p26burst_in,
		sync_in => p26sync_in,
		blank_out => p27blank_in,
		burst_out => p27burst_in,
		sync_out => p27sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p26code_detect,
		code_ok => p26code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p27_palet : palet
	PORT MAP
	(
		cpt_line => p27line_in,
		cpt_row => p27row_in,
		cpt_row_out => p28row_in,
		cpt_line_out => p28line_in,
		code_out => p28code_in,
		code_in => p27code_in,
		choix => choixdata,
		donnee => p27donnee,
		en_win => p27en_win,
		so_win => p28en_win,
		blank_in => p27blank_in,
		burst_in => p27burst_in,
		sync_in => p27sync_in,
		blank_out => p28blank_in,
		burst_out => p28burst_in,
		sync_out => p28sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p27code_detect,
		code_ok => p27code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p28_palet : palet
	PORT MAP
	(
		cpt_line => p28line_in,
		cpt_row => p28row_in,
		cpt_row_out => p29row_in,
		cpt_line_out => p29line_in,
		code_out => p29code_in,
		code_in => p28code_in,
		choix => choixdata,
		donnee => p28donnee,
		en_win => p28en_win,
		so_win => p29en_win,
		blank_in => p28blank_in,
		burst_in => p28burst_in,
		sync_in => p28sync_in,
		blank_out => p29blank_in,
		burst_out => p29burst_in,
		sync_out => p29sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p28code_detect,
		code_ok => p28code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p29_palet : palet
	PORT MAP
	(
		cpt_line => p29line_in,
		cpt_row => p29row_in,
		cpt_row_out => p30row_in,
		cpt_line_out => p30line_in,
		code_out => p30code_in,
		code_in => p29code_in,
		choix => choixdata,
		donnee => p29donnee,
		en_win => p29en_win,
		so_win => p30en_win,
		blank_in => p29blank_in,
		burst_in => p29burst_in,
		sync_in => p29sync_in,
		blank_out => p30blank_in,
		burst_out => p30burst_in,
		sync_out => p30sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p29code_detect,
		code_ok => p29code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p30_palet : palet
	PORT MAP
	(
		cpt_line => p30line_in,
		cpt_row => p30row_in,
		cpt_row_out => p31row_in,
		cpt_line_out => p31line_in,
		code_out => p31code_in,
		code_in => p30code_in,
		choix => choixdata,
		donnee => p30donnee,
		en_win => p30en_win,
		so_win => p31en_win,
		blank_in => p30blank_in,
		burst_in => p30burst_in,
		sync_in => p30sync_in,
		blank_out => p31blank_in,
		burst_out => p31burst_in,
		sync_out => p31sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p30code_detect,
		code_ok => p30code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p31_palet : palet
	PORT MAP
	(
		cpt_line => p31line_in,
		cpt_row => p31row_in,
		cpt_row_out => p32row_in,
		cpt_line_out => p32line_in,
		code_out => p32code_in,
		code_in => p31code_in,
		choix => choixdata,
		donnee => p31donnee,
		en_win => p31en_win,
		so_win => p32en_win,
		blank_in => p31blank_in,
		burst_in => p31burst_in,
		sync_in => p31sync_in,
		blank_out => p32blank_in,
		burst_out => p32burst_in,
		sync_out => p32sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p31code_detect,
		code_ok => p31code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p32_palet : palet
	PORT MAP
	(
		cpt_line => p32line_in,
		cpt_row => p32row_in,
		cpt_row_out => p33row_in,
		cpt_line_out => p33line_in,
		code_out => p33code_in,
		code_in => p32code_in,
		choix => choixdata,
		donnee => p32donnee,
		en_win => p32en_win,
		so_win => p33en_win,
		blank_in => p32blank_in,
		burst_in => p32burst_in,
		sync_in => p32sync_in,
		blank_out => p33blank_in,
		burst_out => p33burst_in,
		sync_out => p33sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p32code_detect,
		code_ok => p32code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p33_palet : palet
	PORT MAP
	(
		cpt_line => p33line_in,
		cpt_row => p33row_in,
		cpt_row_out => p34row_in,
		cpt_line_out => p34line_in,
		code_out => p34code_in,
		code_in => p33code_in,
		choix => choixdata,
		donnee => p33donnee,
		en_win => p33en_win,
		so_win => p34en_win,
		blank_in => p33blank_in,
		burst_in => p33burst_in,
		sync_in => p33sync_in,
		blank_out => p34blank_in,
		burst_out => p34burst_in,
		sync_out => p34sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p33code_detect,
		code_ok => p33code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p34_palet : palet
	PORT MAP
	(
		cpt_line => p34line_in,
		cpt_row => p34row_in,
		cpt_row_out => p35row_in,
		cpt_line_out => p35line_in,
		code_out => p35code_in,
		code_in => p34code_in,
		choix => choixdata,
		donnee => p34donnee,
		en_win => p34en_win,
		so_win => p35en_win,
		blank_in => p34blank_in,
		burst_in => p34burst_in,
		sync_in => p34sync_in,
		blank_out => p35blank_in,
		burst_out => p35burst_in,
		sync_out => p35sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p34code_detect,
		code_ok => p34code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p35_palet : palet
	PORT MAP
	(
		cpt_line => p35line_in,
		cpt_row => p35row_in,
		cpt_row_out => p36row_in,
		cpt_line_out => p36line_in,
		code_out => p36code_in,
		code_in => p35code_in,
		choix => choixdata,
		donnee => p35donnee,
		en_win => p35en_win,
		so_win => p36en_win,
		blank_in => p35blank_in,
		burst_in => p35burst_in,
		sync_in => p35sync_in,
		blank_out => p36blank_in,
		burst_out => p36burst_in,
		sync_out => p36sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p35code_detect,
		code_ok => p35code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p36_palet : palet
	PORT MAP
	(
		cpt_line => p36line_in,
		cpt_row => p36row_in,
		cpt_row_out => p37row_in,
		cpt_line_out => p37line_in,
		code_out => p37code_in,
		code_in => p36code_in,
		choix => choixdata,
		donnee => p36donnee,
		en_win => p36en_win,
		so_win => p37en_win,
		blank_in => p36blank_in,
		burst_in => p36burst_in,
		sync_in => p36sync_in,
		blank_out => p37blank_in,
		burst_out => p37burst_in,
		sync_out => p37sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p36code_detect,
		code_ok => p36code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p37_palet : palet
	PORT MAP
	(
		cpt_line => p37line_in,
		cpt_row => p37row_in,
		cpt_row_out => p38row_in,
		cpt_line_out => p38line_in,
		code_out => p38code_in,
		code_in => p37code_in,
		choix => choixdata,
		donnee => p37donnee,
		en_win => p37en_win,
		so_win => p38en_win,
		blank_in => p37blank_in,
		burst_in => p37burst_in,
		sync_in => p37sync_in,
		blank_out => p38blank_in,
		burst_out => p38burst_in,
		sync_out => p38sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p37code_detect,
		code_ok => p37code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p38_palet : palet
	PORT MAP
	(
		cpt_line => p38line_in,
		cpt_row => p38row_in,
		cpt_row_out => p39row_in,
		cpt_line_out => p39line_in,
		code_out => p39code_in,
		code_in => p38code_in,
		choix => choixdata,
		donnee => p38donnee,
		en_win => p38en_win,
		so_win => p39en_win,
		blank_in => p38blank_in,
		burst_in => p38burst_in,
		sync_in => p38sync_in,
		blank_out => p39blank_in,
		burst_out => p39burst_in,
		sync_out => p39sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p38code_detect,
		code_ok => p38code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p39_palet : palet
	PORT MAP
	(
		cpt_line => p39line_in,
		cpt_row => p39row_in,
		cpt_row_out => p40row_in,
		cpt_line_out => p40line_in,
		code_out => p40code_in,
		code_in => p39code_in,
		choix => choixdata,
		donnee => p39donnee,
		en_win => p39en_win,
		so_win => p40en_win,
		blank_in => p39blank_in,
		burst_in => p39burst_in,
		sync_in => p39sync_in,
		blank_out => p40blank_in,
		burst_out => p40burst_in,
		sync_out => p40sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p39code_detect,
		code_ok => p39code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p40_palet : palet
	PORT MAP
	(
		cpt_line => p40line_in,
		cpt_row => p40row_in,
		cpt_row_out => p41row_in,
		cpt_line_out => p41line_in,
		code_out => p41code_in,
		code_in => p40code_in,
		choix => choixdata,
		donnee => p40donnee,
		en_win => p40en_win,
		so_win => p41en_win,
		blank_in => p40blank_in,
		burst_in => p40burst_in,
		sync_in => p40sync_in,
		blank_out => p41blank_in,
		burst_out => p41burst_in,
		sync_out => p41sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p40code_detect,
		code_ok => p40code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p41_palet : palet
	PORT MAP
	(
		cpt_line => p41line_in,
		cpt_row => p41row_in,
		cpt_row_out => p42row_in,
		cpt_line_out => p42line_in,
		code_out => p42code_in,
		code_in => p41code_in,
		choix => choixdata,
		donnee => p41donnee,
		en_win => p41en_win,
		so_win => p42en_win,
		blank_in => p41blank_in,
		burst_in => p41burst_in,
		sync_in => p41sync_in,
		blank_out => p42blank_in,
		burst_out => p42burst_in,
		sync_out => p42sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p41code_detect,
		code_ok => p41code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p42_palet : palet
	PORT MAP
	(
		cpt_line => p42line_in,
		cpt_row => p42row_in,
		cpt_row_out => p43row_in,
		cpt_line_out => p43line_in,
		code_out => p43code_in,
		code_in => p42code_in,
		choix => choixdata,
		donnee => p42donnee,
		en_win => p42en_win,
		so_win => p43en_win,
		blank_in => p42blank_in,
		burst_in => p42burst_in,
		sync_in => p42sync_in,
		blank_out => p43blank_in,
		burst_out => p43burst_in,
		sync_out => p43sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p42code_detect,
		code_ok => p42code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p43_palet : palet
	PORT MAP
	(
		cpt_line => p43line_in,
		cpt_row => p43row_in,
		cpt_row_out => p44row_in,
		cpt_line_out => p44line_in,
		code_out => p44code_in,
		code_in => p43code_in,
		choix => choixdata,
		donnee => p43donnee,
		en_win => p43en_win,
		so_win => p44en_win,
		blank_in => p43blank_in,
		burst_in => p43burst_in,
		sync_in => p43sync_in,
		blank_out => p44blank_in,
		burst_out => p44burst_in,
		sync_out => p44sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p43code_detect,
		code_ok => p43code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p44_palet : palet
	PORT MAP
	(
		cpt_line => p44line_in,
		cpt_row => p44row_in,
		cpt_row_out => p45row_in,
		cpt_line_out => p45line_in,
		code_out => p45code_in,
		code_in => p44code_in,
		choix => choixdata,
		donnee => p44donnee,
		en_win => p44en_win,
		so_win => p45en_win,
		blank_in => p44blank_in,
		burst_in => p44burst_in,
		sync_in => p44sync_in,
		blank_out => p45blank_in,
		burst_out => p45burst_in,
		sync_out => p45sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p44code_detect,
		code_ok => p44code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p45_palet : palet
	PORT MAP
	(
		cpt_line => p45line_in,
		cpt_row => p45row_in,
		cpt_row_out => p46row_in,
		cpt_line_out => p46line_in,
		code_out => p46code_in,
		code_in => p45code_in,
		choix => choixdata,
		donnee => p45donnee,
		en_win => p45en_win,
		so_win => p46en_win,
		blank_in => p45blank_in,
		burst_in => p45burst_in,
		sync_in => p45sync_in,
		blank_out => p46blank_in,
		burst_out => p46burst_in,
		sync_out => p46sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p45code_detect,
		code_ok => p45code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p46_palet : palet
	PORT MAP
	(
		cpt_line => p46line_in,
		cpt_row => p46row_in,
		cpt_row_out => p47row_in,
		cpt_line_out => p47line_in,
		code_out => p47code_in,
		code_in => p46code_in,
		choix => choixdata,
		donnee => p46donnee,
		en_win => p46en_win,
		so_win => p47en_win,
		blank_in => p46blank_in,
		burst_in => p46burst_in,
		sync_in => p46sync_in,
		blank_out => p47blank_in,
		burst_out => p47burst_in,
		sync_out => p47sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p46code_detect,
		code_ok => p46code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p47_palet : palet
	PORT MAP
	(
		cpt_line => p47line_in,
		cpt_row => p47row_in,
		cpt_row_out => p48row_in,
		cpt_line_out => p48line_in,
		code_out => p48code_in,
		code_in => p47code_in,
		choix => choixdata,
		donnee => p47donnee,
		en_win => p47en_win,
		so_win => p48en_win,
		blank_in => p47blank_in,
		burst_in => p47burst_in,
		sync_in => p47sync_in,
		blank_out => p48blank_in,
		burst_out => p48burst_in,
		sync_out => p48sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p47code_detect,
		code_ok => p47code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p48_palet : palet
	PORT MAP
	(
		cpt_line => p48line_in,
		cpt_row => p48row_in,
		cpt_row_out => p49row_in,
		cpt_line_out => p49line_in,
		code_out => p49code_in,
		code_in => p48code_in,
		choix => choixdata,
		donnee => p48donnee,
		en_win => p48en_win,
		so_win => p49en_win,
		blank_in => p48blank_in,
		burst_in => p48burst_in,
		sync_in => p48sync_in,
		blank_out => p49blank_in,
		burst_out => p49burst_in,
		sync_out => p49sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p48code_detect,
		code_ok => p48code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p49_palet : palet
	PORT MAP
	(
		cpt_line => p49line_in,
		cpt_row => p49row_in,
		cpt_row_out => p50row_in,
		cpt_line_out => p50line_in,
		code_out => p50code_in,
		code_in => p49code_in,
		choix => choixdata,
		donnee => p49donnee,
		en_win => p49en_win,
		so_win => p50en_win,
		blank_in => p49blank_in,
		burst_in => p49burst_in,
		sync_in => p49sync_in,
		blank_out => p50blank_in,
		burst_out => p50burst_in,
		sync_out => p50sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p49code_detect,
		code_ok => p49code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p50_palet : palet
	PORT MAP
	(
		cpt_line => p50line_in,
		cpt_row => p50row_in,
		cpt_row_out => p51row_in,
		cpt_line_out => p51line_in,
		code_out => p51code_in,
		code_in => p50code_in,
		choix => choixdata,
		donnee => p50donnee,
		en_win => p50en_win,
		so_win => p51en_win,
		blank_in => p50blank_in,
		burst_in => p50burst_in,
		sync_in => p50sync_in,
		blank_out => p51blank_in,
		burst_out => p51burst_in,
		sync_out => p51sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p50code_detect,
		code_ok => p50code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p51_palet : palet
	PORT MAP
	(
		cpt_line => p51line_in,
		cpt_row => p51row_in,
		cpt_row_out => p52row_in,
		cpt_line_out => p52line_in,
		code_out => p52code_in,
		code_in => p51code_in,
		choix => choixdata,
		donnee => p51donnee,
		en_win => p51en_win,
		so_win => p52en_win,
		blank_in => p51blank_in,
		burst_in => p51burst_in,
		sync_in => p51sync_in,
		blank_out => p52blank_in,
		burst_out => p52burst_in,
		sync_out => p52sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p51code_detect,
		code_ok => p51code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p52_palet : palet
	PORT MAP
	(
		cpt_line => p52line_in,
		cpt_row => p52row_in,
		cpt_row_out => p53row_in,
		cpt_line_out => p53line_in,
		code_out => p53code_in,
		code_in => p52code_in,
		choix => choixdata,
		donnee => p52donnee,
		en_win => p52en_win,
		so_win => p53en_win,
		blank_in => p52blank_in,
		burst_in => p52burst_in,
		sync_in => p52sync_in,
		blank_out => p53blank_in,
		burst_out => p53burst_in,
		sync_out => p53sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p52code_detect,
		code_ok => p52code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p53_palet : palet
	PORT MAP
	(
		cpt_line => p53line_in,
		cpt_row => p53row_in,
		cpt_row_out => p54row_in,
		cpt_line_out => p54line_in,
		code_out => p54code_in,
		code_in => p53code_in,
		choix => choixdata,
		donnee => p53donnee,
		en_win => p53en_win,
		so_win => p54en_win,
		blank_in => p53blank_in,
		burst_in => p53burst_in,
		sync_in => p53sync_in,
		blank_out => p54blank_in,
		burst_out => p54burst_in,
		sync_out => p54sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p53code_detect,
		code_ok => p53code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p54_palet : palet
	PORT MAP
	(
		cpt_line => p54line_in,
		cpt_row => p54row_in,
		cpt_row_out => p55row_in,
		cpt_line_out => p55line_in,
		code_out => p55code_in,
		code_in => p54code_in,
		choix => choixdata,
		donnee => p54donnee,
		en_win => p54en_win,
		so_win => p55en_win,
		blank_in => p54blank_in,
		burst_in => p54burst_in,
		sync_in => p54sync_in,
		blank_out => p55blank_in,
		burst_out => p55burst_in,
		sync_out => p55sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p54code_detect,
		code_ok => p54code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p55_palet : palet
	PORT MAP
	(
		cpt_line => p55line_in,
		cpt_row => p55row_in,
		cpt_row_out => p56row_in,
		cpt_line_out => p56line_in,
		code_out => p56code_in,
		code_in => p55code_in,
		choix => choixdata,
		donnee => p55donnee,
		en_win => p55en_win,
		so_win => p56en_win,
		blank_in => p55blank_in,
		burst_in => p55burst_in,
		sync_in => p55sync_in,
		blank_out => p56blank_in,
		burst_out => p56burst_in,
		sync_out => p56sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p55code_detect,
		code_ok => p55code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p56_palet : palet
	PORT MAP
	(
		cpt_line => p56line_in,
		cpt_row => p56row_in,
		cpt_row_out => p57row_in,
		cpt_line_out => p57line_in,
		code_out => p57code_in,
		code_in => p56code_in,
		choix => choixdata,
		donnee => p56donnee,
		en_win => p56en_win,
		so_win => p57en_win,
		blank_in => p56blank_in,
		burst_in => p56burst_in,
		sync_in => p56sync_in,
		blank_out => p57blank_in,
		burst_out => p57burst_in,
		sync_out => p57sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p56code_detect,
		code_ok => p56code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);
p57_palet : palet
	PORT MAP
	(
		cpt_line => p57line_in,
		cpt_row => p57row_in,
		cpt_row_out => p58row_in,
		cpt_line_out => p58line_in,
		code_out => p58code_in,
		code_in => p57code_in,
		choix => choixdata,
		donnee => p57donnee,
		en_win => p57en_win,
		so_win => p58en_win,
		blank_in => p57blank_in,
		burst_in => p57burst_in,
		sync_in => p57sync_in,
		blank_out => p58blank_in,
		burst_out => p58burst_in,
		sync_out => p58sync_in,
		reset_n => reset_n,
		clock => clock,
		code_detect => p57code_detect,
		code_ok => p57code_ok,
		seuilpixel => seuilpixel,
		seuilligne => seuilligne
	);

END a;
