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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [src/] [system/] [S2.vhdl] - Blame information for rev 34

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 lcdsgmtr
LIBRARY ieee;
2
USE ieee.std_logic_1164.ALL;
3
USE ieee.numeric_std.ALL;
4
USE work.S2LIB.ALL;
5
 
6
ENTITY S2 IS
7
 
8
  PORT (
9
    CLOCK  : IN  STD_LOGIC;
10
    RESET  : IN  STD_LOGIC;
11
    LED    : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
12
    SWITCH : IN  STD_LOGIC_VECTOR(7 DOWNTO 0);
13
    BUTTON : IN  STD_LOGIC_VECTOR(4 DOWNTO 0));
14
 
15
END ENTITY S2;
16
 
17
ARCHITECTURE Structural OF S2 IS
18
 
19
  SIGNAL CLK : STD_LOGIC;
20
  SIGNAL RST : STD_LOGIC;
21
 
22
  SIGNAL DATA_BUS    : STD_LOGIC_VECTOR(15 DOWNTO 0);
23
  SIGNAL ADDRESS_BUS : STD_LOGIC_VECTOR(14 DOWNTO 0);
24
  SIGNAL RD          : STD_LOGIC;
25
  SIGNAL WR          : STD_LOGIC;
26
 
27
  SIGNAL BA_ADDR_SEL : STD_LOGIC;
28
  SIGNAL BA_ICC_ACK  : STD_LOGIC;
29
  SIGNAL BA_DCC_ACK  : STD_LOGIC;
30
 
31
  SIGNAL ICC_RD      : STD_LOGIC;
32
  SIGNAL ICC_WR      : STD_LOGIC;
33
  SIGNAL ICC_ADDRESS : STD_LOGIC_VECTOR(14 DOWNTO 0);
34
  SIGNAL ICC_DATA    : STD_LOGIC_VECTOR(15 DOWNTO 0);
35
  SIGNAL DCC_RD      : STD_LOGIC;
36
  SIGNAL DCC_WR      : STD_LOGIC;
37
  SIGNAL DCC_ADDRESS : STD_LOGIC_VECTOR(14 DOWNTO 0);
38
  SIGNAL DCC_DATA    : STD_LOGIC_VECTOR(15 DOWNTO 0);
39
 
40
  SIGNAL CPU_IF          : STD_LOGIC;
41
  SIGNAL CPU_INSTR_ADDR  : STD_LOGIC_VECTOR(14 DOWNTO 0);
42
  SIGNAL CPU_INSTRUCTION : STD_LOGIC_VECTOR(15 DOWNTO 0);
43
 
44
  SIGNAL CPU_RD        : STD_LOGIC;
45
  SIGNAL CPU_WR        : STD_LOGIC;
46
  SIGNAL CPU_DATA_ADDR : STD_LOGIC_VECTOR(14 DOWNTO 0);
47
  SIGNAL CPU_DATA_OUT  : STD_LOGIC_VECTOR(15 DOWNTO 0);
48
  SIGNAL CPU_DATA_IN   : STD_LOGIC_VECTOR(15 DOWNTO 0);
49
 
50
  SIGNAL MEM_DATA : STD_LOGIC_VECTOR(15 DOWNTO 0);
51
 
52
BEGIN  -- ARCHITECTURE Structural
53
 
54 34 lcdsgmtr
  CLK <= CLOCK;
55
  RST <= RESET;
56
 
57 31 lcdsgmtr
  BA1 : S2ARB
58
    PORT MAP (
59
      -- Main component connections
60
      CLK               => CLK,
61
      RST               => RST,
62
      -- Bus requests from ICC
63
      I_RD_ICC          => ICC_RD,
64
      I_WR_ICC          => ICC_WR,
65
      -- Bus requests from DCC
66
      I_RD_DCC          => DCC_RD,
67
      I_WR_DCC          => DCC_WR,
68
      -- Arbiter control signals
69
      O_ADDRESS_MUX_SEL => BA_ADDR_SEL,
70
      O_ACK_ICC         => BA_ICC_ACK,
71
      O_ACK_DCC         => BA_DCC_ACK);
72
 
73
 
74
  ICC1 : S2ICC
75
    PORT MAP (
76
      -- Main component connections
77
      CLK               => CLK,
78
      RST               => RST,
79
      -- To main bus
80
      O_ADDRESS         => ICC_ADDRESS,
81
      O_DATA            => ICC_DATA,
82
      O_RD              => ICC_RD,
83
      O_WR              => ICC_WR,
84
      -- From bus arbiter
85
      I_ACK             => BA_ICC_ACK,
86
      -- From main bus
87
      I_ADDRESS         => ADDRESS_BUS,
88
      I_DATA            => DATA_BUS,
89
      I_RD              => RD,
90
      I_WR              => WR,
91
      -- CPU specific connections
92
      I_CPU_IF          => CPU_IF,
93
      I_CPU_INSTR_ADDR  => CPU_INSTR_ADDR,
94 33 lcdsgmtr
      O_CPU_INSTRUCTION => CPU_INSTRUCTION);
95 31 lcdsgmtr
 
96
  DCC1 : S2DCC
97
    PORT MAP (
98
      -- Main component connections
99
      CLK             => CLK,
100
      RST             => RST,
101
      -- To main bus
102
      O_ADDRESS       => DCC_ADDRESS,
103
      O_DATA          => DCC_DATA,
104
      O_RD            => DCC_RD,
105
      O_WR            => DCC_WR,
106
      -- From bus arbiter
107
      I_ACK           => BA_DCC_ACK,
108
      -- From main bus
109
      I_ADDRESS       => ADDRESS_BUS,
110
      I_DATA          => DATA_BUS,
111
      I_RD            => RD,
112
      I_WR            => WR,
113
      -- CPU specific connections
114
      I_CPU_RD        => CPU_RD,
115
      I_CPU_WR        => CPU_WR,
116 33 lcdsgmtr
      I_CPU_DATA_ADDR => CPU_DATA_ADDR,
117 31 lcdsgmtr
      I_CPU_DATA      => CPU_DATA_OUT,
118
      O_CPU_DATA      => CPU_DATA_IN);
119
 
120
  CPU1 : S2CPU
121
    PORT MAP (
122
      -- Main component connections
123
      CLK           => CLK,
124
      RST           => RST,
125
      -- Instruction cache connections
126
      O_IF          => CPU_IF,
127
      O_INSTR_ADDR  => CPU_INSTR_ADDR,
128
      I_INSTRUCTION => CPU_INSTRUCTION,
129
      -- Data cache connections
130
      O_RD          => CPU_RD,
131
      O_WR          => CPU_WR,
132 33 lcdsgmtr
      O_DATA_ADDR   => CPU_DATA_ADDR,
133 31 lcdsgmtr
      O_DATA        => CPU_DATA_OUT,
134
      I_DATA        => CPU_DATA_IN);
135
 
136
  MEM1 : S2MEM
137
    PORT MAP (
138
      CLK       => CLK,
139
      RST       => RST,
140
      I_RD      => RD,
141
      I_WR      => WR,
142
      I_ADDRESS => ADDRESS_BUS,
143
      I_DATA    => DATA_BUS,
144
      O_DATA    => MEM_DATA);
145
 
146
 
147
 
148
 
149
 
150
END ARCHITECTURE Structural;

powered by: WebSVN 2.1.0

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