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

Subversion Repositories c16

[/] [c16/] [trunk/] [vhdl/] [Board_cpu.vhd] - Blame information for rev 29

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jsauermann
--
2
-- This is the top level VHDL file.
3
--
4
-- It iobufs for bidirational signals (towards an optional
5
-- external fast SRAM.
6
--
7
-- Pins fit the AVNET Virtex-E Evaluation board
8
--
9
-- For other boards, change pin assignments in this file.
10
--
11
library IEEE;
12
use IEEE.std_logic_1164.all;
13
use IEEE.std_logic_unsigned.all;
14
 
15
use work.cpu_pack.ALL;
16
 
17
library UNISIM;
18
use UNISIM.VComponents.all;
19
 
20
entity board_cpu is
21
        PORT (  CLK40                   : in  STD_LOGIC;
22
                        SWITCH                  : in  STD_LOGIC_VECTOR (9 downto 0);
23
 
24
                        SER_IN                  : in  STD_LOGIC;
25
                        SER_OUT                 : out STD_LOGIC;
26
 
27
                        TEMP_SPO                : in  STD_LOGIC;
28
                        TEMP_SPI                : out STD_LOGIC;
29
 
30
                CLK_OUT                 : out STD_LOGIC;
31
                LED                             : out STD_LOGIC_VECTOR (7 downto 0);
32
                        ENABLE_N                : out STD_LOGIC;
33
                        DEACTIVATE_N    : out STD_LOGIC;
34
                        TEMP_CE                 : out STD_LOGIC;
35
                        TEMP_SCLK               : out STD_LOGIC;
36
                        SEG1                    : out STD_LOGIC_VECTOR (7 downto 0);
37
                        SEG2                    : out STD_LOGIC_VECTOR (7 downto 0);
38
 
39
                        XM_ADR                  : out   STD_LOGIC_VECTOR(14 downto 0);
40
                        XM_CE_N                 : out STD_LOGIC;
41
                        XM_OE_N                 : out STD_LOGIC;
42
                        XM_WE_N                 : inout STD_LOGIC;
43
                        XM_DIO                  : inout STD_LOGIC_VECTOR(7 downto 0)
44
            );
45
end board_cpu;
46
 
47
architecture behavioral of board_cpu is
48
 
49 9 jsauermann
        COMPONENT cpu
50 2 jsauermann
        PORT(   CLK_I                   : in  STD_LOGIC;
51
                        SWITCH                  : in  STD_LOGIC_VECTOR (9 downto 0);
52
 
53
                        SER_IN                  : in  STD_LOGIC;
54
                        SER_OUT                 : out STD_LOGIC;
55
 
56
                        TEMP_SPO                : in  STD_LOGIC;
57
                        TEMP_SPI                : out STD_LOGIC;
58
                        TEMP_CE                 : out STD_LOGIC;
59
                        TEMP_SCLK               : out STD_LOGIC;
60
 
61
                        SEG1                    : out STD_LOGIC_VECTOR (7 downto 0);
62
                        SEG2                    : out STD_LOGIC_VECTOR( 7 downto 0);
63
                        LED                             : out STD_LOGIC_VECTOR( 7 downto 0);
64
 
65
                        XM_ADR                  : out STD_LOGIC_VECTOR(15 downto 0);
66
                        XM_RDAT                 : in  STD_LOGIC_VECTOR( 7 downto 0);
67
                        XM_WDAT                 : out STD_LOGIC_VECTOR( 7 downto 0);
68
                        XM_WE                   : out STD_LOGIC;
69
                        XM_CE                   : out STD_LOGIC
70
                );
71
        END COMPONENT;
72
 
73
        signal XM_WDAT  : std_logic_vector( 7 downto 0);
74
        signal XM_RDAT  : std_logic_vector( 7 downto 0);
75
        signal MEM_T    : std_logic;
76
        signal XM_WE    : std_logic;
77
        signal WE_N     : std_logic;
78
        signal DEL_WE_N : std_logic;
79
        signal XM_CE    : std_logic;
80 9 jsauermann
        signal LCLK     : std_logic;
81 2 jsauermann
 
82 9 jsauermann
 
83 2 jsauermann
begin
84
 
85 9 jsauermann
        cp: cpu
86 2 jsauermann
        PORT MAP(       CLK_I        => CLK40,
87
                                SWITCH       => SWITCH,
88
 
89
                                SER_IN       => SER_IN,
90
                                SER_OUT      => SER_OUT,
91
 
92
                                TEMP_SPO     =>  TEMP_SPO,
93
                                TEMP_SPI     =>  TEMP_SPI,
94
 
95
                                XM_ADR(14 downto 0)  =>  XM_ADR,
96
                                XM_ADR(15)  =>  open,
97
                                XM_RDAT     =>  XM_RDAT,
98
                                XM_WDAT     =>  XM_WDAT,
99
                                XM_WE       =>  XM_WE,
100
                                XM_CE       =>  XM_CE,
101
                                TEMP_CE      => TEMP_CE,
102
                                TEMP_SCLK    => TEMP_SCLK,
103
                                SEG1         => SEG1,
104
                                SEG2         => SEG2,
105
                                LED          => LED
106
                        );
107
 
108
        ENABLE_N     <= '0';
109
        DEACTIVATE_N <= '1';
110 9 jsauermann
        CLK_OUT      <= LCLK;
111 2 jsauermann
 
112
        MEM_T   <=     DEL_WE_N;                -- active low
113
        WE_N    <= not XM_WE;
114
        XM_OE_N <=     XM_WE;
115
        XM_CE_N <= not XM_CE;
116
 
117
        p147: iobuf     PORT MAP(I => XM_WDAT(7), O => XM_RDAT(7), T => MEM_T, IO => XM_DIO(7));
118
        p144: iobuf     PORT MAP(I => XM_WDAT(0), O => XM_RDAT(0), T => MEM_T, IO => XM_DIO(0));
119
        p142: iobuf     PORT MAP(I => XM_WDAT(6), O => XM_RDAT(6), T => MEM_T, IO => XM_DIO(6));
120
        p141: iobuf     PORT MAP(I => XM_WDAT(1), O => XM_RDAT(1), T => MEM_T, IO => XM_DIO(1));
121
        p140: iobuf     PORT MAP(I => XM_WDAT(5), O => XM_RDAT(5), T => MEM_T, IO => XM_DIO(5));
122
        p139: iobuf     PORT MAP(I => XM_WDAT(2), O => XM_RDAT(2), T => MEM_T, IO => XM_DIO(2));
123
        p133: iobuf     PORT MAP(I => XM_WDAT(4), O => XM_RDAT(4), T => MEM_T, IO => XM_DIO(4));
124
        p131: iobuf     PORT MAP(I => XM_WDAT(3), O => XM_RDAT(3), T => MEM_T, IO => XM_DIO(3));
125
        p63:  iobuf     PORT MAP(I => WE_N,               O => DEL_WE_N,   T => '0',   IO => XM_WE_N);
126
 
127 9 jsauermann
        process(CLK40)
128
        begin
129
                if (rising_edge(CLK40)) then
130
                        LCLK <= not LCLK;
131
                end if;
132
        end process;
133
 
134 2 jsauermann
end behavioral;

powered by: WebSVN 2.1.0

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