Skip to content

Commit 7bdf7e6

Browse files
committed
wire spd proxy in
1 parent 2223895 commit 7bdf7e6

File tree

4 files changed

+56
-10
lines changed

4 files changed

+56
-10
lines changed

hdl/projects/cosmo_seq/spd_proxy/BUCK

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ vhdl_unit(
44
name = "spd_proxy_top",
55
srcs = glob(["*.vhd"]),
66
deps = [
7+
"//hdl/ip/vhd/common:streaming_if_pkg",
78
"//hdl/ip/vhd/common:tristate_if_pkg",
89
"//hdl/ip/vhd/i2c/common:i2c_common_pkg",
910
"//hdl/ip/vhd/i2c/common:i2c_glitch_filter",

hdl/projects/grapefruit/BUCK

+4
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,17 @@ vhdl_unit(
7373
":gfruit_sgpio",
7474
":gfruit_black_boxes",
7575
"//hdl/projects/cosmo_seq:reset_sync",
76+
"//hdl/projects/cosmo_seq/spd_proxy:spd_proxy_top",
77+
"//hdl/ip/vhd/i2c/common:i2c_common_pkg",
7678
"//hdl/ip/vhd/info:info",
7779
"//hdl/ip/vhd/espi:espi_top",
7880
"//hdl/ip/vhd/uart:axi_fifo_uart",
7981
"//hdl/ip/vhd/axi_blocks:axil_interconnect",
8082
"//hdl/ip/vhd/spi_nor_controller:spi_nor_top",
8183
"//hdl/ip/vhd/fmc_if:stm32h7_fmc_target",
84+
"//hdl/ip/vhd/common:streaming_if_pkg",
8285
"//hdl/ip/vhd/common:time_pkg",
86+
"//hdl/ip/vhd/common:tristate_if_pkg",
8387
],
8488
standard = "2019",
8589
)

hdl/projects/grapefruit/grapefruit_pins.xdc

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ set_property -dict { PACKAGE_PIN Y3 IOSTANDARD LVCMOS18 } [get_ports { espi_hpm_
130130
set_property SLEW FAST [get_ports espi_hpm_to_scm_dat[*]]
131131
set_property -dict { PACKAGE_PIN AA6 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm0_abcdef_scl }];
132132
set_property -dict { PACKAGE_PIN AB6 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm0_abcdef_sda }];
133-
set_property -dict { PACKAGE_PIN Y6 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm0_ghijkl_scl }];
134-
set_property -dict { PACKAGE_PIN Y5 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm0_ghijkl_sda }];
133+
set_property -dict { PACKAGE_PIN Y6 IOSTANDARD LVCMOS18 PULLUP TRUE} [get_ports { i3c_hpm_to_scm_dimm0_ghijkl_scl }];
134+
set_property -dict { PACKAGE_PIN Y5 IOSTANDARD LVCMOS18 PULLUP TRUE} [get_ports { i3c_hpm_to_scm_dimm0_ghijkl_sda }];
135135
set_property -dict { PACKAGE_PIN Y4 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm1_abcdef_scl }];
136136
set_property -dict { PACKAGE_PIN AA3 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm1_abcdef_sda }];
137137
set_property -dict { PACKAGE_PIN AB3 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm1_ghijkl_scl }];
138138
set_property -dict { PACKAGE_PIN AB2 IOSTANDARD LVCMOS18 } [get_ports { i3c_hpm_to_scm_dimm1_ghijkl_sda }];
139139
set_property -dict { PACKAGE_PIN AA1 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm0_abcdef_scl }];
140140
set_property -dict { PACKAGE_PIN AB5 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm0_abcdef_sda }];
141-
set_property -dict { PACKAGE_PIN AB4 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm0_ghijkl_scl }];
142-
set_property -dict { PACKAGE_PIN V8 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm0_ghijkl_sda }];
141+
set_property -dict { PACKAGE_PIN AB4 IOSTANDARD LVCMOS18 PULLUP TRUE} [get_ports { i3c_scm_to_dimm0_ghijkl_scl }];
142+
set_property -dict { PACKAGE_PIN V8 IOSTANDARD LVCMOS18 PULLUP TRUE} [get_ports { i3c_scm_to_dimm0_ghijkl_sda }];
143143
set_property -dict { PACKAGE_PIN W8 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm1_abcdef_scl }];
144144
set_property -dict { PACKAGE_PIN Y8 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm1_abcdef_sda }];
145145
set_property -dict { PACKAGE_PIN AA8 IOSTANDARD LVCMOS18 } [get_ports { i3c_scm_to_dimm1_ghijkl_scl }];

hdl/projects/grapefruit/grapefruit_top.vhd

+47-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ use ieee.numeric_std_unsigned.all;
1313
use work.axil_common_pkg.all;
1414
use work.axil26x32_pkg;
1515
use work.axil8x32_pkg;
16+
use work.i2c_common_pkg.all;
17+
use work.stream8_pkg;
1618
use work.time_pkg.all;
19+
use work.tristate_if_pkg.all;
1720

1821
entity grapefruit_top is
1922
port (
@@ -244,7 +247,15 @@ architecture rtl of grapefruit_top is
244247
signal sp5_owns_flash : std_logic;
245248
signal spi_nor_block_data_o : std_logic_vector(3 downto 0);
246249
signal spi_nor_block_data_oe : std_logic_vector(3 downto 0);
247-
250+
251+
-- TODO: remove after hacking
252+
signal ruby_scl_if : tristate;
253+
signal ruby_sda_if : tristate;
254+
signal dimm_scl_if : tristate;
255+
signal dimm_sda_if : tristate;
256+
-- stubs
257+
signal i2c_tx_st_if : stream8_pkg.data_channel;
258+
signal i2c_rx_st_if : stream8_pkg.data_channel;
248259
begin
249260

250261
espi_scm_to_hpm_alert_l <= 'Z';
@@ -570,8 +581,6 @@ begin
570581

571582
i3c_hpm_to_scm_dimm0_abcdef_scl <= not counter(26);
572583
i3c_hpm_to_scm_dimm0_abcdef_sda <= not counter(26);
573-
i3c_hpm_to_scm_dimm0_ghijkl_scl <= not counter(26);
574-
i3c_hpm_to_scm_dimm0_ghijkl_sda <= not counter(26);
575584

576585
i3c_hpm_to_scm_dimm1_abcdef_scl <= not counter(26);
577586
i3c_hpm_to_scm_dimm1_abcdef_sda <= not counter(26);
@@ -580,13 +589,45 @@ begin
580589

581590
i3c_scm_to_dimm0_abcdef_scl <= not counter(26);
582591
i3c_scm_to_dimm0_abcdef_sda <= not counter(26);
583-
i3c_scm_to_dimm0_ghijkl_scl <= not counter(26);
584-
i3c_scm_to_dimm0_ghijkl_sda <= not counter(26);
585592

586593
i3c_scm_to_dimm1_abcdef_scl <= not counter(26);
587594
i3c_scm_to_dimm1_abcdef_sda <= not counter(26);
588595
i3c_scm_to_dimm1_ghijkl_scl <= not counter(26);
589596
i3c_scm_to_dimm1_ghijkl_sda <= not counter(26);
590597

591-
598+
-- -- Ruby -> Grapefruit bus
599+
i3c_hpm_to_scm_dimm0_ghijkl_scl <= ruby_scl_if.o when ruby_scl_if.oe else 'Z';
600+
ruby_scl_if.i <= i3c_hpm_to_scm_dimm0_ghijkl_scl;
601+
i3c_hpm_to_scm_dimm0_ghijkl_sda <= ruby_sda_if.o when ruby_sda_if.oe else 'Z';
602+
ruby_sda_if.i <= i3c_hpm_to_scm_dimm0_ghijkl_sda;
603+
604+
-- -- Grapefruit -> DIMM bus
605+
i3c_scm_to_dimm0_ghijkl_scl <= dimm_scl_if.o when dimm_scl_if.oe else 'Z';
606+
dimm_scl_if.i <= i3c_scm_to_dimm0_ghijkl_scl;
607+
i3c_scm_to_dimm0_ghijkl_sda <= dimm_sda_if.o when dimm_sda_if.oe else 'Z';
608+
dimm_sda_if.i <= i3c_scm_to_dimm0_ghijkl_sda;
609+
610+
spd_proxy_top_inst: entity work.spd_proxy_top
611+
generic map(
612+
CLK_PER_NS => 8,
613+
I2C_MODE => FAST_PLUS
614+
)
615+
port map(
616+
clk => clk,
617+
reset => not reset_l,
618+
cpu_scl_if => ruby_scl_if,
619+
cpu_sda_if => ruby_sda_if,
620+
dimm_scl_if => dimm_scl_if,
621+
dimm_sda_if => dimm_sda_if,
622+
i2c_command => (
623+
op => RANDOM_READ,
624+
addr => b"1010000", -- 0x50
625+
reg => x"80",
626+
len => x"10"
627+
),
628+
i2c_command_valid => '0',
629+
i2c_ctrlr_idle => open,
630+
i2c_tx_st_if => i2c_tx_st_if,
631+
i2c_rx_st_if => i2c_rx_st_if
632+
);
592633
end rtl;

0 commit comments

Comments
 (0)