OpenCores
URL https://opencores.org/ocsvn/openverifla/openverifla/trunk

Subversion Repositories openverifla

[/] [openverifla/] [trunk/] [openverifla_2.4/] [vhdl/] [examples/] [counters.vhd] - Blame information for rev 46

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 46 laurentiud
-- keyboad driver
2
-----------------------------------------------------
3
 
4
library IEEE;
5
use IEEE.STD_LOGIC_1164.ALL;
6
use IEEE.NUMERIC_STD.ALL;
7
--use ieee.std_logic_arith.all;  
8
--use ieee.std_logic_unsigned.all;
9
 
10
-----------------------------------------------------
11
 
12
entity counters is
13
port(   cntb: out std_logic_vector(7 downto 0);
14
                clk, reset:     in std_logic;
15
                uart_XMIT_dataH: out std_logic;
16
                uart_REC_dataH: in std_logic
17
);
18
end counters;
19
 
20
-----------------------------------------------------
21
 
22
architecture counters_arch of counters is
23
 
24
    -- define the states of counters_arch model
25
        signal cnta: std_logic_vector(7 downto 0);
26
        signal cntb_reg: std_logic_vector(7 downto 0);
27
        signal verifla_data_in : std_logic_vector(15 downto 0);
28
begin
29
 
30
    -- process: state registers
31
   state_reg: process(clk, reset)
32
   begin
33
                if (reset='1') then
34
                        cnta <= (others => '0');
35
                        cntb_reg <= (others => '0');
36
                elsif (rising_edge(clk)) then
37
                        if(((cnta and x"01") = x"01") and (cntb_reg < x"f0")) then
38
                                cntb_reg <= std_logic_vector(unsigned(cntb_reg)+x"01");
39
                        end if;
40
                        cnta <= std_logic_vector(unsigned(cnta)+x"01");
41
                end if;
42
   end process;
43
        cntb <= cntb_reg;
44
 
45
        -- openVeriFLA
46
        verifla_data_in <= cntb_reg & cnta;
47
                --(15 downto 10 => '0') & kbd_data_line & kbd_clk & kbd_key_reg;
48
        verifla: entity work.top_of_verifla(top_of_verifla_arch)
49
                port map (clk=>clk, rst_l=>not(reset), sys_run=>'1',
50
                                data_in=>verifla_data_in,
51
                                -- Transceiver
52
                                uart_XMIT_dataH => uart_XMIT_dataH,
53
                                uart_REC_dataH => uart_REC_dataH);
54
 
55
end counters_arch;

powered by: WebSVN 2.1.0

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