Skip to content

Commit 4cc061b

Browse files
Cosmo sequencer
1 parent 17cce00 commit 4cc061b

31 files changed

+2884
-146
lines changed

hdl/projects/cosmo_seq/BUCK

+29-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@ load("//tools:hdl.bzl", "vhdl_unit", "black_box")
22
load("//tools:rdl.bzl", "rdl_file")
33
load("//tools:vivado.bzl", "vivado_bitstream")
44

5+
rdl_file(
6+
name = "cosmo_seq_top_rdl",
7+
src = "cosmo_seq_top.rdl",
8+
deps = [
9+
"//hdl/ip/vhd/info:info_regs_rdl",
10+
"//hdl/projects/cosmo_seq/sequencer:sequencer_regs_rdl",
11+
"//hdl/ip/vhd/spi_nor_controller:spi_nor_regs_rdl",
12+
"//hdl/ip/vhd/espi:espi_regs_rdl",
13+
],
14+
outputs = [
15+
"cosmo_seq_top.html",
16+
"cosmo_seq_top.json"
17+
]
18+
)
519

620
black_box (
721
name = "cosmo_black_boxes",
@@ -10,26 +24,37 @@ black_box (
1024
# Shared with grapefruit
1125
vhdl_unit(
1226
name = "reset_sync",
13-
srcs = ["clk_rst_infra/reset_sync.vhd"],
27+
srcs = ["board_support/reset_sync.vhd"],
1428
deps = ["//hdl/ip/vhd/synchronizers:async_reset_bridge"],
1529
visibility = ["PUBLIC"],
1630
)
1731

1832
vhdl_unit(
19-
name = "cosmo_clks",
20-
srcs = glob(["clk_rst_infra/*.vhd"], exclude = ["clk_rst_infra/reset_sync.vhd"]),
33+
name = "board_support",
34+
srcs = glob(["board_support/*.vhd"], exclude = ["board_support/reset_sync.vhd"]),
2135
deps = [
2236
":reset_sync",
2337
":cosmo_black_boxes",
38+
"//hdl/ip/vhd/info:info",
2439
],
40+
standard = "2019",
2541
)
2642

2743

2844
vhdl_unit(
2945
name = "cosmo_seq_top",
3046
srcs = ["cosmo_seq_top.vhd"],
3147
deps = [
32-
":cosmo_clks",
48+
":cosmo_seq_top_rdl",
49+
":board_support",
50+
"//hdl/ip/vhd/axi_blocks:axilite_common_pkg",
51+
"//hdl/ip/vhd/axi_blocks:axil_interconnect",
52+
"//hdl/ip/vhd/fmc_if:stm32h7_fmc_target",
53+
"//hdl/projects/cosmo_seq/sp5_espi_flash_subsystem:sp5_espi_flash_subsystem",
54+
"//hdl/projects/cosmo_seq/sp5_uart_subsystem:sp5_uart_subsystem",
55+
"//hdl/projects/cosmo_seq/sequencer:sequencer",
56+
"//hdl/projects/cosmo_seq/sp_i2c_subsystem:sp_i2c_subsystem",
57+
"//hdl/projects/cosmo_seq/sp5_hotplug_subsystem:sp5_hotplug_subsystem",
3358
],
3459
standard = "2019",
3560
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
-- This Source Code Form is subject to the terms of the Mozilla Public
2+
-- License, v. 2.0. If a copy of the MPL was not distributed with this
3+
-- file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
--
5+
-- Copyright 2025 Oxide Computer Company
6+
7+
library ieee;
8+
use ieee.std_logic_1164.all;
9+
use ieee.numeric_std.all;
10+
use work.axil8x32_pkg.all;
11+
12+
-- Basic board support blocks including clock and reset generation
13+
-- board LEDs, and debugging I/O etc.
14+
15+
entity board_support is
16+
port (
17+
-- Board level clocks and resets
18+
board_50mhz_clk : in std_logic;
19+
sp_fmc_clk : in std_logic;
20+
sp_system_reset_l : in std_logic;
21+
-- PLL outputs and synchronized resets
22+
clk_125m : out std_logic;
23+
reset_125m : out std_logic;
24+
clk_200m : out std_logic;
25+
reset_200m : out std_logic;
26+
reset_fmc : out std_logic;
27+
-- misc board signals
28+
fpga1_status_led : out std_logic;
29+
hubris_compat_ver : in std_logic_vector(2 downto 0);
30+
-- AXI interface for the "info" block
31+
info_axi_if : view axil_target;
32+
);
33+
end entity;
34+
35+
36+
architecture rtl of board_support is
37+
38+
signal sp_system_reset_syncd : std_logic;
39+
signal pll_locked_async : std_logic;
40+
signal led_counter : unsigned(20 downto 0);
41+
42+
begin
43+
44+
-- We have a reset pin coming in from the SP. Synchronize it first
45+
-- using the "raw" board clock, pre-PLL. We'll use this as the
46+
-- reset to the PLL, and the aclr the down-stream clocks
47+
clk50m_base_reset_sync: entity work.async_reset_bridge
48+
generic map(
49+
async_reset_active_level => '0'
50+
)
51+
port map(
52+
clk => board_50mhz_clk,
53+
reset_async => sp_system_reset_l,
54+
reset_sync => sp_system_reset_syncd -- polarity flip inside, now active high
55+
);
56+
57+
-- Xilinx PLL instantiation
58+
pll: entity work.cosmo_pll
59+
port map (
60+
clk_50m => board_50mhz_clk,
61+
clk_125m => clk_125m,
62+
clk_200m => clk_200m,
63+
reset => sp_system_reset_syncd,
64+
locked => pll_locked_async
65+
66+
);
67+
68+
-- Reset synchronizer into the clock domains
69+
reset_sync_inst: entity work.reset_sync
70+
port map(
71+
pll_locked_async => pll_locked_async,
72+
clk_125m => clk_125m,
73+
reset_125m => reset_125m,
74+
clk_200m => clk_200m,
75+
reset_200m => reset_200m,
76+
sp_fmc_clk => sp_fmc_clk,
77+
reset_fmc_clk => reset_fmc
78+
);
79+
80+
-- Blink an LED at some rate
81+
led: process(clk_125m, reset_125m)
82+
begin
83+
if reset_125m then
84+
led_counter <= (others => '0');
85+
elsif rising_edge(clk_125m) then
86+
led_counter <= led_counter + 1;
87+
end if;
88+
end process;
89+
fpga1_status_led <= led_counter(20);
90+
91+
-- Put the "info" common block here
92+
info_inst: entity work.info
93+
generic map(
94+
hubris_compat_num_bits => 3
95+
)
96+
port map(
97+
clk => clk_125m,
98+
reset => reset_125m,
99+
hubris_compat_pins => hubris_compat_ver,
100+
axi_if => info_axi_if
101+
);
102+
103+
end rtl;

hdl/projects/cosmo_seq/clk_rst_infra/cosmo_clks_and_resets.vhd

-56
This file was deleted.

hdl/projects/cosmo_seq/cosmo_seq_pins.xdc

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ set_property -dict { PACKAGE_PIN J17 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_t
4545
set_property -dict { PACKAGE_PIN H17 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_bl_l[0] }];
4646
set_property -dict { PACKAGE_PIN G17 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_bl_l[1] }];
4747
set_property -dict { PACKAGE_PIN F19 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_clk }];
48-
set_property -dict { PACKAGE_PIN H16 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_cs_l[1] }];
48+
set_property -dict { PACKAGE_PIN H16 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_cs_l }];
4949
set_property -dict { PACKAGE_PIN L18 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_da[0] }];
5050
set_property -dict { PACKAGE_PIN L19 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_da[1] }];
5151
set_property -dict { PACKAGE_PIN M15 IOSTANDARD LVCMOS33 } [get_ports { fmc_sp_to_fpga1_da[2] }];
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
addrmap cosmo_seq_top {
2+
default regwidth = 32;
3+
// Instantiate 2 to test nesting
4+
info_regs info @ 0x0;
5+
sequencer_regs sequencer @ 0x100;
6+
spi_nor_regs spi_nor @ 0x0200;
7+
espi_regs espi @ 0x0300;
8+
};

0 commit comments

Comments
 (0)