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

Subversion Repositories socwire

[/] [socwire/] [trunk/] [Switch/] [cell.vhd] - Blame information for rev 17

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 bjoerno
---====================== Start Software License ========================---
2
--==                                                                    ==--
3
--== This license governs the use of this software, and your use of     ==--
4
--== this software constitutes acceptance of this license. Agreement    ==--
5
--== with all points is required to use this software.                  ==--
6
--==                                                                    ==--
7
--== 1. This source file may be used and distributed without            ==--
8
--== restriction provided that this software license statement is not   ==--
9
--== removed from the file and that any derivative work contains the    ==--
10
--== original software license notice and the associated disclaimer.    ==--
11
--==                                                                    ==--
12
--== 2. This source file is free software; you can redistribute it      ==--
13
--== and/or modify it under the restriction that UNDER NO CIRCUMTANCES  ==--
14
--== this Software is to be used to CONSTRUCT a SPACEWIRE INTERFACE     ==--
15
--== This implies modification and/or derivative work of this Software. ==--
16
--==                                                                    ==--
17
--== 3. This source is distributed in the hope that it will be useful,  ==--
18
--== but WITHOUT ANY WARRANTY; without even the implied warranty of     ==--
19
--== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               ==--
20
--==                                                                    ==--
21
--== Your rights under this license are terminated immediately if you   ==--
22
--== breach it in any way.                                              ==--
23
--==                                                                    ==--
24
---======================= End Software License =========================---
25
 
26
 
27
---====================== Start Copyright Notice ========================---
28
--==                                                                    ==--
29
--== Filename ..... cell.vhd                                            ==--
30
--== Download ..... http://www.ida.ing.tu-bs.de                         ==--
31
--== Company ...... IDA TU Braunschweig, Prof. Dr.-Ing. Harald Michalik ==--
32
--== Authors ...... Björn Osterloh, Karel Kotarowski                    ==--
33
--== Contact ...... Björn Osterloh (b.osterloh@tu-bs.de)                ==--
34
--== Copyright .... Copyright (c) 2008 IDA                              ==--
35
--== Project ...... SoCWire Switch                                      ==--
36
--== Version ...... 1.00                                                ==--
37
--== Conception ... 11 November 2008                                    ==--
38
--== Modified ..... N/A                                                 ==--
39
--==                                                                    ==--
40
---======================= End Copyright Notice =========================---
41
LIBRARY IEEE;
42
USE IEEE.STD_LOGIC_1164.ALL;
43
 
44
ENTITY cell IS
45
  PORT(
46
       --==  General Inputs ==--
47
 
48
       clk                 : IN  STD_LOGIC;
49
       rst                 : IN  STD_LOGIC;
50
 
51
       --== Vertical Connectivity ==--
52
 
53
       op_eop              : IN  STD_LOGIC;
54
       op_active           : IN  STD_LOGIC;
55
       op_taken_in         : IN  STD_LOGIC;
56
       op_taken_out        : OUT STD_LOGIC;
57
 
58
       --== Horizontal Connectivity ==--
59
 
60
       enable              : IN  STD_LOGIC;
61
       connect             : IN  STD_LOGIC;
62
       ip_eop              : IN  STD_LOGIC;
63
       op_wanted           : IN  STD_LOGIC;
64
       ip_taken_in         : IN  STD_LOGIC;
65
       ip_taken_out        : OUT STD_LOGIC;
66
       connected           : OUT STD_LOGIC
67
      );
68
END cell;
69
 
70
 
71
ARCHITECTURE rtl OF cell IS
72
 
73
---=======================---
74
--== Signal Declarations ==--
75
---=======================---
76
 
77
SIGNAL rst_int               : STD_LOGIC;
78
SIGNAL rst_held              : STD_LOGIC;
79
SIGNAL connected_int         : STD_LOGIC;
80
SIGNAL connect_cell          : STD_LOGIC;
81
SIGNAL connected_i           : STD_LOGIC;
82
 
83
BEGIN
84
 
85
  ---=======================---
86
  --== Delayed reset logic ==--
87
  ---=======================---
88
 
89
  PROCESS(clk)
90
  BEGIN
91
    IF RISING_EDGE(clk) THEN
92
      IF (rst = '1') OR (rst_int = '1') THEN
93
        rst_held <= '0';
94
      ELSE
95
        rst_held <= (connected_int AND op_eop) OR rst_held;
96
      END IF;
97
    END IF;
98
  END PROCESS;
99
 
100
  rst_int <= enable AND connected_int AND (op_eop OR rst_held);
101
 
102
   ---==============================---
103
  --== Determine connection logic ==--
104
  ---==============================---
105
 
106
  connect_cell <= NOT(ip_taken_in) AND NOT(op_taken_in) AND op_wanted AND
107
                  op_active AND NOT(rst_int) AND connect;
108
 
109
  ---====================---
110
  --== Connection logic ==--
111
  ---====================---
112
 
113
  PROCESS(clk)
114
  BEGIN
115
    IF RISING_EDGE(clk) THEN
116
      IF (rst = '1') OR (rst_int = '1') THEN
117
        connected_int <= '0';
118
      ELSIF (enable = '1') THEN
119
        connected_int <= connect_cell OR connected_int;
120
      END IF;
121
    END IF;
122
  END PROCESS;
123
 
124
  ---===================---
125
  --== Connected logic ==--
126
  ---===================---
127
 
128
  PROCESS(clk)
129
  BEGIN
130
    IF RISING_EDGE(clk) THEN
131
      IF (rst = '1') OR (op_eop = '1') THEN
132
        connected_i <= '0';
133
      ELSIF (enable = '1') THEN
134
        connected_i <= connect_cell OR connected_i;
135
      END IF;
136
    END IF;
137
  END PROCESS;
138
 
139
  connected <= connected_i;
140
 
141
  ---=====================---
142
  --== Input taken logic ==--
143
  ---=====================---
144
 
145
  PROCESS(clk)
146
  BEGIN
147
    IF RISING_EDGE(clk) THEN
148
      IF (rst = '1') OR (ip_eop = '1') THEN
149
        ip_taken_out <= '0';
150
      ELSIF (enable = '1') THEN
151
        ip_taken_out <= connect_cell OR ip_taken_in;
152
      END IF;
153
    END IF;
154
  END PROCESS;
155
 
156
  ---======================---
157
  --== Output taken logic ==--
158
  ---======================---
159
 
160
  PROCESS(clk)
161
  BEGIN
162
    IF RISING_EDGE(clk) THEN
163
      IF (rst = '1') OR (rst_int = '1') THEN
164
        op_taken_out <= '0';
165
      ELSIF (enable = '1') THEN
166
        op_taken_out <= connect_cell OR op_taken_in;
167
      END IF;
168
    END IF;
169
  END PROCESS;
170
 
171
END rtl;

powered by: WebSVN 2.1.0

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