Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / cnes_guidelines / rule / data / STD_04500_good.vhd @ 2051e520

History | View | Annotate | Download (3.42 KB)

1
-------------------------------------------------------------------------------------------------
2
-- Company   : CNES
3
-- Author    : Mickael Carl (CNES)
4
-- Copyright : Copyright (c) CNES.
5
-- Licensing : GNU GPLv3
6
-------------------------------------------------------------------------------------------------
7
-- Version         : V1
8
-- Version history :
9
--    V1 : 2015-04-08 : Mickael Carl (CNES): Creation
10
-------------------------------------------------------------------------------------------------
11
-- File name          : STD_04500_good.vhd
12
-- File Creation date : 2015-04-08
13
-- Project name       : VHDL Handbook CNES Edition
14
-------------------------------------------------------------------------------------------------
15
-- Softwares             :  Microsoft Windows (Windows 7) - Editor (Eclipse + VEditor)
16
-------------------------------------------------------------------------------------------------
17
-- Description : Handbook example: Clock reassignment: good example
18
--
19
-- Limitations : This file is an example of the VHDL handbook made by CNES. It is a stub aimed at
20
--               demonstrating good practices in VHDL and as such, its design is minimalistic.
21
--               It is provided as is, without any warranty.
22
--               This example is compliant with the Handbook version 1.
23
--
24
-------------------------------------------------------------------------------------------------
25
-- Naming conventions:
26
--
27
-- i_Port: Input entity port
28
-- o_Port: Output entity port
29
-- b_Port: Bidirectional entity port
30
-- g_My_Generic: Generic entity port
31
--
32
-- c_My_Constant: Constant definition
33
-- t_My_Type: Custom type definition
34
--
35
-- My_Signal_n: Active low signal
36
-- v_My_Variable: Variable
37
-- sm_My_Signal: FSM signal
38
-- pkg_Param: Element Param coming from a package
39
--
40
-- My_Signal_re: Rising edge detection of My_Signal
41
-- My_Signal_fe: Falling edge detection of My_Signal
42
-- My_Signal_rX: X times registered My_Signal signal
43
--
44
-- P_Process_Name: Process
45
--
46
-------------------------------------------------------------------------------------------------
47

    
48
library IEEE;
49
use IEEE.std_logic_1164.all;
50
use IEEE.numeric_std.all;
51
use work.pkg_HBK.all;
52

    
53
--CODE
54
entity STD_04500_good is
55
   port (
56
      i_Clock   : in  std_logic;        -- Clock signal
57
      i_Reset_n : in  std_logic;        -- Reset signal
58
      -- D Flip-flop 3 stages pipeline
59
      -- D Flip-Flop A
60
      i_DA      : in  std_logic;        -- Input signal
61
      o_QA      : out std_logic;        -- Output signal
62
      -- D Flip-flop B
63
      o_QB      : out std_logic;        -- Output signal
64
      -- D Flip-Flop C
65
      o_QC      : out std_logic         -- Output signal
66
      );
67
end STD_04500_good;
68

    
69
architecture Behavioral of STD_04500_good is
70
   signal QA : std_logic;
71
   signal QB : std_logic;
72
begin
73
   -- First Flip-Flop
74
   DFF1 : DFlipFlop
75
      port map (
76
         i_Clock   => i_Clock,
77
         i_Reset_n => i_Reset_n,
78
         i_D       => i_DA,
79
         o_Q       => QA,
80
         o_Q_n     => open
81
         );
82

    
83
   -- Second Flip-Flop
84
   DFF2 : DFlipFlop
85
      port map (
86
         i_Clock   => i_Clock,
87
         i_Reset_n => i_Reset_n,
88
         i_D       => QA,
89
         o_Q       => QB,
90
         o_Q_n     => open
91
         );
92

    
93
   -- Third Flip-Flop
94
   DFF3 : DFlipFlop
95
      port map (
96
         i_Clock   => i_Clock,
97
         i_Reset_n => i_Reset_n,
98
         i_D       => QB,
99
         o_Q       => o_QC,
100
         o_Q_n     => open
101
         );
102

    
103
   o_QA <= QA;
104
   o_QB <= QB;
105
end Behavioral;
106
--CODE