Domanda

Sto cercando di implementare un file Accumulatore firmato Utilizzando la gen Core in Xilinx. Secondo la mia comprensione, un accumulatore svolge la funzione di un registro normale che sta solo instradando l'input all'output, ma volevo chiarimenti su questo.

Ho aggiunto il modulo Accumulator IPCORE (.xCO) al progetto e ho un file principale che contiene sostanzialmente la dichiarazione dei componenti e la mappa della porta. Ho anche un processo a passo singolo. Tutto si compila e posso vedere il risultato sul tabellone ma non capisco bene cosa stia succedendo ...

Quando inserisco 1000 L'output a 8 bit sui LED è 11111000. Un altro input di 1111 mi da 11110111. Sto allegando il codice qui per il file VHD principale chiamato Accm e il .vho file.

----------------------------------------------------------------------------------

----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity Accm is
port( b: in std_logic_vector(3 downto 0);
        sclr, clk, b1, b2 : in std_logic;
        q : out std_logic_vector(7 downto 0)
);      

end Accm;

architecture Behavioral of Accm is

-- signal declaration
type tell is (rdy,pulse,not_rdy);
signal d_n_s: tell; 
signal en: std_logic;

-- component declaration
COMPONENT my_accm
  PORT (
    b : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
    clk : IN STD_LOGIC;
    sclr : IN STD_LOGIC;
    q : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
  );
END COMPONENT;

-- port map
begin

A1 : my_accm
  PORT MAP (
    b => b,
    clk => en,
    sclr => sclr,
    q => q
  );

process(clk)
begin
if clk'event and clk='1' then
case d_n_s is
when rdy => en <= '0';
if b1='1' then d_n_s <= pulse; end if;
when pulse => en <= '1';
d_n_s <= not_rdy;
when not_rdy => en <='0';
if b2='1' then d_n_s <= rdy; end if;
end case;
end if;
end process;

-- .VHO CODE

------------- Begin Cut here for COMPONENT Declaration ------ COMP_TAG
COMPONENT my_accm
  PORT (
    b : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
    clk : IN STD_LOGIC;
    sclr : IN STD_LOGIC;
    q : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
  );
END COMPONENT;
-- COMP_TAG_END ------ End COMPONENT Declaration ------------

-- The following code must appear in the VHDL architecture
-- body. Substitute your own instance name and net names.

------------- Begin Cut here for INSTANTIATION Template ----- INST_TAG
your_instance_name : my_accm
  PORT MAP (
    b => b,
    clk => clk,
    sclr => sclr,
    q => q
  );

end Behavioral;

Sto anche incollando un'immagine dell'accumual che ho generato in Coregen. enter image description here

Lo apprezzerei se qualcuno potesse spiegarmi cosa sta succedendo in questo programma. Grazie!

È stato utile?

Soluzione

"Accumulator" può significare molte cose. Nella libreria Xilinx hardware, il componente che hai istanziato è un adder di fronte a un registro. L'adder sta aggiungendo il valore corrente del registro dell'accumulatore con il termine di input. Il registro Accumulator è più ampio dell'input in modo da poter accumulare (aggiungere insieme) molti termini di input senza traboccare l'output.

Quando si avvia il circuito, l'accumulatore contiene zero. Si inseriscono 1000 (-8) che, se aggiunto a zero, diventa 11111000 (-8 segno esteso) sull'uscita. Quindi aggiungi 1111 (-1) e l'output diventa 11110111 (-9 segno esteso).

Una volta terminato "accumulare", asserisci SCLR per cancellare il registro dell'accumulatore a zero (o utilizzare SSET o SINIT, a seconda dei casi per la logica).

Tutto ciò dovrebbe essere coperto dalla documentazione per la libreria Xilinx (prova a fare clic sul pulsante "Foglio dati" nella finestra di dialogo Corgen).

Altri suggerimenti

In realtà, penso di averlo capito ora. Si comporta solo come un Adder con input firmati. Penso di avere ragione su questo, ma apprezzerei qualsiasi chiarimento!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top