Authors | Patrick Lehmann |
---|---|
Date Proposed | 2017-04-03 |
Last Updated | 2017-04-03 |
Focus | simulation and synthesis |
Dependencies | Mode views with discriminates |
LCS | TBD |
-- 3 different physical interface from FPGA to a 1GbE PHY chip type BusInterfaceKind is (RGMII, GMII, SGMII); -- Ada style type NET_PCB_IF (kind : BusInterfaceKind) is record case kind is when RGMII => TX_Data : std_logic_vector(4 downto 0); RX_Data : std_logic_vector(4 downto 0); when GMII => TX_Data : std_logic_vector(7 downto 0); TX_Valid : std_logic; TX_Error : std_logic; RX_Data : std_logic_vector(7 downto 0); RX_Valid : std_logic; RX_Error : std_logic; when SGMII => TX_P : std_logic; TX_N : std_logic; RX_P : std_logic; RX_N : std_logic; end case; MDIO_Clock : std_logic; MDIO_Data : std_logic; end record; entity Ethernet is generic ( PHY_BUS_KIND : BusInterfaceKind ); port ( Clock : std_logic; PHY_IF : NET_PCB_IF )
if
or case
branches.
type NET_PCB_IF (kind : BusInterfaceKind) is record case kind is when CHOICE_1 => element_1 : type1; when CHOICE_2 => element_2 : type2; end case; end record;
type NET_PCB_IF is record generic ( kind : BusInterfaceKind ); case kind is when CHOICE_1 => element_1 : type1; when CHOICE_2 => element_2 : type2; end case; end record;
type NET_PCB_IF is record (kind : BusInterfaceKind) of case kind is when CHOICE_1 => element_1 : type1; when CHOICE_2 => element_2 : type2; end case; end record;