From ae1199302ec8ecd08164c3e061740b4e1704074d Mon Sep 17 00:00:00 2001 From: Damian Smith Date: Wed, 22 Sep 2021 15:58:00 +0100 Subject: [PATCH] SMB-377 Add Controls for Group D LEDs to som_ctrl_1. This is a minor version as it extends what is there and is backwards compatible --- generic_ip/som_ctrl/1/doc/som_ctrl_1.json | 511 ++++++++++--------- generic_ip/som_ctrl/1/src/som_ctrl_1.vhd | 210 ++++---- generic_ip/som_ctrl/1/src/som_ctrl_1_pkg.vhd | 21 +- 3 files changed, 390 insertions(+), 352 deletions(-) diff --git a/generic_ip/som_ctrl/1/doc/som_ctrl_1.json b/generic_ip/som_ctrl/1/doc/som_ctrl_1.json index a708b73..31e86fe 100644 --- a/generic_ip/som_ctrl/1/doc/som_ctrl_1.json +++ b/generic_ip/som_ctrl/1/doc/som_ctrl_1.json @@ -1,246 +1,271 @@ -[{ - "ip_name": "som_ctrl_1", - "bus": "csr", - "addr_width" : "6", - "description": "SOM Controller IP", - "addr_hi_bit" : "6", - "addr_lo_bit" : "5", - "sub_blocks": { - "local": { - "instance": "", - "process": "enabled", - "offset": "0x0" - }, - "swim_2": { - "instance": "iSWIM_MNG", - "process": "enabled", - "offset": "0x20" - } - }, - "registers": { - "ip_id" : { - "address" : "0", - "width" : "32", - "description" : "Unique ID for this IP block", - "fields": { - "ip_number" : { - "type" : "c", - "bit_len" : "8", - "reset" : "0x0F", - "description" : "IP identifier number" - }, - "mfr_number" : { - "type" : "c", - "bit_len" : "8", - "reset" : "0xff", - "description" : "Manufacturer number" - - }, - "reserved" : { - "type" : "rsv", - "bit_len" : "16", - "description" : "Reserved bits" - } - } - }, - "ip_ver" : { - "address" : "1", - "width" : "32", - "description" : "Bits[7:0] = Minor version number, Bits[15:8] = Major version number, etc.", - "fields": { - "minor_number" : { - "type" : "c", - "bit_len" : "8", - "reset" : "0x01", - "description" : "Minor number" - }, - "major_number" : { - "type" : "c", - "bit_len" : "8", - "reset" : "0x01", - "description" : "Major number" - - }, - "reserved" : { - "type" : "rsv", - "bit_len" : "16", - "description" : "Reserved bits" - } - } - }, - "power_good_status": { - "address": "2", - "width": "3", - "description": "", - "fields": { - "p_good": { - "type": "r", - "bit_len": "1", - "reset": "U", - "description": "p_good pin status" - }, - "p_in_good": { - "type": "r", - "bit_len": "1", - "reset": "U", - "description": "p_in_good pin status" - }, - "p_host_good": { - "type": "r", - "bit_len": "1", - "reset": "U", - "description": "p_host_good pin status" - } +[ + { + "ip_name": "som_ctrl_1", + "bus": "csr", + "addr_width": "6", + "description": "SOM Controller IP", + "addr_hi_bit": "6", + "addr_lo_bit": "5", + "sub_blocks": { + "local": { + "instance": "", + "process": "enabled", + "offset": "0x0" + }, + "swim_2": { + "instance": "iSWIM_MNG", + "process": "enabled", + "offset": "0x20" } - }, - "host_power_control": { - "address": "3", - "width": "7", - "description": "", - "fields": { - "host_pwr_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_pwr_en pin" - }, - "host_5v_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_5v_en pin" - }, - "host_3v3_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_3v3_en pin" - }, - "host_2v5_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_2v5_en pin" - }, - "host_1v5_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_1v5_en pin" - }, - "host_1v2_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_1v2_en pin" - }, - "host_1v1_en": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "drives host_1v1_en pin" - } - } - }, - "mon_pt_sel": { - "address": "4", - "width": "32", - "description": "Monitoring Points selection", - "fields": { - "mp_0_sel": { - "type": "w", - "bit_len": "7", - "reset": "0x0", - "description": "source selection for MP-0" - }, - "mp_0_drive_n": { - "type": "w", - "bit_len": "1", - "reset": "0x1", - "description": "0 => Driving MP-0, 1 => MP-0 output three-stated" - }, - "mp_1_sel": { - "type": "w", - "bit_len": "7", - "reset": "0x0", - "description": "source selection for MP-1" - }, - "mp_1_drive_n": { - "type": "w", - "bit_len": "1", - "reset": "0x1", - "description": "0 => Driving MP-1, 1 => MP-1 output three-stated" - }, - "mp_2_sel": { - "type": "w", - "bit_len": "7", - "reset": "0x0", - "description": "source selection for MP-2" - }, - "mp_2_drive_n": { - "type": "w", - "bit_len": "1", - "reset": "0x1", - "description": "0 => Driving MP-2, 1 => MP-2 output three-stated" - }, - "mp_3_sel": { - "type": "w", - "bit_len": "7", - "reset": "0x0", - "description": "source selection for MP-3" - }, - "mp_3_drive_n": { - "type": "w", - "bit_len": "1", - "reset": "0x1", - "description": "0 => Driving MP-3, 1 => MP-3 output three-stated" - } - } - }, - "mon_pt_stretch": { - "address": "5", - "width": "4", - "reset": "0x0", - "type": "w", - "description": "Monitoring Points Stretch-Pulse enable" - }, - "som_led": { - "type": "w", - "address": "6", - "reset": "0x00", - "width": "5", - "description": "SOM LEDs value" - }, - "stm8_ift": { - "address": "7", - "width": "9", - "description": "STM8 interface", - "fields": { - "stm8_trigger_rx": { - "type": "w", - "bit_len": "1", - "reset": "0x0", - "description": "stm8_trigger_rx" - }, - "reserved": { - "type": "rsv", - "bit_len": "7", - "description": "Reserved bits" - }, - "stm8_alert_tx": { - "type": "r", - "bit_len": "1", - "reset": "0x0", - "description": "stm8_alert_tx" - } + }, + "registers": { + "ip_id": { + "address": "0", + "width": "32", + "description": "Unique ID for this IP block", + "fields": { + "ip_number": { + "type": "c", + "bit_len": "8", + "reset": "0x0F", + "description": "IP identifier number" + }, + "mfr_number": { + "type": "c", + "bit_len": "8", + "reset": "0xff", + "description": "Manufacturer number" + }, + "reserved": { + "type": "rsv", + "bit_len": "16", + "description": "Reserved bits" + } + } + }, + "ip_ver": { + "address": "1", + "width": "32", + "description": "Bits[7:0] = Minor version number, Bits[15:8] = Major version number, etc.", + "fields": { + "minor_number": { + "type": "c", + "bit_len": "8", + "reset": "0x02", + "description": "Minor number" + }, + "major_number": { + "type": "c", + "bit_len": "8", + "reset": "0x01", + "description": "Major number" + }, + "reserved": { + "type": "rsv", + "bit_len": "16", + "description": "Reserved bits" + } + } + }, + "power_good_status": { + "address": "2", + "width": "3", + "description": "", + "fields": { + "p_good": { + "type": "r", + "bit_len": "1", + "reset": "U", + "description": "p_good pin status" + }, + "p_in_good": { + "type": "r", + "bit_len": "1", + "reset": "U", + "description": "p_in_good pin status" + }, + "p_host_good": { + "type": "r", + "bit_len": "1", + "reset": "U", + "description": "p_host_good pin status" + } + } + }, + "host_power_control": { + "address": "3", + "width": "7", + "description": "", + "fields": { + "host_pwr_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_pwr_en pin" + }, + "host_5v_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_5v_en pin" + }, + "host_3v3_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_3v3_en pin" + }, + "host_2v5_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_2v5_en pin" + }, + "host_1v5_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_1v5_en pin" + }, + "host_1v2_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_1v2_en pin" + }, + "host_1v1_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "drives host_1v1_en pin" + } + } + }, + "mon_pt_sel": { + "address": "4", + "width": "32", + "description": "Monitoring Points selection", + "fields": { + "mp_0_sel": { + "type": "w", + "bit_len": "7", + "reset": "0x0", + "description": "source selection for MP-0" + }, + "mp_0_drive_n": { + "type": "w", + "bit_len": "1", + "reset": "0x1", + "description": "0 => Driving MP-0, 1 => MP-0 output three-stated" + }, + "mp_1_sel": { + "type": "w", + "bit_len": "7", + "reset": "0x0", + "description": "source selection for MP-1" + }, + "mp_1_drive_n": { + "type": "w", + "bit_len": "1", + "reset": "0x1", + "description": "0 => Driving MP-1, 1 => MP-1 output three-stated" + }, + "mp_2_sel": { + "type": "w", + "bit_len": "7", + "reset": "0x0", + "description": "source selection for MP-2" + }, + "mp_2_drive_n": { + "type": "w", + "bit_len": "1", + "reset": "0x1", + "description": "0 => Driving MP-2, 1 => MP-2 output three-stated" + }, + "mp_3_sel": { + "type": "w", + "bit_len": "7", + "reset": "0x0", + "description": "source selection for MP-3" + }, + "mp_3_drive_n": { + "type": "w", + "bit_len": "1", + "reset": "0x1", + "description": "0 => Driving MP-3, 1 => MP-3 output three-stated" + } + } + }, + "mon_pt_stretch": { + "address": "5", + "width": "4", + "reset": "0x0", + "type": "w", + "description": "Monitoring Points Stretch-Pulse enable" + }, + "som_led": { + "type": "w", + "address": "6", + "reset": "0x00", + "width": "5", + "description": "SOM LEDs value" + }, + "stm8_ift": { + "address": "7", + "width": "9", + "description": "STM8 interface", + "fields": { + "stm8_trigger_rx": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "stm8_trigger_rx" + }, + "reserved": { + "type": "rsv", + "bit_len": "7", + "description": "Reserved bits" + }, + "stm8_alert_tx": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "stm8_alert_tx" + } + } + }, + "mon_pt_pin_sel": { + "type": "w", + "address": "8", + "reset": "0x0", + "width": "1", + "description": "Rewire Monitoring Points pins to SOM header J5 (Debug)" + }, + "som_group_d_led": { + "address": "9", + "width": "3", + "description": "SOM Group D LEDs value", + "fields": { + "LED_R": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "Active Low Group D Red LED" + }, + "LED_Y": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "Active Low Group D Yellow LED" + }, + "LED_G": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "Active Low Group D Green LED" + } + } } - }, - "mon_pt_pin_sel": { - "type": "w", - "address": "8", - "reset": "0x0", - "width": "1", - "description": "Rewire Monitoring Points pins to SOM header J5 (Debug)" - } + } } -}] \ No newline at end of file +] \ No newline at end of file diff --git a/generic_ip/som_ctrl/1/src/som_ctrl_1.vhd b/generic_ip/som_ctrl/1/src/som_ctrl_1.vhd index d5125d8..88d5448 100644 --- a/generic_ip/som_ctrl/1/src/som_ctrl_1.vhd +++ b/generic_ip/som_ctrl/1/src/som_ctrl_1.vhd @@ -20,61 +20,64 @@ library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -library work; use work.som_ctrl_1_pkg.all; entity som_ctrl_1 is - port ( - clk : in std_logic; - reset_n : in std_logic := '1'; + port( + clk : in std_logic; + reset_n : in std_logic := '1'; -- Avalon-MM I/F - avs_address : in std_logic_vector( 5 downto 0); - avs_write : in std_logic; - avs_writedata : in std_logic_vector(31 downto 0); - avs_read : in std_logic; - avs_readdatavalid : out std_logic; - avs_readdata : out std_logic_vector(31 downto 0); + avs_address : in std_logic_vector(5 downto 0); + avs_write : in std_logic; + avs_writedata : in std_logic_vector(31 downto 0); + avs_read : in std_logic; + avs_readdatavalid : out std_logic; + avs_readdata : out std_logic_vector(31 downto 0); -- SOM Specific I/Fs: - som_mon_pt_pin_rewire : out std_logic; - som_mon_pt_en : out std_logic_vector( 3 downto 0); -- SOM Timing Output enable - som_mon_pt : out std_logic_vector( 3 downto 0); -- SOM Timing I/Os - mon_pt_src : in std_logic_vector(31 downto 0); -- Source signals for the SOM monitoring points + som_mon_pt_pin_rewire : out std_logic; + som_mon_pt_en : out std_logic_vector(3 downto 0); -- SOM Timing Output enable + som_mon_pt : out std_logic_vector(3 downto 0); -- SOM Timing I/Os + mon_pt_src : in std_logic_vector(31 downto 0); -- Source signals for the SOM monitoring points -- STM8 & swim - stm8_alert_tx : in std_logic; - stm8_trigger_rx : out std_logic; - swim_tx : out std_logic; - swim_rx : in std_logic; + stm8_alert_tx : in std_logic; + stm8_trigger_rx : out std_logic; + swim_tx : out std_logic; + swim_rx : in std_logic; -- SOM Miscellaneous I/Os - p_good : in std_logic; - p_in_good : in std_logic; - p_host_good : in std_logic; - host_pwr_en : out std_logic; - host_5v_en : out std_logic; - host_3v3_en : out std_logic; - host_2v5_en : out std_logic; - host_1v5_en : out std_logic; - host_1v2_en : out std_logic; - host_1v1_en : out std_logic; - -- SOM LEDs - som_led : out std_logic_vector(5 downto 1)); + p_good : in std_logic; + p_in_good : in std_logic; + p_host_good : in std_logic; + host_pwr_en : out std_logic; + host_5v_en : out std_logic; + host_3v3_en : out std_logic; + host_2v5_en : out std_logic; + host_1v5_en : out std_logic; + host_1v2_en : out std_logic; + host_1v1_en : out std_logic; + -- SOM Group D LEDs section + n_group_d_led_g : out std_logic; + n_group_d_led_y : out std_logic; + n_group_d_led_r : out std_logic; + -- SOM DEBUG LEDs + som_led : out std_logic_vector(5 downto 1)); end entity som_ctrl_1; architecture rtl of som_ctrl_1 is constant CSR_IP_ID : std_logic_vector(31 downto 0) := x"0000FF0F"; - constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000101"; + constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000102"; signal ctrl_write, ctrl_read : std_logic; signal swim_write, swim_read, swim_read_d : std_logic; signal avs_read_d : std_logic; signal mon_pt_pin_rewire : std_logic; - signal avs_addr : std_logic_vector( 3 downto 0); - signal swim_addr, mp_stretch_en : std_logic_vector( 3 downto 0); - signal mon_pt_i, mon_pt_ii : std_logic_vector( 3 downto 0); - signal mon_pt_sel_0, mon_pt_sel_1 : std_logic_vector( 7 downto 0); - signal mon_pt_sel_2, mon_pt_sel_3 : std_logic_vector( 7 downto 0); + signal avs_addr : std_logic_vector(3 downto 0); + signal swim_addr, mp_stretch_en : std_logic_vector(3 downto 0); + signal mon_pt_i, mon_pt_ii : std_logic_vector(3 downto 0); + signal mon_pt_sel_0, mon_pt_sel_1 : std_logic_vector(7 downto 0); + signal mon_pt_sel_2, mon_pt_sel_3 : std_logic_vector(7 downto 0); signal swim_writedata, swim_readdata : std_logic_vector(31 downto 0); signal avs_readdata_i : std_logic_vector(31 downto 0); @@ -84,10 +87,10 @@ begin -- SWIM I/F ----------------------------------------------------------------------------- - iSWIM_MNG: entity work.swim_2 - generic map ( + iSWIM_MNG : entity work.swim_2 + generic map( CLK_FREQ_MHZ => 100) - port map ( + port map( clk => clk, reset_n => reset_n, avs_address => swim_addr, @@ -102,13 +105,13 @@ begin ----------------------------------------------------------------------------- -- MOnitoring Points ----------------------------------------------------------------------------- - + som_mon_pt_pin_rewire <= mon_pt_pin_rewire; -- - som_mon_pt_en(0) <= not mon_pt_sel_0(7); - som_mon_pt_en(1) <= not mon_pt_sel_1(7); - som_mon_pt_en(2) <= not mon_pt_sel_2(7); - som_mon_pt_en(3) <= not mon_pt_sel_3(7); + som_mon_pt_en(0) <= not mon_pt_sel_0(7); + som_mon_pt_en(1) <= not mon_pt_sel_1(7); + som_mon_pt_en(2) <= not mon_pt_sel_2(7); + som_mon_pt_en(3) <= not mon_pt_sel_3(7); -- Monitoring Point selection mon_pt_ii(0) <= mon_pt_src(to_integer(unsigned(mon_pt_sel_0(4 downto 0)))); @@ -119,16 +122,16 @@ begin -- Pulse stretching gMP_STRETCH : for n in 0 to 3 generate - iSTRETCH: entity work.stretch_pulse - generic map ( + iSTRETCH : entity work.stretch_pulse + generic map( pulse_polarity => 0, ext_pulse_width => 25) - port map ( + port map( rstN => reset_n, clk => clk, pulse_in => mon_pt_ii(n), pulse_out => mon_pt_i(n)); - + end generate gMP_STRETCH; som_mon_pt(0) <= mon_pt_ii(0) when mp_stretch_en(0) = '0' else mon_pt_i(0); @@ -145,84 +148,91 @@ begin swim_writedata <= avs_writedata; swim_write <= '1' when avs_write = '1' and avs_address(5) = '1' else '0'; - swim_read <= '1' when avs_read = '1' and avs_address(5) = '1' else '0'; + swim_read <= '1' when avs_read = '1' and avs_address(5) = '1' else '0'; ctrl_write <= '1' when avs_write = '1' and avs_address(5) = '0' else '0'; - ctrl_read <= '1' when avs_read = '1' and avs_address(5) = '0' else '0'; - + ctrl_read <= '1' when avs_read = '1' and avs_address(5) = '0' else '0'; + avs_addr <= avs_address(3 downto 0); pCTRL_STATUS : process(reset_n, clk) begin - if(reset_n = '0') then - avs_readdatavalid <= '0'; + if (reset_n = '0') then + avs_readdatavalid <= '0'; -- - host_pwr_en <= '0'; - host_5v_en <= '0'; - host_3v3_en <= '0'; - host_2v5_en <= '0'; - host_1v5_en <= '0'; - host_1v2_en <= '0'; - host_1v1_en <= '0'; + host_pwr_en <= '0'; + host_5v_en <= '0'; + host_3v3_en <= '0'; + host_2v5_en <= '0'; + host_1v5_en <= '0'; + host_1v2_en <= '0'; + host_1v1_en <= '0'; -- - stm8_trigger_rx <= '0'; + stm8_trigger_rx <= '0'; -- - mon_pt_sel_0 <= (7 => '1', others => '0'); - mon_pt_sel_1 <= (7 => '1', others => '0'); - mon_pt_sel_2 <= (7 => '1', others => '0'); - mon_pt_sel_3 <= (7 => '1', others => '0'); - mp_stretch_en <= (others => '0'); + mon_pt_sel_0 <= (7 => '1', others => '0'); + mon_pt_sel_1 <= (7 => '1', others => '0'); + mon_pt_sel_2 <= (7 => '1', others => '0'); + mon_pt_sel_3 <= (7 => '1', others => '0'); + mp_stretch_en <= (others => '0'); -- mon_pt_pin_rewire <= '0'; - - -- - som_led <= (others => '0'); - elsif(clk = '1' and clk'event) then + + -- + n_group_d_led_g <= '0'; -- default all group d LEDs on to match other products + n_group_d_led_y <= '0'; + n_group_d_led_r <= '0'; + som_led <= (others => '0'); + elsif (clk = '1' and clk'event) then -- CTRL registers - if(ctrl_write = '1') then + if (ctrl_write = '1') then case avs_addr is when CSR_HOST_PWR_ADDR => - host_pwr_en <= avs_writedata(0); - host_5v_en <= avs_writedata(1); - host_3v3_en <= avs_writedata(2); - host_2v5_en <= avs_writedata(3); - host_1v5_en <= avs_writedata(4); - host_1v2_en <= avs_writedata(5); - host_1v1_en <= avs_writedata(6); + host_pwr_en <= avs_writedata(0); + host_5v_en <= avs_writedata(1); + host_3v3_en <= avs_writedata(2); + host_2v5_en <= avs_writedata(3); + host_1v5_en <= avs_writedata(4); + host_1v2_en <= avs_writedata(5); + host_1v1_en <= avs_writedata(6); when CSR_MON_PT_SEL_ADDR => - mon_pt_sel_0 <= avs_writedata( 7 downto 0); - mon_pt_sel_1 <= avs_writedata(15 downto 8); - mon_pt_sel_2 <= avs_writedata(23 downto 16); - mon_pt_sel_3 <= avs_writedata(31 downto 24); + mon_pt_sel_0 <= avs_writedata(7 downto 0); + mon_pt_sel_1 <= avs_writedata(15 downto 8); + mon_pt_sel_2 <= avs_writedata(23 downto 16); + mon_pt_sel_3 <= avs_writedata(31 downto 24); when CSR_MON_PT_STRETCH_ADDR => - mp_stretch_en <= avs_writedata( 3 downto 0); + mp_stretch_en <= avs_writedata(3 downto 0); when CSR_SOM_LED_ADDR => - som_led <= avs_writedata( 4 downto 0); + som_led <= avs_writedata(4 downto 0); when CSR_STM8_ADDR => stm8_trigger_rx <= avs_writedata(0); - when CSR_MON_PT_PIN_SEL => + when CSR_MON_PT_PIN_SEL_ADDR => mon_pt_pin_rewire <= avs_writedata(0); + when CSR_SOM_GROUP_D_LED_ADDR => + n_group_d_led_r <= avs_writedata(0); + n_group_d_led_y <= avs_writedata(1); + n_group_d_led_g <= avs_writedata(2); when others => null; end case; end if; - + -- Read Ctrl & Status registers - if(ctrl_read = '1') then + if (ctrl_read = '1') then case avs_addr is when CSR_IP_ID_ADDR => avs_readdata_i <= CSR_IP_ID; - when CSR_IP_VER_ADDR => + when CSR_IP_VER_ADDR => avs_readdata_i <= CSR_IP_VER; - when CSR_PWR_GOOD_ADDR => + when CSR_PWR_GOOD_ADDR => avs_readdata_i <= (0 => p_good, 1 => p_in_good, 2 => p_host_good, others => '0'); when CSR_HOST_PWR_ADDR => - avs_readdata_i(0) <= host_pwr_en; - avs_readdata_i(1) <= host_5v_en; - avs_readdata_i(2) <= host_3v3_en; - avs_readdata_i(3) <= host_2v5_en; - avs_readdata_i(4) <= host_1v5_en; - avs_readdata_i(5) <= host_1v2_en; - avs_readdata_i(6) <= host_1v1_en; + avs_readdata_i(0) <= host_pwr_en; + avs_readdata_i(1) <= host_5v_en; + avs_readdata_i(2) <= host_3v3_en; + avs_readdata_i(3) <= host_2v5_en; + avs_readdata_i(4) <= host_1v5_en; + avs_readdata_i(5) <= host_1v2_en; + avs_readdata_i(6) <= host_1v1_en; avs_readdata_i(31 downto 7) <= (others => '0'); when CSR_MON_PT_SEL_ADDR => avs_readdata_i <= mon_pt_sel_3 & mon_pt_sel_2 & mon_pt_sel_1 & mon_pt_sel_0; @@ -232,16 +242,18 @@ begin avs_readdata_i <= 27x"0" & som_led; when CSR_STM8_ADDR => avs_readdata_i <= (0 => stm8_trigger_rx, 8 => stm8_alert_tx, others => '0'); - when CSR_MON_PT_PIN_SEL => + when CSR_MON_PT_PIN_SEL_ADDR => avs_readdata_i <= (0 => mon_pt_pin_rewire, others => '0'); + when CSR_SOM_GROUP_D_LED_ADDR => + avs_readdata_i <= 29x"0" & n_group_d_led_g & n_group_d_led_y & n_group_d_led_r; when others => avs_readdata <= X"BAD1BAD0"; end case; end if; -- Output mux between local status registers and the swim if. Adjust -- latency for the read-valid. - swim_read_d <= swim_read; - if(swim_read_d = '1') then + swim_read_d <= swim_read; + if (swim_read_d = '1') then avs_readdata <= swim_readdata; else avs_readdata <= avs_readdata_i; diff --git a/generic_ip/som_ctrl/1/src/som_ctrl_1_pkg.vhd b/generic_ip/som_ctrl/1/src/som_ctrl_1_pkg.vhd index 2e0802b..192ce2c 100644 --- a/generic_ip/som_ctrl/1/src/som_ctrl_1_pkg.vhd +++ b/generic_ip/som_ctrl/1/src/som_ctrl_1_pkg.vhd @@ -21,17 +21,18 @@ use ieee.numeric_std.all; package som_ctrl_1_pkg is - constant CSR_IP_ID_ADDR : std_logic_vector(3 downto 0) := 4x"0"; - constant CSR_IP_VER_ADDR : std_logic_vector(3 downto 0) := 4x"1"; - constant CSR_PWR_GOOD_ADDR : std_logic_vector(3 downto 0) := 4x"2"; - constant CSR_HOST_PWR_ADDR : std_logic_vector(3 downto 0) := 4x"3"; - constant CSR_MON_PT_SEL_ADDR : std_logic_vector(3 downto 0) := 4x"4"; - constant CSR_MON_PT_STRETCH_ADDR : std_logic_vector(3 downto 0) := 4x"5"; - constant CSR_SOM_LED_ADDR : std_logic_vector(3 downto 0) := 4x"6"; - constant CSR_STM8_ADDR : std_logic_vector(3 downto 0) := 4x"7"; - constant CSR_MON_PT_PIN_SEL : std_logic_vector(3 downto 0) := 4x"8"; + constant CSR_IP_ID_ADDR : std_logic_vector(3 downto 0) := 4x"0"; + constant CSR_IP_VER_ADDR : std_logic_vector(3 downto 0) := 4x"1"; + constant CSR_PWR_GOOD_ADDR : std_logic_vector(3 downto 0) := 4x"2"; + constant CSR_HOST_PWR_ADDR : std_logic_vector(3 downto 0) := 4x"3"; + constant CSR_MON_PT_SEL_ADDR : std_logic_vector(3 downto 0) := 4x"4"; + constant CSR_MON_PT_STRETCH_ADDR : std_logic_vector(3 downto 0) := 4x"5"; + constant CSR_SOM_LED_ADDR : std_logic_vector(3 downto 0) := 4x"6"; + constant CSR_STM8_ADDR : std_logic_vector(3 downto 0) := 4x"7"; + constant CSR_MON_PT_PIN_SEL_ADDR : std_logic_vector(3 downto 0) := 4x"8"; + constant CSR_SOM_GROUP_D_LED_ADDR : std_logic_vector(3 downto 0) := 4x"9"; -- offset for the SWIM interface subblock - constant CSR_SWIM_IF_OFFSET : std_logic_vector(5 downto 0) := 6x"20"; + constant CSR_SWIM_IF_OFFSET : std_logic_vector(5 downto 0) := 6x"20"; end package som_ctrl_1_pkg;