Line 18... |
Line 18... |
|
|
package arithpack is
|
package arithpack is
|
--! Estados para la maquina de estados.
|
--! Estados para la maquina de estados.
|
type macState is (LOAD_INSTRUCTION,FLUSH_ARITH_PIPELINE,EXECUTE_INSTRUCTION);
|
type macState is (LOAD_INSTRUCTION,FLUSH_ARITH_PIPELINE,EXECUTE_INSTRUCTION);
|
--! Estados para el controlador de interrupciones.
|
--! Estados para el controlador de interrupciones.
|
type iCtrlState is (WAITING_FOR_AN_EVENT,FIRING_INTERRUPTIONS,SUSPEND);
|
type iCtrlState is (WAITING_FOR_A_RFULL_EVENT,INHIBIT_RFULL_INT);
|
|
|
--! Float data blocks
|
--! Float data blocks
|
constant floatwidth : integer := 32;
|
constant floatwidth : integer := 32;
|
constant widthadmemblock : integer := 9;
|
constant widthadmemblock : integer := 9;
|
|
|
Line 68... |
Line 68... |
|
|
--! datos de entrada
|
--! datos de entrada
|
d : in std_logic_vector (31 downto 0);
|
d : in std_logic_vector (31 downto 0);
|
|
|
--! Interrupciones
|
--! Interrupciones
|
int : out std_logic_vector (7 downto 0);
|
int : out std_logic;
|
|
|
--! Salidas
|
--! Salidas
|
q : out std_logic_vector (31 downto 0)
|
q : out std_logic_vector (31 downto 0)
|
|
|
|
|
Line 233... |
Line 233... |
num_events : integer ;
|
num_events : integer ;
|
cycles_to_wait : integer
|
cycles_to_wait : integer
|
);
|
);
|
port (
|
port (
|
clk,rst: in std_logic;
|
clk,rst: in std_logic;
|
rfull_events: in std_logic_vector(num_events-1 downto 0); --! full results queue events
|
rfull_event: in std_logic; --! full results queue events
|
eoi_events: in std_logic_vector(num_events-1 downto 0); --! end of instruction related events
|
eoi_event: in std_logic; --! end of instruction related events
|
eoi_int: out std_logic_vector(num_events-1 downto 0);--! end of instruction related interruptions
|
int: out std_logic;
|
rfull_int: out std_logic_vector(num_events-1downto 0); --! full results queue related interruptions
|
|
state: out iCtrlState
|
state: out iCtrlState
|
);
|
);
|
end component;
|
end component;
|
--! Bloque de memorias
|
--! Bloque de memorias
|
component memblock
|
component memblock
|
generic (
|
|
blocksize : integer;
|
|
external_readable_widthad : integer;
|
|
external_writeable_widthad : integer
|
|
);
|
|
port (
|
port (
|
|
|
|
|
clk,rst,dpfifo_rd,normfifo_rd,dpfifo_wr,normfifo_wr : in std_logic;
|
clk,rst,dpfifo_rd,normfifo_rd,dpfifo_wr,normfifo_wr : in std_logic;
|
instrfifo_rd : in std_logic;
|
instrfifo_rd : in std_logic;
|
resultfifo_wr: in std_logic_vector(8-1 downto 0);
|
resultfifo_wr: in std_logic_vector(8-1 downto 0);
|
instrfifo_empty: out std_logic; ext_rd,ext_wr: in std_logic;
|
instrfifo_empty: out std_logic; ext_rd,ext_wr: in std_logic;
|
ext_wr_add : in std_logic_vector(external_writeable_widthad+widthadmemblock-1 downto 0);
|
ext_wr_add : in std_logic_vector(4+widthadmemblock-1 downto 0);
|
ext_rd_add : in std_logic_vector(external_readable_widthad-1 downto 0);
|
ext_rd_add : in std_logic_vector(3 downto 0);
|
ext_d: in std_logic_vector(floatwidth-1 downto 0);
|
ext_d: in std_logic_vector(floatwidth-1 downto 0);
|
int_d : in vectorblock08;
|
int_d : in vectorblock08;
|
|
|
|
status_register : in std_logic_vector(3 downto 0);
|
|
|
resultfifo_full : out std_logic_vector(3 downto 0);
|
resultfifo_full : out std_logic_vector(3 downto 0);
|
ext_q,instrfifo_q : out std_logic_vector(floatwidth-1 downto 0);
|
ext_q,instrfifo_q : out std_logic_vector(floatwidth-1 downto 0);
|
int_q : out vectorblock12;
|
int_q : out vectorblock12;
|
int_rd_add : in std_logic_vector(2*widthadmemblock-1 downto 0);
|
int_rd_add : in std_logic_vector(2*widthadmemblock-1 downto 0);
|
dpfifo_d : in std_logic_vector(floatwidth*2-1 downto 0);
|
dpfifo_d : in std_logic_vector(floatwidth*2-1 downto 0);
|
Line 547... |
Line 544... |
variable tmp:string (1 to 9);
|
variable tmp:string (1 to 9);
|
begin
|
begin
|
|
|
write(l,string'("<< "));
|
write(l,string'("<< "));
|
case i is
|
case i is
|
when WAITING_FOR_AN_EVENT =>
|
when WAITING_FOR_A_RFULL_EVENT =>
|
tmp:="WAIT_EVNT";
|
tmp:="WAIT_RF_EVNT";
|
when FIRING_INTERRUPTIONS =>
|
when INHIBIT_RFULL_INT =>
|
tmp:="FIRE_INTx";
|
tmp:="INHB_RF_INT";
|
when SUSPEND =>
|
|
tmp:="SUSPENDED";
|
|
when others =>
|
when others =>
|
tmp:="ILGL__VAL";
|
tmp:="ILGL__VAL";
|
end case;
|
end case;
|
write(l,string'(tmp));
|
write(l,string'(tmp));
|
write(l,string'(" >>"));
|
write(l,string'(" >>"));
|