Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- The Conditional Branch Logic unit.
|
-- The Conditional Branch Logic unit.
|
-- Decisions whether to take a jump or not are made here.
|
-- Decisions whether to take a jump or not are made here.
|
--
|
--
|
-- $Id: cond_branch.vhd,v 1.1 2004-03-23 21:31:52 arniml Exp $
|
-- $Id: cond_branch.vhd,v 1.2 2004-04-24 23:44:25 arniml Exp $
|
--
|
--
|
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
|
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
|
--
|
--
|
-- All rights reserved
|
-- All rights reserved
|
--
|
--
|
Line 75... |
Line 75... |
|
|
end cond_branch;
|
end cond_branch;
|
|
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_arith.all;
|
use ieee.numeric_std.all;
|
|
|
use work.t48_pack.res_active_c;
|
use work.t48_pack.res_active_c;
|
use work.t48_pack.clk_active_c;
|
use work.t48_pack.clk_active_c;
|
|
|
architecture rtl of cond_branch is
|
architecture rtl of cond_branch is
|
Line 106... |
Line 106... |
comp_value_i)
|
comp_value_i)
|
variable or_v : std_logic;
|
variable or_v : std_logic;
|
begin
|
begin
|
-- default assignment
|
-- default assignment
|
take_branch_s <= false;
|
take_branch_s <= false;
|
|
or_v := '0';
|
|
|
case branch_cond_i is
|
case branch_cond_i is
|
-- Branch On: Accumulator Bit -------------------------------------------
|
-- Branch On: Accumulator Bit -------------------------------------------
|
when COND_ON_BIT =>
|
when COND_ON_BIT =>
|
if accu_i(CONV_INTEGER(UNSIGNED(comp_value_i))) = '1' then
|
if accu_i(TO_INTEGER(UNSIGNED(comp_value_i))) = '1' then
|
take_branch_s <= true;
|
take_branch_s <= true;
|
end if;
|
end if;
|
|
|
-- Branch On: Accumulator Zero ------------------------------------------
|
-- Branch On: Accumulator Zero ------------------------------------------
|
when COND_Z =>
|
when COND_Z =>
|
or_v := '0';
|
|
for i in accu_i'range loop
|
for i in accu_i'range loop
|
or_v := or_v or accu_i(i);
|
or_v := or_v or accu_i(i);
|
end loop;
|
end loop;
|
take_branch_s <= or_v = not comp_value_i(0);
|
take_branch_s <= or_v = not comp_value_i(0);
|
|
|
Line 203... |
Line 203... |
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- File History:
|
-- File History:
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.1 2004/03/23 21:31:52 arniml
|
|
-- initial check-in
|
|
--
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
No newline at end of file
|
No newline at end of file
|