Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- The Clock Control unit.
|
-- The Clock Control unit.
|
-- Clock States and Machine Cycles are generated here.
|
-- Clock States and Machine Cycles are generated here.
|
--
|
--
|
-- $Id: clock_ctrl.vhd,v 1.3 2004-04-18 18:56:23 arniml Exp $
|
-- $Id: clock_ctrl.vhd,v 1.4 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 78... |
Line 78... |
|
|
end clock_ctrl;
|
end clock_ctrl;
|
|
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_arith.all;
|
use ieee.numeric_std.all;
|
|
|
architecture rtl of clock_ctrl is
|
architecture rtl of clock_ctrl is
|
|
|
-- The three XTAL1 cycles.
|
-- The three XTAL1 cycles.
|
signal xtal_q : unsigned(1 downto 0);
|
signal xtal_q : unsigned(1 downto 0);
|
Line 129... |
Line 129... |
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
use_xtal_div: if xtal_div_3_g = 1 generate
|
use_xtal_div: if xtal_div_3_g = 1 generate
|
xtal: process (res_i, xtal_i)
|
xtal: process (res_i, xtal_i)
|
begin
|
begin
|
if res_i = res_active_c then
|
if res_i = res_active_c then
|
xtal_q <= CONV_UNSIGNED(0, 2);
|
xtal_q <= TO_UNSIGNED(0, 2);
|
|
|
elsif xtal_i'event and xtal_i = clk_active_c then
|
elsif xtal_i'event and xtal_i = clk_active_c then
|
if xtal_q < 2 then
|
if xtal_q < 2 then
|
xtal_q <= xtal_q + 1;
|
xtal_q <= xtal_q + 1;
|
else
|
else
|
xtal_q <= CONV_UNSIGNED(0, 2);
|
xtal_q <= TO_UNSIGNED(0, 2);
|
end if;
|
end if;
|
|
|
end if;
|
end if;
|
|
|
end process xtal;
|
end process xtal;
|
Line 158... |
Line 158... |
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- XTAL1 is used directly for Clock States.
|
-- XTAL1 is used directly for Clock States.
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
no_xtal_div: if xtal_div_3_g = 0 generate
|
no_xtal_div: if xtal_div_3_g = 0 generate
|
xtal_q <= CONV_UNSIGNED(0, 2);
|
xtal_q <= TO_UNSIGNED(0, 2);
|
|
|
x1_s <= '1';
|
x1_s <= '1';
|
x2_s <= '1';
|
x2_s <= '1';
|
x3_s <= '1';
|
x3_s <= '1';
|
|
|
Line 378... |
Line 378... |
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- File History:
|
-- File History:
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.3 2004/04/18 18:56:23 arniml
|
|
-- reset machine state to MSTATE3 to allow proper instruction fetch
|
|
-- after reset
|
|
--
|
-- Revision 1.2 2004/03/28 12:55:06 arniml
|
-- Revision 1.2 2004/03/28 12:55:06 arniml
|
-- move code for PROG out of if-branch for xtal3_s
|
-- move code for PROG out of if-branch for xtal3_s
|
--
|
--
|
-- Revision 1.1 2004/03/23 21:31:52 arniml
|
-- Revision 1.1 2004/03/23 21:31:52 arniml
|
-- initial check-in
|
-- initial check-in
|