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

Subversion Repositories openverifla

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 46 laurentiud
-----------------------------------------------------
2
-- single pulse from a multi-periods-contiguous pulse
3
-- date: 20180820-1700
4
-- author: Laurentiu Duca
5
-----------------------------------------------------
6
 
7
library IEEE;
8
use IEEE.STD_LOGIC_1164.ALL;
9
use IEEE.NUMERIC_STD.ALL;
10
--use ieee.std_logic_arith.all;  
11
--use ieee.std_logic_unsigned.all;
12
 
13
-----------------------------------------------------
14
 
15
entity single_pulse_of_verifla is
16
port(   clk, rst_l: in std_logic;
17
                ub: in std_logic;
18
                ubsing: out std_logic
19
);
20
end single_pulse_of_verifla;
21
 
22
-----------------------------------------------------
23
 
24
architecture single_pulse_of_verifla_arch of single_pulse_of_verifla is
25
 
26
   signal next_state, state: std_logic;
27
        signal ubsing_reg, next_ubsing_reg: std_logic;
28
 
29
begin
30
        ubsing <= ubsing_reg;
31
 
32
   state_reg: process(clk, rst_l)
33
   begin
34
                if (rst_l='0') then
35
                        state <= '0';
36
                        ubsing_reg <= '0';
37
                elsif (rising_edge(clk)) then
38
                                state <= next_state;
39
                                ubsing_reg <= next_ubsing_reg;
40
                end if;
41
   end process;
42
 
43
   comb_logic: process(state, ub)
44
        begin
45
                next_state <= state;
46
                next_ubsing_reg <= '0';
47
                case state is
48
                        when '0' =>
49
                                if (ub = '1') then
50
                                         next_state <= '1';
51
                                         next_ubsing_reg <= '1';
52
                                end if;
53
                        when '1' =>
54
                                if (ub = '0') then
55
                                        next_state <= '0';
56
                                end if;
57
                        when others =>
58
                                -- this is forced by the vhdl compiler
59
                                --next_state <= '0';
60
                                --next_ubsing_reg <= '0';
61
                end case;
62
   end process;
63
 
64
end single_pulse_of_verifla_arch;
65
 
66
-----------------------------------------------------

powered by: WebSVN 2.1.0

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