類屬映射(Generic Map)
類屬映射將值與模塊中的正式類屬進行連接。 A generic map associates values with the formal generics for a block
語法(Syntax)
generic map ( [ 類屬名 => ] 設定值, ... )generic map ( [ generic_name => ] exPRession, ... )說明(Description)
類屬映射給類屬賦值。通常在例化時賦值,也可以在配置中賦值。值可以是位置性關聯或者指定的關聯。 A generic map gives the value to a generic. Usually given in an instance but can also appear in a configuration. The values can be given via positional association or via named association.
為了提高程序的可讀性,降低編譯出錯率,建議使用指定的關聯來賦值。 Use of named association is advised to improve readability and reduce the risk of making errors.
例程(Example)
architecture Structure of Top is component CompA generic (TPLH, TPHL: TIME := 0 ns); port (...); end component; begin u1: CompA generic map (1.9 ns, 2.8 ns) port map (...); u2: CompA generic map (TPLH => 2 ns, TPHL => Top_Tphl) port map (...); end Structure;注釋(Notes)
類屬映射的結尾沒有分號A generic map does not end with a semicolon.新聞熱點
疑難解答