2
2
-- License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
-- file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
4
--
5
- -- Copyright 2024 Oxide Computer Company
5
+ -- Copyright 2025 Oxide Computer Company
6
6
7
7
-- Cosmo Front Hot-plug FPGA targeting an ice40 HX8k
8
- -- Pin names snapshot from 20Nov2024
9
8
10
9
11
10
library ieee;
@@ -17,7 +16,6 @@ entity cosmo_hp_top is
17
16
port (
18
17
clk_50mhz_fpga2: in std_logic ;
19
18
sp_to_fpga2_system_reset_l: in std_logic ;
20
-
21
19
-- CEM A
22
20
cema_to_fpga2_alert_l : in std_logic ;
23
21
cema_to_fpga2_ifdet_l : in std_logic ;
@@ -137,7 +135,7 @@ entity cosmo_hp_top is
137
135
-- MCIO I/F
138
136
v12_mcio_a0hp_pg: in std_logic ;
139
137
fpga2_to_mcio_perst_l: out std_logic ;
140
- fpga2_to_mcio_prpe: out std_logic ;
138
+ fpga2_to_mcio_prpe: in std_logic ; -- TODO, confirm Hi-Z works with yosys + ghdl
141
139
fpga2_to_v12_mcio_a0hp_hsc_en: out std_logic ;
142
140
-- FPGA1 I/F
143
141
fpga1_to_fpga2_io: in std_logic_vector (5 downto 0 );
@@ -148,7 +146,7 @@ entity cosmo_hp_top is
148
146
fpga2_to_sp_int_l: in std_logic_vector (2 downto 0 ); -- 3..1 in sch
149
147
smbus_sp_to_fpga2_smclk: inout std_logic ;
150
148
smbus_sp_to_fpga2_smdat: inout std_logic ;
151
- spi_fpga2_to_sp_mux_dat: in std_logic ;
149
+ spi_fpga2_to_sp_mux_dat: out std_logic ;
152
150
spi_sp_mux_to_fpga2_cs_l : in std_logic ;
153
151
spi_sp_mux_to_fpga2_dat : in std_logic ;
154
152
spi_sp_mux_to_fpga2_sck : in std_logic ;
@@ -170,7 +168,71 @@ entity cosmo_hp_top is
170
168
end entity ;
171
169
172
170
architecture rtl of cosmo_hp_top is
173
-
171
+ signal led_blink_cntr: unsigned (24 downto 0 ) := (others => '0' );
172
+ signal reset_50m: std_logic ;
174
173
begin
175
174
175
+ -- Reset synchronizer
176
+ clk125m_sync : entity work .async_reset_bridge
177
+ generic map (
178
+ async_reset_active_level => '0'
179
+ )
180
+ port map (
181
+ clk => clk_50mhz_fpga2,
182
+ reset_async => sp_to_fpga2_system_reset_l,
183
+ reset_sync => reset_50m -- this is our synchronized reset now
184
+ );
185
+
186
+ -- Simple blinking LED based on a counter
187
+ led_blink : process (clk_50mhz_fpga2, reset_50m)
188
+ begin
189
+ if reset_50m then
190
+ led_blink_cntr <= (others => '0' );
191
+ elsif rising_edge (clk_50mhz_fpga2) then
192
+ led_blink_cntr <= led_blink_cntr + 1 ;
193
+ end if ;
194
+ end process ;
195
+ fpga2_status_led <= led_blink_cntr(led_blink_cntr'high );
196
+
197
+ -- placeholder mcio stuff
198
+ fpga2_to_mcio_perst_l <= '0' ;
199
+ fpga2_to_v12_mcio_a0hp_hsc_en <= '0' ;
200
+
201
+ -- Our SPI target block
202
+ spi_axi_controller_inst : entity work .spi_axi_controller
203
+ port map (
204
+ clk => clk_50mhz_fpga2,
205
+ reset => reset_50m,
206
+ csn => spi_sp_mux_to_fpga2_cs_l,
207
+ sclk => spi_sp_mux_to_fpga2_sck,
208
+ copi => spi_sp_mux_to_fpga2_dat,
209
+ cipo => spi_fpga2_to_sp_mux_dat,
210
+ awvalid => open ,
211
+ awready => '1' ,
212
+ awaddr => open ,
213
+ wvalid => open ,
214
+ wready => '1' ,
215
+ wdata => open ,
216
+ wstrb => open ,
217
+ bvalid => '1' ,
218
+ bready => open ,
219
+ bresp => "00" ,
220
+ arvalid => open ,
221
+ arready => '1' ,
222
+ araddr => open ,
223
+ rvalid => '1' ,
224
+ rready => open ,
225
+ rdata => (others => '0' ),
226
+ rresp => "00"
227
+ );
228
+
229
+ -- Need AXI "fabric" block
230
+
231
+ -- Need Info block
232
+
233
+ -- Need qty 2 I/O expanders
234
+
235
+ -- Need qty 4 muxes
236
+
237
+
176
238
end rtl ;
0 commit comments