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

Subversion Repositories iota_pow_vhdl

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 microengin
-- IOTA Pearl Diver VHDL Port
2
--
3 7 microengin
-- 2018 by Thomas Pototschnig <microengineer18@gmail.com,
4
-- http://microengineer.eu
5
-- discord: pmaxuw#8292
6 2 microengin
--
7 7 microengin
-- 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 2 microengin
-- 
15 7 microengin
-- The above copyright notice and this permission notice shall be
16
-- included in all copies or substantial portions of the Software.
17 2 microengin
-- 
18 7 microengin
-- 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 2 microengin
 
26
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 Input             ////////////////////     
34
                CLOCK_24 : in std_logic_vector (1 downto 0);
35
                CLOCK_27 : in std_logic_vector (1 downto 0);
36
                CLOCK_50 : in std_logic;
37
                EXT_CLOCK : in std_logic;
38
--              ////////////////////    Push Button             ////////////////////
39
                KEY : in std_logic_vector(3 downto 0);
40
--              ////////////////////    DPDT Switch             ////////////////////
41
                SW : in std_logic_vector (9 downto 0);
42
--              ////////////////////    7-SEG Dispaly   ////////////////////
43
                HEX0 : out std_logic_vector (6 downto 0);
44
                HEX1 : out std_logic_vector (6 downto 0);
45
                HEX2 : out std_logic_vector (6 downto 0);
46
                HEX3 : out std_logic_vector (6 downto 0);
47
--              ////////////////////////        LED             ////////////////////////
48
                LEDG : out std_logic_vector (7 downto 0);
49
                LEDR : out std_logic_vector (9 downto 0);
50
--              ////////////////////////        UART    ////////////////////////
51
                UART_TXD : out std_logic;
52
                UART_RXD : in std_logic;
53
--              /////////////////////   SDRAM Interface         ////////////////
54
                DRAM_DQ : inout std_logic_vector (15 downto 0);
55
                DRAM_ADDR : out std_logic_vector (11 downto 0);
56
                DRAM_LDQM : out std_logic;
57
                DRAM_UDQM : out std_logic;
58
                DRAM_WE_N : out std_logic;
59
                DRAM_CAS_N : out std_logic;
60
                DRAM_RAS_N : out std_logic;
61
                DRAM_CS_N : out std_logic;
62
                DRAM_BA_0 : out std_logic;
63
                DRAM_BA_1 : out std_logic;
64
                DRAM_CLK : out std_logic;
65
                DRAM_CKE : out std_logic;
66
--              ////////////////////    Flash Interface         ////////////////
67
                FL_DQ : inout std_logic_vector (7 downto 0);
68
                FL_ADDR : out std_logic_vector (21 downto 0);
69
                FL_WE_N : out std_logic;
70
                FL_RST_N : out std_logic;
71
                FL_OE_N : out std_logic;
72
                FL_CE_N : out std_logic;
73
--              ////////////////////    SRAM Interface          ////////////////
74
                SRAM_DQ : inout std_logic_vector (15 downto 0);
75
                SRAM_ADDR : out std_logic_vector (17 downto 0);
76
                SRAM_UB_N : out std_logic;
77
                SRAM_LB_N : out std_logic;
78
                SRAM_WE_N : out std_logic;
79
                SRAM_CE_N : out std_logic;
80
                SRAM_OE_N : out std_logic;
81
--              ////////////////////    SD_Card Interface       ////////////////
82
                SD_DAT : inout std_logic;
83
                SD_DAT3 : inout std_logic;
84
                SD_CMD : inout std_logic;
85
                SD_CLK : out std_logic;
86
--              ////////////////////    USB JTAG link   ////////////////////
87
                TDI : in std_logic;
88
                TCK : in std_logic;
89
                TCS : in std_logic;
90
            TDO : out std_logic;
91
--              ////////////////////    I2C             ////////////////////////////
92
                I2C_SDAT : inout std_logic;
93
                I2C_SCLK : out std_logic;
94
--              ////////////////////    PS2             ////////////////////////////
95
                PS2_DAT : in std_logic;
96
                PS2_CLK : in std_logic;
97
--              ////////////////////    VGA             ////////////////////////////
98
                VGA_HS : out std_logic;
99
                VGA_VS : out std_logic;
100
                VGA_R  : out std_logic_vector (3 downto 0);
101
                VGA_G: out std_logic_vector (3 downto 0);
102
                VGA_B: out std_logic_vector (3 downto 0);
103
--              ////////////////        Audio CODEC             ////////////////////////
104
                AUD_ADCLRCK : inout std_logic;
105
                AUD_ADCDAT : in std_logic;
106
                AUD_DACLRCK : inout std_logic;
107
                AUD_DACDAT : out std_logic;
108
                AUD_BCLK : out std_logic;
109
                AUD_XCK : out std_logic;
110
--              ////////////////////    GPIO    ////////////////////////////
111
                GPIO_0 : inout std_logic_vector (35 downto 0);
112
                GPIO_1 : inout std_logic_vector (35 downto 0)
113
        );
114
end;
115
 
116
architecture beh of de1 is
117
 
118
 
119
signal reset : std_logic;
120
 
121
signal pll_clk : std_logic;
122
signal pll_reset : std_logic := '0';
123
signal pll_locked : std_logic;
124
 
125
signal spi_data_tx : std_logic_vector(31 downto 0);
126
signal spi_data_rx  : std_logic_vector(31 downto 0);
127
signal spi_data_rx_en : std_logic;
128
 
129
signal running : std_logic := '0';
130
signal overflow : std_logic := '0';
131
signal found : std_logic := '0';
132
 
133
signal spi_mosi : std_logic;
134
signal spi_miso : std_logic;
135
signal spi_sck : std_logic;
136
signal spi_ss : std_logic;
137 4 microengin
signal pll_slow : std_logic;
138 2 microengin
component spi_slave
139
        port
140
        (
141
                clk : in std_logic;
142
                reset : in std_logic;
143
 
144
                mosi : in std_logic;
145
                miso : out std_logic;
146
                sck : in std_logic;
147
                ss : in std_logic;
148
 
149
 
150
                data_rd : in std_logic_vector(31 downto 0);
151
                data_wr : out std_logic_vector(31 downto 0);
152
                data_wren : out std_logic
153
        );
154
end component;
155
 
156
component pll
157
        PORT
158
        (
159
                areset          : IN STD_LOGIC  := '0';
160
                inclk0          : IN STD_LOGIC  := '0';
161
                c0              : OUT STD_LOGIC ;
162 4 microengin
                c1 : out std_logic;
163 2 microengin
                locked          : OUT STD_LOGIC
164
        );
165
end component;
166
 
167
component curl
168
        port
169
        (
170
                clk : in std_logic;
171 4 microengin
                clk_slow : in std_logic;
172 2 microengin
                reset : in std_logic;
173
 
174
                spi_data_rx : in std_logic_vector(31 downto 0);
175
                spi_data_tx : out std_logic_vector(31 downto 0);
176
                spi_data_rxen : in std_logic;
177
 
178
                overflow : out std_logic;
179
                running : out std_logic;
180
                found : out std_logic
181
        );
182
end component;
183
 
184
begin
185
        pll0 : pll port map (
186
                areset => pll_reset,
187
                inclk0 => CLOCK_50,
188
                c0 => pll_clk,
189 4 microengin
                c1      => pll_slow,
190 2 microengin
                locked => pll_locked
191
        );
192
 
193 4 microengin
 
194 2 microengin
        spi0 : spi_slave port map (
195 4 microengin
                clk => pll_slow,
196 2 microengin
                reset => reset,
197
 
198
                mosi => spi_mosi,
199
                miso => spi_miso,
200
                sck => spi_sck,
201
                ss => spi_ss,
202
 
203
                data_rd => spi_data_tx,
204
                data_wr => spi_data_rx,
205
                data_wren => spi_data_rx_en
206
        );
207
 
208
        curl0 : curl port map (
209
                clk => pll_clk,
210
                reset => reset,
211 4 microengin
                clk_slow => pll_slow,
212 2 microengin
 
213
                spi_data_rx => spi_data_rx,
214
                spi_data_tx => spi_data_tx,
215
                spi_data_rxen => spi_data_rx_en,
216
 
217
                overflow => overflow,
218
                running => running,
219
                found => found
220
        );
221
 
222
 
223
-- disable all DE1 stuff        
224
DRAM_DQ <= (others => 'Z');
225
FL_DQ <= (others => 'Z');
226
SRAM_DQ <= (others => 'Z');
227
SD_DAT <= 'Z';
228
I2C_SDAT <= 'Z';
229
GPIO_0 <= (others => 'Z');
230
GPIO_1 <= (others => 'Z');
231
 
232
LEDR <= "0" & "1" & spi_ss & spi_sck & spi_mosi & spi_miso & reset & overflow & found & running;
233
LEDG <= (others => '0');
234
 
235
AUD_BCLK <= '0';
236
AUD_DACLRCK <= '0';
237
AUD_ADCLRCK     <= '0';
238
AUD_XCK <= '0';
239
 
240
SRAM_ADDR(17)<='0';
241
 
242
reset <= not SW(0);
243
 
244
spi_mosi <= GPIO_0(0);
245
spi_sck <= GPIO_0(2);
246
spi_ss <= GPIO_0(3);
247
 
248
-- all pins except one is input
249
GPIO_0(3 downto 0) <= "ZZ" & spi_miso & "Z";
250
 
251
 
252
end architecture;

powered by: WebSVN 2.1.0

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