Documente Academic
Documente Profesional
Documente Cultură
use ieee.std_logic_1164.all;
entity regn is
end regn;
begin
process
begin
Q <= R;
end if;
end process;
end Behavior;
library ieee;
use ieee.std_logic_1164.all;
end shiftr;
begin
begin
end loop;
Q(1) <= w;
end if;
end process;
end Behavior;
library ieee;
use ieee.std_logic_1164.all;
--use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity upcount is
end upcount;
begin
Q <= "00";
else
end if;
end if;
end process;
end Behavior;
library ieee;
use ieee.std_logic_1164.all;
entity dec2to4 is
en : in std_logic;
);
end dec2to4;
begin
process(sel, en)
begin
if(en = '0')then
op <= "0000";
else
if(sel = "00")then
op <= "1000";
elsif(sel = "01")then
op <= "0100";
elsif(sel = "10")then
op <= "0010";
else
op <= "0001";
end if;
end if;
end process;
end behav;
library ieee;
use ieee.std_logic_1164.all;
entity trin is
E : in std_logic;
end trin;
begin
end Behavior;
library ieee;
use ieee.std_logic_1164.all;
package subccts is
component regn -- register
end component;
end component;
E : in std_logic;
end component;
component upcount is
end component;
component dec2to4 is
en : in std_logic;
);
end component;
end subccts;
library ieee;
use ieee.std_logic_1164.all;
--use ieee.std_logic_signed.all;
use ieee.numeric_std.all ;
use work.subccts.all;
entity proc is
Reset, w : in std_logic;
Clock : in std_logic;
end proc;
--begin
-- functionreg : regn generic map (N => 6) port map (Func, FRin, Clock, FuncReg);
-- Done <= ((I(0) or I(1)) and T(1)) or ((I(2) or I(3)) and T(3));
-- Rin(k) <= ((I(0) or I(1)) and T(1) and X(k)) or ((I(2) or I(3)) and T(3) and X(k));
-- Rout(k) <= (I(1) and T(1) and Y(k)) or ((I(2) or I(3)) and ((T(1) and X(k)) or (T(2) and Y(k))));
--
-- --Debug signals
-- debug_T <= T;
-- debug_I <= I;
--end Behavior;
begin
functionreg : regn generic map (N => 6) port map (Func, FRin, Clock, FuncReg);
Done <= ((I(0) or I(1)) and T(1)) or ((I(2) or I(3)) and T(3));
begin
end if ;
end if ;
end process ;
RF_out <= RF( to_integer( unsigned(RF_rd_addr) ) ) ;
else Data ;
else Ry when ( (I(1) and T(1) ) or ((I(2) or I(3)) and T(2)) ) = '1'
RF_wr_addr <= Rx when (((I(0) or I(1)) and T(1)) or ((I(2) or I(3)) and T(3))) = '1'
when (((I(0) or I(1)) and T(1)) or ((I(2) or I(3)) and T(3))) = '1'
else '0' ;
--Debug signals
debug_T <= T;
debug_I <= I;
end RegFileBehavior;
library ieee;
use ieee.std_logic_1164.all;
entity test_proc is
end test_proc;
component proc is
Reset, w : in std_logic;
Clock : in std_logic;
end component;
clk_process: process
begin
varT := varT + 20 ns ;
end process;
process
begin
w <= '1';
F <= "00";
Rx <= "00";
w <= '0';
--Loading data to R1(i.e. Rx)
w <= '1';
F <= "00";
Rx <= "01";
w <= '0';
--Adding R0(i.e Rx) to R1(i.e. Ry) and saving the result to R0(i.e. Rx)
w <= '1';
F <= "10";
Rx <= "00";
Ry <= "01";
w <= '0';
w <= '1';
F <= "01";
Ry <= "00";
Rx <= "11";
w <= '0';
--Substracting R1(i.e. Ry) from R3(i.e. Rx) and storing the result in R3(i.e. Rx)
w <= '1';
F <= "11";
Rx <= "11";
Ry <= "01";
w <= '0';
--Moving the data from R0(i.e. Ry) to R3(i.e. Rx)
w <= '1';
F <= "01";
Ry <= "11";
Rx <= "10";
w <= '0';
wait;
end process;
end behav;