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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [soc/] [altera_de_II_demo/] [1.0/] [vhd/] [altera_de_II_demo.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-- ***************************************************
2
-- File: altera_de_II_demo.vhd
3
-- Creation date: 14.03.2012
4
-- Creation time: 15:52:16
5
-- Description: Simple demo for Altera DE2 development board.Instantietes two components sig_gen and port blinker. 
6
-- Sig_gen reads switch[17] from DE2 board and activates port blinker to blink leds in DE2 Board. Note that sig_gen detects rising_edges of switch[17].
7
-- Switch[0] is reset.
8
-- 
9
-- DEMO INSTRUCTIONS.
10
-- 1. Open altera_de_II_demo design in Kactus2
11
-- 2. Generate top-level VHDL with Kactus2 vhdl generator the ribbon
12
-- 3. Generate Qurtus project for synthesizing demo design by clicking Quartus project generator in the ribbon element. 
13
-- 4. Open generated project with Quartus. Compile and synthesize.
14
-- 5. Program the FPGA.
15
-- Created by: ege
16
-- This file was generated with Kactus2 vhdl generator.
17
-- ***************************************************
18
library IEEE;
19
library work;
20
use IEEE.std_logic_1164.all;
21
use work.all;
22
 
23
entity altera_de_II_demo is
24
 
25
        port (
26
 
27
                -- Interface: clk
28
                -- clk input
29
                clk : in std_logic;
30
 
31
                -- Interface: port_out
32
                port_out : out std_logic;
33
 
34
                -- Interface: rst_n
35
                -- active low reset in
36
                rst_n : in std_logic;
37
 
38
                -- Interface: toggle_in
39
                toggle_in : in std_logic
40
        );
41
 
42
end altera_de_II_demo;
43
 
44
 
45
architecture kactusHierarchical of altera_de_II_demo is
46
 
47
        signal gen_to_blinkerENABLE_FROM_GEN : std_logic;
48
        signal gen_to_blinkerSIGNAL_FROM_GEN : std_logic_vector(31 downto 0);
49
 
50
        -- Counts up and inverts output when reaching the limit value. Then start over again.
51
        component port_blinker
52
                generic (
53
                        SIGNAL_WIDTH : integer := 32 -- In bits
54
 
55
                );
56
                port (
57
 
58
                        -- Interface: clk
59
                        clk : in std_logic;
60
 
61
                        -- Interface: port_out
62
                        port_out : out std_logic;
63
 
64
                        -- Interface: rst_n
65
                        rst_n : in std_logic;
66
 
67
                        -- Interface: signal_gen_if
68
                        ena_in : in std_logic;
69
                        val_in : in std_logic_vector(31 downto 0)
70
 
71
                );
72
        end component;
73
 
74
        -- Generates a constant value to the output bus and an enable signal that can be toggled.
75
        component sig_gen
76
                generic (
77
                        SIGNAL_VAL : integer := 50000000; -- Constant value driven to the output
78
                        SIGNAL_WIDTH : integer := 32 -- In bits
79
 
80
                );
81
                port (
82
 
83
                        -- Interface: clk
84
                        clk : in std_logic;
85
 
86
                        -- Interface: rst_n
87
                        rst_n : in std_logic;
88
 
89
                        -- Interface: signal_gen_if
90
                        ena_out : out std_logic;
91
                        sig_out : out std_logic_vector(31 downto 0);
92
 
93
                        -- Interface: toggle_in
94
                        toggle_in : in std_logic
95
 
96
                );
97
        end component;
98
 
99
        -- You can write vhdl code after this tag and it is saved through the generator.
100
        -- ##KACTUS2_BLACK_BOX_DECLARATIONS_BEGIN##
101
        -- ##KACTUS2_BLACK_BOX_DECLARATIONS_END##
102
        -- Stop writing your code after this tag.
103
 
104
 
105
begin
106
 
107
        -- You can write vhdl code after this tag and it is saved through the generator.
108
        -- ##KACTUS2_BLACK_BOX_ASSIGNMENTS_BEGIN##
109
        -- ##KACTUS2_BLACK_BOX_ASSIGNMENTS_END##
110
        -- Stop writing your code after this tag.
111
 
112
        port_blinker_1 : port_blinker
113
                port map (
114
                        clk => clk,
115
                        ena_in => gen_to_blinkerENABLE_FROM_GEN,
116
                        port_out => port_out,
117
                        rst_n => rst_n,
118
                        val_in(31 downto 0) => gen_to_blinkerSIGNAL_FROM_GEN(31 downto 0)
119
                );
120
 
121
        sig_gen_1 : sig_gen
122
                generic map (
123
                        SIGNAL_VAL => 4_000_000
124
                )
125
                port map (
126
                        clk => clk,
127
                        ena_out => gen_to_blinkerENABLE_FROM_GEN,
128
                        rst_n => rst_n,
129
                        sig_out(31 downto 0) => gen_to_blinkerSIGNAL_FROM_GEN(31 downto 0),
130
                        toggle_in => toggle_in
131
                );
132
 
133
end kactusHierarchical;
134
 

powered by: WebSVN 2.1.0

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