Browse Source

add EFB configured as SPI slave

T. Meissner 5 years ago
parent
commit
67c3c25ac4
1 changed files with 231 additions and 0 deletions
  1. 231
    0
      raspiFpga/src/EfbSpiSlave.vhd

+ 231
- 0
raspiFpga/src/EfbSpiSlave.vhd View File

@@ -0,0 +1,231 @@
1
+-- VHDL netlist generated by SCUBA Diamond_2.2_Production (99)
2
+-- Module  Version: 1.1
3
+--/usr/local/diamond/2.2/ispfpga/bin/lin/scuba -w -n EfbSpiSlave -lang vhdl -synth synplify -bus_exp 7 -bb -type efb -arch xo2c00 -freq 26.6 -spi -spi_mode Slave -spi_rxr -spi_txr -spi_en -wb -dev 7000 -e 
4
+
5
+-- Thu Dec  4 21:37:18 2014
6
+
7
+library IEEE;
8
+use IEEE.std_logic_1164.all;
9
+-- synopsys translate_off
10
+library MACHXO2;
11
+use MACHXO2.components.all;
12
+-- synopsys translate_on
13
+
14
+entity EfbSpiSlave is
15
+    port (
16
+        wb_clk_i: in  std_logic; 
17
+        wb_rst_i: in  std_logic; 
18
+        wb_cyc_i: in  std_logic; 
19
+        wb_stb_i: in  std_logic; 
20
+        wb_we_i: in  std_logic; 
21
+        wb_adr_i: in  std_logic_vector(7 downto 0); 
22
+        wb_dat_i: in  std_logic_vector(7 downto 0); 
23
+        wb_dat_o: out  std_logic_vector(7 downto 0); 
24
+        wb_ack_o: out  std_logic; 
25
+        spi_clk: inout  std_logic; 
26
+        spi_miso: inout  std_logic; 
27
+        spi_mosi: inout  std_logic; 
28
+        spi_scsn: in  std_logic; 
29
+        spi_irq: out  std_logic);
30
+end EfbSpiSlave;
31
+
32
+architecture Structure of EfbSpiSlave is
33
+
34
+    -- internal signal declarations
35
+    signal scuba_vhi: std_logic;
36
+    signal spi_mosi_oe: std_logic;
37
+    signal spi_mosi_o: std_logic;
38
+    signal spi_miso_oe: std_logic;
39
+    signal spi_miso_o: std_logic;
40
+    signal spi_clk_oe: std_logic;
41
+    signal spi_clk_o: std_logic;
42
+    signal spi_mosi_i: std_logic;
43
+    signal spi_miso_i: std_logic;
44
+    signal spi_clk_i: std_logic;
45
+    signal scuba_vlo: std_logic;
46
+
47
+    -- local component declarations
48
+    component VHI
49
+        port (Z: out  std_logic);
50
+    end component;
51
+    component VLO
52
+        port (Z: out  std_logic);
53
+    end component;
54
+    component BB
55
+        port (I: in  std_logic; T: in  std_logic; O: out  std_logic; 
56
+            B: inout  std_logic);
57
+    end component;
58
+    component EFB
59
+        generic (EFB_I2C1 : in String; EFB_I2C2 : in String; 
60
+                EFB_SPI : in String; EFB_TC : in String; 
61
+                EFB_TC_PORTMODE : in String; EFB_UFM : in String; 
62
+                EFB_WB_CLK_FREQ : in String; DEV_DENSITY : in String; 
63
+                UFM_INIT_PAGES : in Integer; 
64
+                UFM_INIT_START_PAGE : in Integer; 
65
+                UFM_INIT_ALL_ZEROS : in String; 
66
+                UFM_INIT_FILE_NAME : in String; 
67
+                UFM_INIT_FILE_FORMAT : in String; 
68
+                I2C1_ADDRESSING : in String; I2C2_ADDRESSING : in String; 
69
+                I2C1_SLAVE_ADDR : in String; I2C2_SLAVE_ADDR : in String; 
70
+                I2C1_BUS_PERF : in String; I2C2_BUS_PERF : in String; 
71
+                I2C1_CLK_DIVIDER : in Integer; 
72
+                I2C2_CLK_DIVIDER : in Integer; I2C1_GEN_CALL : in String; 
73
+                I2C2_GEN_CALL : in String; I2C1_WAKEUP : in String; 
74
+                I2C2_WAKEUP : in String; SPI_MODE : in String; 
75
+                SPI_CLK_DIVIDER : in Integer; SPI_LSB_FIRST : in String; 
76
+                SPI_CLK_INV : in String; SPI_PHASE_ADJ : in String; 
77
+                SPI_SLAVE_HANDSHAKE : in String; 
78
+                SPI_INTR_TXRDY : in String; SPI_INTR_RXRDY : in String; 
79
+                SPI_INTR_TXOVR : in String; SPI_INTR_RXOVR : in String; 
80
+                SPI_WAKEUP : in String; TC_MODE : in String; 
81
+                TC_SCLK_SEL : in String; TC_CCLK_SEL : in Integer; 
82
+                GSR : in String; TC_TOP_SET : in Integer; 
83
+                TC_OCR_SET : in Integer; TC_OC_MODE : in String; 
84
+                TC_RESETN : in String; TC_TOP_SEL : in String; 
85
+                TC_OV_INT : in String; TC_OCR_INT : in String; 
86
+                TC_ICR_INT : in String; TC_OVERFLOW : in String; 
87
+                TC_ICAPTURE : in String);
88
+        port (WBCLKI: in  std_logic; WBRSTI: in  std_logic; 
89
+            WBCYCI: in  std_logic; WBSTBI: in  std_logic; 
90
+            WBWEI: in  std_logic; WBADRI7: in  std_logic; 
91
+            WBADRI6: in  std_logic; WBADRI5: in  std_logic; 
92
+            WBADRI4: in  std_logic; WBADRI3: in  std_logic; 
93
+            WBADRI2: in  std_logic; WBADRI1: in  std_logic; 
94
+            WBADRI0: in  std_logic; WBDATI7: in  std_logic; 
95
+            WBDATI6: in  std_logic; WBDATI5: in  std_logic; 
96
+            WBDATI4: in  std_logic; WBDATI3: in  std_logic; 
97
+            WBDATI2: in  std_logic; WBDATI1: in  std_logic; 
98
+            WBDATI0: in  std_logic; PLL0DATI7: in  std_logic; 
99
+            PLL0DATI6: in  std_logic; PLL0DATI5: in  std_logic; 
100
+            PLL0DATI4: in  std_logic; PLL0DATI3: in  std_logic; 
101
+            PLL0DATI2: in  std_logic; PLL0DATI1: in  std_logic; 
102
+            PLL0DATI0: in  std_logic; PLL0ACKI: in  std_logic; 
103
+            PLL1DATI7: in  std_logic; PLL1DATI6: in  std_logic; 
104
+            PLL1DATI5: in  std_logic; PLL1DATI4: in  std_logic; 
105
+            PLL1DATI3: in  std_logic; PLL1DATI2: in  std_logic; 
106
+            PLL1DATI1: in  std_logic; PLL1DATI0: in  std_logic; 
107
+            PLL1ACKI: in  std_logic; I2C1SCLI: in  std_logic; 
108
+            I2C1SDAI: in  std_logic; I2C2SCLI: in  std_logic; 
109
+            I2C2SDAI: in  std_logic; SPISCKI: in  std_logic; 
110
+            SPIMISOI: in  std_logic; SPIMOSII: in  std_logic; 
111
+            SPISCSN: in  std_logic; TCCLKI: in  std_logic; 
112
+            TCRSTN: in  std_logic; TCIC: in  std_logic; 
113
+            UFMSN: in  std_logic; WBDATO7: out  std_logic; 
114
+            WBDATO6: out  std_logic; WBDATO5: out  std_logic; 
115
+            WBDATO4: out  std_logic; WBDATO3: out  std_logic; 
116
+            WBDATO2: out  std_logic; WBDATO1: out  std_logic; 
117
+            WBDATO0: out  std_logic; WBACKO: out  std_logic; 
118
+            PLLCLKO: out  std_logic; PLLRSTO: out  std_logic; 
119
+            PLL0STBO: out  std_logic; PLL1STBO: out  std_logic; 
120
+            PLLWEO: out  std_logic; PLLADRO4: out  std_logic; 
121
+            PLLADRO3: out  std_logic; PLLADRO2: out  std_logic; 
122
+            PLLADRO1: out  std_logic; PLLADRO0: out  std_logic; 
123
+            PLLDATO7: out  std_logic; PLLDATO6: out  std_logic; 
124
+            PLLDATO5: out  std_logic; PLLDATO4: out  std_logic; 
125
+            PLLDATO3: out  std_logic; PLLDATO2: out  std_logic; 
126
+            PLLDATO1: out  std_logic; PLLDATO0: out  std_logic; 
127
+            I2C1SCLO: out  std_logic; I2C1SCLOEN: out  std_logic; 
128
+            I2C1SDAO: out  std_logic; I2C1SDAOEN: out  std_logic; 
129
+            I2C2SCLO: out  std_logic; I2C2SCLOEN: out  std_logic; 
130
+            I2C2SDAO: out  std_logic; I2C2SDAOEN: out  std_logic; 
131
+            I2C1IRQO: out  std_logic; I2C2IRQO: out  std_logic; 
132
+            SPISCKO: out  std_logic; SPISCKEN: out  std_logic; 
133
+            SPIMISOO: out  std_logic; SPIMISOEN: out  std_logic; 
134
+            SPIMOSIO: out  std_logic; SPIMOSIEN: out  std_logic; 
135
+            SPIMCSN7: out  std_logic; SPIMCSN6: out  std_logic; 
136
+            SPIMCSN5: out  std_logic; SPIMCSN4: out  std_logic; 
137
+            SPIMCSN3: out  std_logic; SPIMCSN2: out  std_logic; 
138
+            SPIMCSN1: out  std_logic; SPIMCSN0: out  std_logic; 
139
+            SPICSNEN: out  std_logic; SPIIRQO: out  std_logic; 
140
+            TCINT: out  std_logic; TCOC: out  std_logic; 
141
+            WBCUFMIRQ: out  std_logic; CFGWAKE: out  std_logic; 
142
+            CFGSTDBY: out  std_logic);
143
+    end component;
144
+    attribute NGD_DRC_MASK : integer;
145
+    attribute NGD_DRC_MASK of Structure : architecture is 1;
146
+
147
+begin
148
+    -- component instantiation statements
149
+    scuba_vhi_inst: VHI
150
+        port map (Z=>scuba_vhi);
151
+
152
+    BBspi_mosi: BB
153
+        port map (I=>spi_mosi_o, T=>spi_mosi_oe, O=>spi_mosi_i, 
154
+            B=>spi_mosi);
155
+
156
+    BBspi_miso: BB
157
+        port map (I=>spi_miso_o, T=>spi_miso_oe, O=>spi_miso_i, 
158
+            B=>spi_miso);
159
+
160
+    BBspi_clk: BB
161
+        port map (I=>spi_clk_o, T=>spi_clk_oe, O=>spi_clk_i, B=>spi_clk);
162
+
163
+    scuba_vlo_inst: VLO
164
+        port map (Z=>scuba_vlo);
165
+
166
+    EFBInst_0: EFB
167
+        generic map (UFM_INIT_FILE_FORMAT=> "HEX", UFM_INIT_FILE_NAME=> "NONE", 
168
+        UFM_INIT_ALL_ZEROS=> "ENABLED", UFM_INIT_START_PAGE=>  0, 
169
+        UFM_INIT_PAGES=>  0, DEV_DENSITY=> "7000L", EFB_UFM=> "DISABLED", 
170
+        TC_ICAPTURE=> "DISABLED", TC_OVERFLOW=> "DISABLED", TC_ICR_INT=> "OFF", 
171
+        TC_OCR_INT=> "OFF", TC_OV_INT=> "OFF", TC_TOP_SEL=> "OFF", 
172
+        TC_RESETN=> "ENABLED", TC_OC_MODE=> "TOGGLE", TC_OCR_SET=>  32767, 
173
+        TC_TOP_SET=>  65535, GSR=> "ENABLED", TC_CCLK_SEL=>  1, TC_MODE=> "CTCM", 
174
+        TC_SCLK_SEL=> "PCLOCK", EFB_TC_PORTMODE=> "WB", EFB_TC=> "DISABLED", 
175
+        SPI_WAKEUP=> "DISABLED", SPI_INTR_RXOVR=> "DISABLED", 
176
+        SPI_INTR_TXOVR=> "DISABLED", SPI_INTR_RXRDY=> "ENABLED", 
177
+        SPI_INTR_TXRDY=> "ENABLED", SPI_SLAVE_HANDSHAKE=> "DISABLED", 
178
+        SPI_PHASE_ADJ=> "DISABLED", SPI_CLK_INV=> "DISABLED", 
179
+        SPI_LSB_FIRST=> "DISABLED", SPI_CLK_DIVIDER=>  1, SPI_MODE=> "SLAVE", 
180
+        EFB_SPI=> "ENABLED", I2C2_WAKEUP=> "DISABLED", I2C2_GEN_CALL=> "DISABLED", 
181
+        I2C2_CLK_DIVIDER=>  1, I2C2_BUS_PERF=> "100kHz", I2C2_SLAVE_ADDR=> "0b1000010", 
182
+        I2C2_ADDRESSING=> "7BIT", EFB_I2C2=> "DISABLED", I2C1_WAKEUP=> "DISABLED", 
183
+        I2C1_GEN_CALL=> "DISABLED", I2C1_CLK_DIVIDER=>  1, I2C1_BUS_PERF=> "100kHz", 
184
+        I2C1_SLAVE_ADDR=> "0b1000001", I2C1_ADDRESSING=> "7BIT", 
185
+        EFB_I2C1=> "DISABLED", EFB_WB_CLK_FREQ=> "26.6")
186
+        port map (WBCLKI=>wb_clk_i, WBRSTI=>wb_rst_i, WBCYCI=>wb_cyc_i, 
187
+            WBSTBI=>wb_stb_i, WBWEI=>wb_we_i, WBADRI7=>wb_adr_i(7), 
188
+            WBADRI6=>wb_adr_i(6), WBADRI5=>wb_adr_i(5), 
189
+            WBADRI4=>wb_adr_i(4), WBADRI3=>wb_adr_i(3), 
190
+            WBADRI2=>wb_adr_i(2), WBADRI1=>wb_adr_i(1), 
191
+            WBADRI0=>wb_adr_i(0), WBDATI7=>wb_dat_i(7), 
192
+            WBDATI6=>wb_dat_i(6), WBDATI5=>wb_dat_i(5), 
193
+            WBDATI4=>wb_dat_i(4), WBDATI3=>wb_dat_i(3), 
194
+            WBDATI2=>wb_dat_i(2), WBDATI1=>wb_dat_i(1), 
195
+            WBDATI0=>wb_dat_i(0), PLL0DATI7=>scuba_vlo, 
196
+            PLL0DATI6=>scuba_vlo, PLL0DATI5=>scuba_vlo, 
197
+            PLL0DATI4=>scuba_vlo, PLL0DATI3=>scuba_vlo, 
198
+            PLL0DATI2=>scuba_vlo, PLL0DATI1=>scuba_vlo, 
199
+            PLL0DATI0=>scuba_vlo, PLL0ACKI=>scuba_vlo, 
200
+            PLL1DATI7=>scuba_vlo, PLL1DATI6=>scuba_vlo, 
201
+            PLL1DATI5=>scuba_vlo, PLL1DATI4=>scuba_vlo, 
202
+            PLL1DATI3=>scuba_vlo, PLL1DATI2=>scuba_vlo, 
203
+            PLL1DATI1=>scuba_vlo, PLL1DATI0=>scuba_vlo, 
204
+            PLL1ACKI=>scuba_vlo, I2C1SCLI=>scuba_vlo, 
205
+            I2C1SDAI=>scuba_vlo, I2C2SCLI=>scuba_vlo, 
206
+            I2C2SDAI=>scuba_vlo, SPISCKI=>spi_clk_i, 
207
+            SPIMISOI=>spi_miso_i, SPIMOSII=>spi_mosi_i, 
208
+            SPISCSN=>spi_scsn, TCCLKI=>scuba_vlo, TCRSTN=>scuba_vlo, 
209
+            TCIC=>scuba_vlo, UFMSN=>scuba_vhi, WBDATO7=>wb_dat_o(7), 
210
+            WBDATO6=>wb_dat_o(6), WBDATO5=>wb_dat_o(5), 
211
+            WBDATO4=>wb_dat_o(4), WBDATO3=>wb_dat_o(3), 
212
+            WBDATO2=>wb_dat_o(2), WBDATO1=>wb_dat_o(1), 
213
+            WBDATO0=>wb_dat_o(0), WBACKO=>wb_ack_o, PLLCLKO=>open, 
214
+            PLLRSTO=>open, PLL0STBO=>open, PLL1STBO=>open, PLLWEO=>open, 
215
+            PLLADRO4=>open, PLLADRO3=>open, PLLADRO2=>open, 
216
+            PLLADRO1=>open, PLLADRO0=>open, PLLDATO7=>open, 
217
+            PLLDATO6=>open, PLLDATO5=>open, PLLDATO4=>open, 
218
+            PLLDATO3=>open, PLLDATO2=>open, PLLDATO1=>open, 
219
+            PLLDATO0=>open, I2C1SCLO=>open, I2C1SCLOEN=>open, 
220
+            I2C1SDAO=>open, I2C1SDAOEN=>open, I2C2SCLO=>open, 
221
+            I2C2SCLOEN=>open, I2C2SDAO=>open, I2C2SDAOEN=>open, 
222
+            I2C1IRQO=>open, I2C2IRQO=>open, SPISCKO=>spi_clk_o, 
223
+            SPISCKEN=>spi_clk_oe, SPIMISOO=>spi_miso_o, 
224
+            SPIMISOEN=>spi_miso_oe, SPIMOSIO=>spi_mosi_o, 
225
+            SPIMOSIEN=>spi_mosi_oe, SPIMCSN7=>open, SPIMCSN6=>open, 
226
+            SPIMCSN5=>open, SPIMCSN4=>open, SPIMCSN3=>open, 
227
+            SPIMCSN2=>open, SPIMCSN1=>open, SPIMCSN0=>open, 
228
+            SPICSNEN=>open, SPIIRQO=>spi_irq, TCINT=>open, TCOC=>open, 
229
+            WBCUFMIRQ=>open, CFGWAKE=>open, CFGSTDBY=>open);
230
+
231
+end Structure;