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

Subversion Repositories iota_pow_vhdl

[/] [iota_pow_vhdl/] [trunk/] [vhdl_cyclone10_lp/] [de1.vhd] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 microengin
-- IOTA Pearl Diver VHDL Port
2
--
3
-- 2018 by Thomas Pototschnig <microengineer18@gmail.com,
4
-- http://microengineer.eu
5
-- discord: pmaxuw#8292
6
--
7
-- Permission is hereby granted, free of charge, to any person obtaining
8
-- a copy of this software and associated documentation files (the
9
-- "Software"), to deal in the Software without restriction, including
10
-- without limitation the rights to use, copy, modify, merge, publish,
11
-- distribute, sublicense, and/or sell copies of the Software, and to
12
-- permit persons to whom the Software is furnished to do so, subject to
13
-- the following conditions:
14
-- 
15
-- The above copyright notice and this permission notice shall be
16
-- included in all copies or substantial portions of the Software.
17
-- 
18
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
-- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
-- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
-- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
25
 
26 4 microengin
library IEEE;
27
use IEEE.STD_LOGIC_1164.ALL;
28
use IEEE.STD_LOGIC_ARITH.ALL;
29
use IEEE.STD_LOGIC_UNSIGNED.ALL;
30
 
31
entity de1 is
32
        port (
33
                CLOCK_50 : in std_logic;
34
                reset : in std_logic;
35
                led_running : out std_logic;
36
                led_found : out std_logic;
37
                led_overflow : out std_logic;
38
--              ////////////////////////        UART    ////////////////////////
39
                spi_mosi : in std_logic;
40
                spi_sck : in std_logic;
41
                spi_ss : in std_logic;
42
                spi_miso : out std_logic
43
 
44
        );
45
end;
46
 
47
architecture beh of de1 is
48
 
49 7 microengin
signal nreset : std_logic;
50 4 microengin
 
51
 
52
 
53
signal pll_clk : std_logic;
54
signal pll_reset : std_logic := '0';
55
signal pll_locked : std_logic;
56
 
57
signal spi_data_tx : std_logic_vector(31 downto 0);
58
signal spi_data_rx  : std_logic_vector(31 downto 0);
59
signal spi_data_rx_en : std_logic;
60 7 microengin
signal spi_data_strobe : std_logic;
61 4 microengin
 
62
signal pll_slow : std_logic;
63
 
64
component spi_slave
65
        port
66
        (
67
                clk : in std_logic;
68
                reset : in std_logic;
69
 
70
                mosi : in std_logic;
71
                miso : out std_logic;
72
                sck : in std_logic;
73
                ss : in std_logic;
74 7 microengin
                data_strobe : in std_logic;
75 4 microengin
 
76
 
77
                data_rd : in std_logic_vector(31 downto 0);
78
                data_wr : out std_logic_vector(31 downto 0);
79
                data_wren : out std_logic
80
        );
81
end component;
82
 
83
component pll
84
        PORT
85
        (
86
                areset          : IN STD_LOGIC  := '0';
87
                inclk0          : IN STD_LOGIC  := '0';
88
                c0              : OUT STD_LOGIC ;
89
                c1 : out std_logic;
90
                locked          : OUT STD_LOGIC
91
        );
92
end component;
93
 
94
component curl
95
        port
96
        (
97
                clk : in std_logic;
98
                clk_slow : in std_logic;
99
                reset : in std_logic;
100
 
101
                spi_data_rx : in std_logic_vector(31 downto 0);
102
                spi_data_tx : out std_logic_vector(31 downto 0);
103
                spi_data_rxen : in std_logic;
104 7 microengin
                spi_data_strobe : out std_logic;
105 4 microengin
 
106
                overflow : out std_logic;
107
                running : out std_logic;
108
                found : out std_logic
109
        );
110
end component;
111
 
112
begin
113 7 microengin
        nreset <= not reset;
114
 
115
 
116 4 microengin
        pll0 : pll port map (
117
                areset => pll_reset,
118
                inclk0 => CLOCK_50,
119
                c0 => pll_clk,
120
                c1      => pll_slow,
121
                locked => pll_locked
122
        );
123
 
124
 
125
        spi0 : spi_slave port map (
126
                clk => pll_slow,
127 7 microengin
                reset => nreset,
128 4 microengin
 
129
                mosi => spi_mosi,
130
                miso => spi_miso,
131
                sck => spi_sck,
132
                ss => spi_ss,
133 7 microengin
                data_strobe => spi_data_strobe,
134 4 microengin
 
135
                data_rd => spi_data_tx,
136
                data_wr => spi_data_rx,
137
                data_wren => spi_data_rx_en
138
        );
139
 
140
        curl0 : curl port map (
141
                clk => pll_clk,
142 7 microengin
                reset => nreset,
143 4 microengin
                clk_slow => pll_slow,
144
 
145
                spi_data_rx => spi_data_rx,
146
                spi_data_tx => spi_data_tx,
147
                spi_data_rxen => spi_data_rx_en,
148 7 microengin
                spi_data_strobe => spi_data_strobe,
149 4 microengin
 
150
                overflow => led_overflow,
151
                running => led_running,
152
                found => led_found
153
        );
154
 
155
 
156
end architecture;

powered by: WebSVN 2.1.0

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