URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_cpu_alu.vhd] - Diff between revs 49 and 55
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 49 |
Rev 55 |
Line 100... |
Line 100... |
cmd : std_ulogic;
|
cmd : std_ulogic;
|
cmd_ff : std_ulogic;
|
cmd_ff : std_ulogic;
|
busy : std_ulogic;
|
busy : std_ulogic;
|
start : std_ulogic;
|
start : std_ulogic;
|
halt : std_ulogic;
|
halt : std_ulogic;
|
|
timeout : std_ulogic_vector(9 downto 0);
|
end record;
|
end record;
|
signal cp_ctrl : cp_ctrl_t;
|
signal cp_ctrl : cp_ctrl_t;
|
|
|
begin
|
begin
|
|
|
Line 275... |
Line 276... |
cp_arbiter: process(rstn_i, clk_i)
|
cp_arbiter: process(rstn_i, clk_i)
|
begin
|
begin
|
if (rstn_i = '0') then
|
if (rstn_i = '0') then
|
cp_ctrl.cmd_ff <= '0';
|
cp_ctrl.cmd_ff <= '0';
|
cp_ctrl.busy <= '0';
|
cp_ctrl.busy <= '0';
|
|
cp_ctrl.timeout <= (others => '0');
|
elsif rising_edge(clk_i) then
|
elsif rising_edge(clk_i) then
|
cp_ctrl.cmd_ff <= cp_ctrl.cmd;
|
cp_ctrl.cmd_ff <= cp_ctrl.cmd;
|
if (or_all_f(cp_valid_i) = '1') then -- cp computation done?
|
if (or_all_f(cp_valid_i) = '1') then -- cp computation done?
|
cp_ctrl.busy <= '0';
|
cp_ctrl.busy <= '0';
|
|
elsif (cp_ctrl.timeout(cp_ctrl.timeout'left) = '1') and (cp_timeout_en_c = true) then -- timeout
|
|
assert false report "NEORV32 CPU CO-PROCESSOR TIMEOUT ERROR!" severity warning;
|
|
cp_ctrl.busy <= '0';
|
elsif (cp_ctrl.start = '1') then
|
elsif (cp_ctrl.start = '1') then
|
cp_ctrl.busy <= '1';
|
cp_ctrl.busy <= '1';
|
end if;
|
end if;
|
|
-- timeout counter --
|
|
if (cp_ctrl.busy = '1') and (cp_timeout_en_c = true) then
|
|
cp_ctrl.timeout <= std_ulogic_vector(unsigned(cp_ctrl.timeout) + 1);
|
|
else
|
|
cp_ctrl.timeout <= (others => '0');
|
|
end if;
|
end if;
|
end if;
|
end process cp_arbiter;
|
end process cp_arbiter;
|
|
|
-- is co-processor operation? --
|
-- is co-processor operation? --
|
cp_ctrl.cmd <= '1' when (ctrl_i(ctrl_alu_func1_c downto ctrl_alu_func0_c) = alu_func_cmd_copro_c) else '0';
|
cp_ctrl.cmd <= '1' when (ctrl_i(ctrl_alu_func1_c downto ctrl_alu_func0_c) = alu_func_cmd_copro_c) else '0';
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.