OpenCores
URL https://opencores.org/ocsvn/am9080_cpu_based_on_microcoded_am29xx_bit-slices/am9080_cpu_based_on_microcoded_am29xx_bit-slices/trunk

Subversion Repositories am9080_cpu_based_on_microcoded_am29xx_bit-slices

[/] [am9080_cpu_based_on_microcoded_am29xx_bit-slices/] [trunk/] [clocksinglestepper.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 zpekic
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date: 09/13/2017 10:55:47 PM
6
-- Design Name: 
7
-- Module Name: clocksinglestepper - Behavioral
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool Versions: 
11
-- Description: 
12
-- 
13
-- Dependencies: 
14
-- 
15
-- Revision:
16
-- Revision 0.01 - File Created
17
-- Additional Comments:
18
-- 
19
----------------------------------------------------------------------------------
20
 
21
 
22
library IEEE;
23
use IEEE.STD_LOGIC_1164.ALL;
24
 
25
-- Uncomment the following library declaration if using
26
-- arithmetic functions with Signed or Unsigned values
27
--use IEEE.NUMERIC_STD.ALL;
28
 
29
-- Uncomment the following library declaration if instantiating
30
-- any Xilinx leaf cells in this code.
31
--library UNISIM;
32
--use UNISIM.VComponents.all;
33
 
34
entity clocksinglestepper is
35
    Port ( reset : in STD_LOGIC;
36
           clock0_in : in STD_LOGIC;
37
           clock1_in : in STD_LOGIC;
38
                          clock2_in : in STD_LOGIC;
39
                          clock3_in : in STD_LOGIC;
40
           clocksel : in STD_LOGIC_VECTOR(1 downto 0);
41
           modesel : in STD_LOGIC;
42
           singlestep : in STD_LOGIC;
43
           clock_out : out STD_LOGIC);
44
end clocksinglestepper;
45
 
46
architecture Behavioral of clocksinglestepper is
47
 
48
signal clock_in, clock_disable, clock_ss: std_logic;
49
 
50
begin
51
 
52
clock_in <= clock0_in when (clocksel = "00") else
53
                                clock1_in when (clocksel = "01") else
54
                                clock2_in when (clocksel = "10") else
55
                                clock3_in when (clocksel = "11") else
56
                                '0';
57
clock_out <= clock_in or clock_disable;
58
clock_ss <= clock_in when (clock_disable = '0') else singlestep;
59
 
60
ss: process(reset, clock_ss, modesel)
61
begin
62
    if (reset = '1') then
63
        clock_disable <= modesel;
64
    else
65
        if (rising_edge(clock_ss)) then
66
            clock_disable <= (not clock_disable and modesel);
67
        end if;
68
    end if;
69
end process;
70
 
71
end Behavioral;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.