1 | -- VHDL Entity FACT_FAD_lib.spi_interface.symbol
|
---|
2 | --
|
---|
3 | -- Created:
|
---|
4 | -- by - dneise.UNKNOWN (E5B-LABOR6)
|
---|
5 | -- at - 14:00:24 01.10.2010
|
---|
6 | --
|
---|
7 | -- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
|
---|
8 | --
|
---|
9 | LIBRARY ieee;
|
---|
10 | USE ieee.std_logic_1164.all;
|
---|
11 | USE ieee.std_logic_arith.all;
|
---|
12 | LIBRARY FACT_FAD_lib;
|
---|
13 | USE FACT_FAD_lib.fad_definitions.all;
|
---|
14 |
|
---|
15 | ENTITY spi_interface IS
|
---|
16 | PORT(
|
---|
17 | clk_50MHz : IN std_logic;
|
---|
18 | config_start : IN std_logic;
|
---|
19 | dac_array : IN dac_array_type;
|
---|
20 | config_ready : OUT std_logic;
|
---|
21 | config_started : OUT std_logic := '0';
|
---|
22 | dac_cs : OUT std_logic;
|
---|
23 | mosi : OUT std_logic := '0';
|
---|
24 | sclk : OUT std_logic;
|
---|
25 | sensor_array : OUT sensor_array_type;
|
---|
26 | sensor_cs : OUT std_logic_vector (3 DOWNTO 0);
|
---|
27 | sensor_ready : OUT std_logic;
|
---|
28 | miso : INOUT std_logic
|
---|
29 | );
|
---|
30 |
|
---|
31 | -- Declarations
|
---|
32 |
|
---|
33 | END spi_interface ;
|
---|
34 |
|
---|
35 | --
|
---|
36 | -- VHDL Architecture FACT_FAD_lib.spi_interface.struct
|
---|
37 | --
|
---|
38 | -- Created:
|
---|
39 | -- by - dneise.UNKNOWN (E5B-LABOR6)
|
---|
40 | -- at - 14:00:25 01.10.2010
|
---|
41 | --
|
---|
42 | -- Generated by Mentor Graphics' HDL Designer(TM) 2009.2 (Build 10)
|
---|
43 | --
|
---|
44 | LIBRARY ieee;
|
---|
45 | USE ieee.std_logic_1164.all;
|
---|
46 | USE ieee.std_logic_arith.all;
|
---|
47 | USE ieee.std_logic_unsigned.all;
|
---|
48 | LIBRARY FACT_FAD_lib;
|
---|
49 | USE FACT_FAD_lib.fad_definitions.all;
|
---|
50 | USE IEEE.NUMERIC_STD.ALL;
|
---|
51 |
|
---|
52 | LIBRARY FACT_FAD_lib;
|
---|
53 |
|
---|
54 | ARCHITECTURE struct OF spi_interface IS
|
---|
55 |
|
---|
56 | -- Architecture declarations
|
---|
57 |
|
---|
58 | -- Internal signal declarations
|
---|
59 | SIGNAL dac_config_ready : std_logic;
|
---|
60 | SIGNAL dac_config_start : std_logic;
|
---|
61 | SIGNAL dac_id : std_logic_vector(2 DOWNTO 0);
|
---|
62 | SIGNAL data : std_logic_vector(15 DOWNTO 0);
|
---|
63 | SIGNAL sensor_id : std_logic_vector(1 DOWNTO 0);
|
---|
64 | SIGNAL sensor_start : std_logic;
|
---|
65 | SIGNAL sensor_valid : std_logic;
|
---|
66 |
|
---|
67 | -- Implicit buffer signal declarations
|
---|
68 | SIGNAL sclk_internal : std_logic;
|
---|
69 |
|
---|
70 |
|
---|
71 | -- Component Declarations
|
---|
72 | COMPONENT spi_clock_generator
|
---|
73 | GENERIC (
|
---|
74 | CLK_DIVIDER : integer := 25 --2 MHz @ 50 MHz
|
---|
75 | );
|
---|
76 | PORT (
|
---|
77 | clk : IN std_logic;
|
---|
78 | sclk : OUT std_logic := '0'
|
---|
79 | );
|
---|
80 | END COMPONENT;
|
---|
81 | COMPONENT spi_controller
|
---|
82 | PORT (
|
---|
83 | clk : IN std_logic;
|
---|
84 | dac_id : IN std_logic_vector (2 DOWNTO 0);
|
---|
85 | dac_start : IN std_logic;
|
---|
86 | sensor_id : IN std_logic_vector (1 DOWNTO 0);
|
---|
87 | sensor_start : IN std_logic;
|
---|
88 | dac_cs : OUT std_logic := '1';
|
---|
89 | dac_ready : OUT std_logic := '0';
|
---|
90 | mosi : OUT std_logic := '0';
|
---|
91 | sensor_cs : OUT std_logic_vector (3 DOWNTO 0) := (others => '1');
|
---|
92 | sensor_valid : OUT std_logic := '0';
|
---|
93 | data : INOUT std_logic_vector (15 DOWNTO 0) := (others => 'Z');
|
---|
94 | miso : INOUT std_logic := 'Z'
|
---|
95 | );
|
---|
96 | END COMPONENT;
|
---|
97 | COMPONENT spi_distributor
|
---|
98 | GENERIC (
|
---|
99 | TEMP_MEASUREMENT_BEAT : integer := 5*10**6
|
---|
100 | );
|
---|
101 | PORT (
|
---|
102 | clk : IN std_logic;
|
---|
103 | config_start : IN std_logic;
|
---|
104 | dac_array : IN dac_array_type;
|
---|
105 | dac_config_ready : IN std_logic;
|
---|
106 | sensor_read_valid : IN std_logic;
|
---|
107 | config_ready : OUT std_logic := '0';
|
---|
108 | config_started : OUT std_logic := '0';
|
---|
109 | dac_config_start : OUT std_logic := '0';
|
---|
110 | dac_id : OUT std_logic_vector (2 DOWNTO 0) := (others => '0');
|
---|
111 | sensor_array : OUT sensor_array_type;
|
---|
112 | sensor_id : OUT std_logic_vector (1 DOWNTO 0) := (others => '0');
|
---|
113 | sensor_read_start : OUT std_logic := '0';
|
---|
114 | sensor_valid : OUT std_logic := '0';
|
---|
115 | data : INOUT std_logic_vector (15 DOWNTO 0) := (others => 'Z')
|
---|
116 | );
|
---|
117 | END COMPONENT;
|
---|
118 |
|
---|
119 | -- Optional embedded configurations
|
---|
120 | -- pragma synthesis_off
|
---|
121 | FOR ALL : spi_clock_generator USE ENTITY FACT_FAD_lib.spi_clock_generator;
|
---|
122 | FOR ALL : spi_controller USE ENTITY FACT_FAD_lib.spi_controller;
|
---|
123 | FOR ALL : spi_distributor USE ENTITY FACT_FAD_lib.spi_distributor;
|
---|
124 | -- pragma synthesis_on
|
---|
125 |
|
---|
126 |
|
---|
127 | BEGIN
|
---|
128 |
|
---|
129 | -- Instance port mappings.
|
---|
130 | I_spi_clkgen : spi_clock_generator
|
---|
131 | GENERIC MAP (
|
---|
132 | CLK_DIVIDER => 25 --2 MHz @ 50 MHz
|
---|
133 | )
|
---|
134 | PORT MAP (
|
---|
135 | clk => clk_50MHz,
|
---|
136 | sclk => sclk_internal
|
---|
137 | );
|
---|
138 | I_spi_controller : spi_controller
|
---|
139 | PORT MAP (
|
---|
140 | clk => sclk_internal,
|
---|
141 | miso => miso,
|
---|
142 | mosi => mosi,
|
---|
143 | dac_id => dac_id,
|
---|
144 | sensor_id => sensor_id,
|
---|
145 | data => data,
|
---|
146 | dac_cs => dac_cs,
|
---|
147 | sensor_cs => sensor_cs,
|
---|
148 | dac_start => dac_config_start,
|
---|
149 | dac_ready => dac_config_ready,
|
---|
150 | sensor_start => sensor_start,
|
---|
151 | sensor_valid => sensor_valid
|
---|
152 | );
|
---|
153 | I_spi_distributor : spi_distributor
|
---|
154 | GENERIC MAP (
|
---|
155 | TEMP_MEASUREMENT_BEAT => 5*10**6
|
---|
156 | )
|
---|
157 | PORT MAP (
|
---|
158 | clk => sclk_internal,
|
---|
159 | config_start => config_start,
|
---|
160 | config_ready => config_ready,
|
---|
161 | config_started => config_started,
|
---|
162 | sensor_valid => sensor_ready,
|
---|
163 | dac_array => dac_array,
|
---|
164 | sensor_array => sensor_array,
|
---|
165 | dac_config_start => dac_config_start,
|
---|
166 | dac_config_ready => dac_config_ready,
|
---|
167 | sensor_read_start => sensor_start,
|
---|
168 | sensor_read_valid => sensor_valid,
|
---|
169 | dac_id => dac_id,
|
---|
170 | sensor_id => sensor_id,
|
---|
171 | data => data
|
---|
172 | );
|
---|
173 |
|
---|
174 | -- Implicit buffered output assignments
|
---|
175 | sclk <= sclk_internal;
|
---|
176 |
|
---|
177 | END struct;
|
---|