apprentissage VHDL - Page 3
Discussion fermée
Page 3 sur 3 PremièrePremière 3
Affichage des résultats 61 à 76 sur 76

apprentissage VHDL



  1. #61
    invite369d2cfd

    Re : apprentissage VHDL


    ------

    Nom : image.png
Affichages : 108
Taille : 99,7 Ko est ce que ça répond à votre question?, voila comment ça va se passer

    -----

  2. #62
    jiherve

    Re : apprentissage VHDL

    re
    oui mais il faut que je réfléchisse.
    JR
    l'électronique c'est pas du vaudou!

  3. #63
    invite369d2cfd

    Re : apprentissage VHDL

    oui bien sur
    merci beaucoup

  4. #64
    indri

    Re : apprentissage VHDL

    Oooh l'entrelaceur de la DVB-T....
    J'ai déjà programmé ca: j'ai utilisé des ip registre à décalage!
    Là où va le vent...

  5. #65
    invite369d2cfd

    Re : apprentissage VHDL

    oui c'est ça
    comment puisse je faire?
    SVP aidez moi

  6. #66
    indri

    Re : apprentissage VHDL

    Je l'avais fait tel quel: 1 registre 8bit a décalage (IP d'altera) par ligne (sauf celle sans décalage) dont la taille variait selon la ligne! Un vector 12 bit sevrait de clock pour chaque registre (un bit par registre) et une espèce de multiplexeur en sortie commandé par le même registre 12 bits!
    Le registre 12 bits valait succesivement 00..001 , 00..010 ,00..100,..chaque bit était la clock d'un des registre à décalage!

    Je sais pas si c'est très claire(surement que non ^^).
    Je peux eventuellement retrouvé mon code s'il faut!

    Sinon le paquet de données arrivent comment?
    Là où va le vent...

  7. #67
    invite369d2cfd

    Re : apprentissage VHDL

    oui c'est ça, c'est ce que je cherche à implémenter

  8. #68
    indri

    Re : apprentissage VHDL

    Ca donnait ca! Tout les "shifter" sont des ip d'altera: registre à décalage!

    Code:
    LIBRARY ieee ;
    USE ieee.std_logic_1164.all ;
    USE ieee.std_logic_arith.all ;
    use ieee.std_logic_unsigned.all;
    use ieee.numeric_std.all;
    
    Entity OUTER_INTERLEAVING is
    
    PORT(
    		CLK									: IN STD_LOGIC;
    		reset								: IN STD_LOGIC;
    		test								: out std_logic;
    		test2								: out std_logic;
    		testA								: out std_logic_vector(7 DOWNTO 0);
    		din_ready							: out std_logic;
    		din_valid							: in std_logic;
    		din_data							: in std_logic_vector(7 DOWNTO 0);
    		din_sop								: in std_logic;
    		din_eop								: in std_logic;
    		dout_ready							: in std_logic;
    		dout_valid							: out std_logic;
    		dout_data							: out std_logic_vector(7 DOWNTO 0);
    		dout_sop							: out std_logic;
    		dout_eop							: out std_logic);
    END ENTITY;
    
    ARCHITECTURE behav of OUTER_INTERLEAVING is
    			
    component shifter17 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter34 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter51 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter68 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter85 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter102 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter119 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter136 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter153 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter170 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    component shifter187 IS
    	PORT
    	(
    		aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;
    
    
    type tab is array(11 downto 0) of std_logic_vector(7 downto 0);--tableau de vector des sorties pour simplifier l'écriture
    
    signal clk_vec:std_logic_vector(11 downto 0);
    signal in_reg,out_reg:tab;
    
    begin
    
    --Connexion des Ip registre à décalage
    
     i1:shifter17 port map(not(reset),clk_vec(1),clk,din_data,out_reg(1));-- décalage de 17*1
     i2:shifter34 port map(not(reset),clk_vec(2),clk,din_data,out_reg(2));-- décalage de 17*2
     i3:shifter51 port map(not(reset),clk_vec(3),clk,din_data,out_reg(3));-- décalage de 17*3
     i4:shifter68 port map(not(reset),clk_vec(4),clk,din_data,out_reg(4));-- décalage de 17*4
     i5:shifter85 port map(not(reset),clk_vec(5),clk,din_data,out_reg(5));-- décalage de 17*5
     i6:shifter102 port map(not(reset),clk_vec(6),clk,din_data,out_reg(6));-- décalage de 17*6
     i7:shifter119 port map(not(reset),clk_vec(7),clk,din_data,out_reg(7));-- décalage de 17*7
     i8:shifter136 port map(not(reset),clk_vec(8),clk,din_data,out_reg(8));-- décalage de 17*8
     i9:shifter153 port map(not(reset),clk_vec(9),clk,din_data,out_reg(9));-- décalage de 17*9
     i10:shifter170 port map(not(reset),clk_vec(10),clk,din_data,out_reg(10));-- décalage de 17*10
     i11:shifter187 port map(not(reset),clk_vec(11),clk,din_data,out_reg(11));-- décalage de 17*11
    --remarque: il faut impérativement désactiver la clock quand on ne veut pas écrire dans le registre
    -- car décalage à chaque flanc montant de la clock
    
    
    process(clk)--régistre à décalage de clk_en pour activer succesivement chaque registre à décalage
    begin
    	if rising_edge(clk) then
    		if reset='0' then
    			clk_vec<="000000000001";
    		else
    			
    			if din_valid='1' then
    				clk_vec(11 downto 1)<=clk_vec(10 downto 0);
    				clk_vec(0)<=clk_vec(11);
    				
    			else
    				clk_vec<="000000000001";
    			end if;
    		end if;
    	end if;
    end process;
    
    din_ready<=dout_ready;
    
    --Ecriture dans les registre à décalage ->1 période de retard
    --Buffer des signaux de gestion de flux Avalon
    process(clk)
    begin
    	if rising_edge(clk) then
    		if reset='0' then
    			dout_sop<='0';
    			dout_eop<='0';
    			dout_valid<='0';
    		else
    			dout_sop<=din_sop;
    			dout_eop<=din_eop;
    			dout_valid<=din_valid;
    		end if;
    	end if;
    end process;
    
    process(clk)--Lecture successive de chaque registre
    variable compt:std_logic_vector(3 downto 0);
    begin
    	if rising_edge(clk) then
    		if reset='0' then
    			compt:="0000";
    		else
    			if din_valid='1' then
    					case clk_vec is
    						when "000000000001" =>
    							dout_data<=din_data;
    						when "000000000010" =>
    							dout_data<=out_reg(1);
    						when "000000000100" =>
    							dout_data<=out_reg(2);	
    						when "000000001000" =>
    							dout_data<=out_reg(3);
    						when "000000010000" =>
    							dout_data<=out_reg(4);
    						when "000000100000" =>
    							dout_data<=out_reg(5);
    						when "000001000000" =>
    							dout_data<=out_reg(6);
    						when "000010000000" =>
    							dout_data<=out_reg(7);
    						when "000100000000" =>
    							dout_data<=out_reg(8);
    						when "001000000000" =>
    							dout_data<=out_reg(9);
    						when "010000000000" =>
    							dout_data<=out_reg(10);
    						when "100000000000" =>
    							dout_data<=out_reg(11);
    						when others => null;
    					end case;
    					if compt="1011" then
    						compt:="0000";
    					else
    						compt:=compt+1;
    					end if;
    			else
    				compt:="0000";
    			end if;
    		end if;
    	end if;
    end process;	
    
    
    			
    end behav;
    Là où va le vent...

  9. #69
    invite369d2cfd

    Re : apprentissage VHDL

    SVP ce bloc sert à quoi parce que ça manque un peu de commentaire et d'annotation
    Code:
    process(clk)
    begin
    	if rising_edge(clk) then
    		if reset='0' then
    			dout_sop<='0';
    			dout_eop<='0';
    			dout_valid<='0';
    		else
    			dout_sop<=din_sop;
    			dout_eop<=din_eop;
    			dout_valid<=din_valid;
    		end if;
    	end if;
    end process;

  10. #70
    indri

    Re : apprentissage VHDL

    synchro des signaux de commandes entrées/sorties du protocole de communication avec les blocs amont et aval (à savoir le protocol avalon)...
    En gros tout ce code était une sous-entité dans un design plus complexe...
    Donc c'est pas vraiment utile à la compréhension.

    Désolé de ne pas avoir commenté assez, prochaine fois que je donnerais un code gratos, je passerais une heure de plus à le recommenter!
    Là où va le vent...

  11. #71
    invite369d2cfd

    Re : apprentissage VHDL

    je vous remercie infinement pour votre aide
    SVP j'ai pas compris comment se fait le décalage ici
    Code:
     i1:shifter17 port map(not(reset),clk_vec(1),clk,din_data,out_reg(1));-- décalage de 17*1
     i2:shifter34 port map(not(reset),clk_vec(2),clk,din_data,out_reg(2));-- décalage de 17*2
     i3:shifter51 port map(not(reset),clk_vec(3),clk,din_data,out_reg(3));-- décalage de 17*3
     i4:shifter68 port map(not(reset),clk_vec(4),clk,din_data,out_reg(4));-- décalage de 17*4

  12. #72
    indri

    Re : apprentissage VHDL

    Tu es chez altera ou chez un autre?
    Ca c'est l' assignation des signaux des sous-entités (ici des ip registre à décalage)
    Là où va le vent...

  13. #73
    invite369d2cfd

    Re : apprentissage VHDL

    SVP j'ai trouvé des erreurs dans le code
    Code:
     i1:shifter17 port map(not(reset),clk_vec(1),clk,din_data,out_reg(1));-- décalage de 17*1
    dans cette ligne il m'affiche l'erreur suivante "use of non gloally static actuel (prefix expression) of formal "aclr" requires VHDL "
    sachant que la déclaration du shifter est
    Code:
    component shifter17 IS
    	PORT
    	(
    	aclr		: IN STD_LOGIC  := '1';
    		clken		: IN STD_LOGIC  := '1';
    		clock		: IN STD_LOGIC ;
    		shiftin		: IN STD_LOGIC_VECTOR (7 DOWNTO 0);
    		shiftout		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
    		taps		: OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
    	);
    END component;

  14. #74
    jiherve

    Re : apprentissage VHDL

    Bonsoir,
    Il faut passer par un signal(bidon) intermédiaire:
    not_reset <= (not reset);
    et hop
    cela vaut pour tous les ports d'entités.
    JR
    l'électronique c'est pas du vaudou!

  15. #75
    invite369d2cfd

    Re : apprentissage VHDL

    SVP cette ligne de code ne fonctionne pas lors de la simulation
    Code:
    dout_data<=out_reg(1);
    voila le bout de code
    Code:
    case clk_vec is
    						when "000000000001" =>
    							dout_data<=din_data;
    						when "000000000010" =>
    							dout_data<=out_reg(1);
    quel est la valeur de out_reg(1) et comment il va le prendre ?
    voila l'instanciation du shifter
    Code:
     i1:shifter17 port map(not_reset,clk_vec(1),clk,din_data,out_reg(1));-- décalage de 17*1

  16. #76
    indri

    Re : apprentissage VHDL

    La sortie du registre à décalage est recopié sur la sortie.

    Mais je t'ai donné le code pour t'inspirer...si tu veux le prendre tel quel, il faut changer les e/s de l'entité(là c'etait une sous-sous-entité ^^), configurer les IP exactement comme je l'ai fait. Bref un peu dur à reprendre tel quel!

    Commence par maitriser un seul registre, puis seulement tu ajoutera le tout...

    Tu peux aussi faire sans utiliser ces ip (je l'avais fait au début avec des tableaux de std_logic_vector) mais ca utilisera bcp d'éléments logiques (avec les ip c'est surtout de la mémoire)
    Là où va le vent...

Page 3 sur 3 PremièrePremière 3

Discussions similaires

  1. apprentissage
    Par invite89f3adc2 dans le forum Logiciel - Software - Open Source
    Réponses: 2
    Dernier message: 30/06/2007, 12h00
  2. Relativité et apprentissage
    Par invite4ef352d8 dans le forum Physique
    Réponses: 18
    Dernier message: 11/10/2006, 19h17
  3. apprentissage
    Par invited2e22de3 dans le forum Biologie
    Réponses: 9
    Dernier message: 16/03/2005, 09h14
  4. l'apprentissage (ou re apprentissage)
    Par invite4b816bc1 dans le forum [ARCHIVE] Philosophie
    Réponses: 1
    Dernier message: 15/01/2005, 17h21
Découvrez nos comparatifs produits sur l'informatique et les technologies.