Skip to content

Commit d53da34

Browse files
Cosmo Hotplug FPGA 1st pass implementation (#290)
A fairly decent sized PR, this brings in most of the MVP functionality for the cosmo hotplug FPGA. There were a couple of tweaks to some of the IP to support making this easier to generate/loop across, but since none of that stuff is used elsewhere really yet I think it's ok to combined here with this PR. Additionally there were a few things that GHDL complained about so those got cleaned up here as well. As an overview, this drops in 5 i2c mux endpoints on one i2c bus to the SP, 2 i2c pca I/O expanders to a 2nd i2c bus going to the SP5, and for-generates 10 copies of CEM logic, wiring between the i/o expanders and the CEM slots as required. This closes #166 (at least with an implementation that we need to test once we have hw!)
1 parent 203ed61 commit d53da34

File tree

11 files changed

+1139
-26
lines changed

11 files changed

+1139
-26
lines changed

hdl/ip/vhd/i2c/io_expanders/PCA9506ish/pca9506_pkg.vhd

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package pca9506_pkg is
2323
);
2424

2525
type pca9506_pin_t is array (0 to 4) of std_logic_vector(7 downto 0);
26+
type multiple_pca9506_pin_t is array (natural range <>) of pca9506_pin_t;
2627

2728
function get_irq_pend(
2829
cur_reg: io_type;

hdl/ip/vhd/i2c/muxes/PCA9545ish/pca9545ish_function.vhd

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ end entity;
5050
architecture rtl of pca9545ish_function is
5151
function is_valid(
5252
data : std_logic_vector(7 downto 0);
53-
allowed_to_enable : std_logic) return boolean is
53+
enable_allowed : std_logic) return boolean is
5454
begin
5555
-- allow only writes of 0 even when we're not allowed to enable
56-
if allowed_to_enable = '0' and data /= 0 then
56+
if enable_allowed = '0' and data /= 0 then
5757
return false;
5858
end if;
5959
-- only allow clear and one-hot bits 0-2

hdl/ip/vhd/info/info_2k8.vhd

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ begin
114114
hubris_compat <= unpack(resize(hubris_compat_pins, 32));
115115
if wready then
116116
case to_integer(awaddr) is
117-
when FPGA_CHECKSUM_OFFSET => checksum <= unpack(wdata);
118-
when SCRATCHPAD_OFFSET => scratchpad <= unpack(wdata);
117+
when FPGA_CHECKSUM_OFFSET => checksum <= write_byte_enable(checksum, wdata, wstrb);
118+
when SCRATCHPAD_OFFSET => scratchpad <= write_byte_enable(scratchpad, wdata, wstrb);
119119
when others => null;
120120
end case;
121121
end if;

hdl/projects/cosmo_hp/BUCK

+20
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
load("//tools:hdl.bzl", "vhdl_unit")
22
load("//tools:yosys.bzl", "ice40_bitstream")
33

4+
5+
vhdl_unit(
6+
name = "hp_subsystem_top",
7+
srcs = glob(["hp_subsystem/*.vhd"]),
8+
deps = [
9+
"//hdl/ip/vhd/i2c/io_expanders/PCA9506ish:pca9506_top",
10+
],
11+
standard = "2008",
12+
)
13+
414
vhdl_unit(
515
name = "cosmo_hp_top",
616
srcs = glob(["*.vhd"]),
17+
deps = [
18+
":hp_subsystem_top",
19+
"//hdl/ip/vhd/synchronizers:async_reset_bridge",
20+
"//hdl/ip/vhd/i2c/io_expanders/PCA9506ish:pca9506_top",
21+
"//hdl/ip/vhd/i2c/muxes/PCA9545ish:pca9545ish_top",
22+
"//hdl/ip/vhd/i2c/target:i2c_phy_consolidator",
23+
"//hdl/ip/vhd/spi/axi_controller:spi_axi_controller",
24+
"//hdl/ip/vhd/axi_blocks:axil_interconnect_2k8",
25+
"//hdl/ip/vhd/info:info_2k8",
26+
],
727
standard = "2008",
828
)
929

hdl/projects/cosmo_hp/cosmo_hp.pcf

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ set_io --warn-no-port fpga1_to_fpga2_io[2] E3
6868
set_io --warn-no-port fpga1_to_fpga2_io[3] H5
6969
set_io --warn-no-port fpga1_to_fpga2_io[4] E2
7070
set_io --warn-no-port fpga1_to_fpga2_io[5] G3
71-
set_io --warn-no-port fpga2_creset_l_r N11
7271
set_io --warn-no-port fpga2_spare_v3p3[0] E4
7372
set_io --warn-no-port fpga2_spare_v3p3[1] B2
7473
set_io --warn-no-port fpga2_spare_v3p3[2] F5
@@ -150,3 +149,4 @@ set_io --warn-no-port spi_sp_mux_to_fpga2_sck R11
150149
set_io --warn-no-port uart_fpga2_to_sp_dat N4
151150
set_io --warn-no-port uart_sp_to_fpga2_dat R1
152151
set_io --warn-no-port v12_mcio_a0hp_pg H6
152+
set_frequency clk_50mhz_fpga2 50

0 commit comments

Comments
 (0)