類屬(Generic)
塊和其環境進行通信的一個靜態信息通道。
A channel for static information to be communicated to a block from its environment.
語法(Syntax)
generic ( generic_name, ... : data_type [ := exPRession ] );generic ( 類屬名, ... : 數據類型 [ := 設定值 ] );說明(Description)類屬用來參數化一個設計實體。他為塊提供了一個類似于常量的靜態信息,但不同與常量的是類屬可以被外部賦值。在同一設計實體中的不同實例可以擁有不同的類屬值。實例中類屬的值通過類屬映射來進行賦值。
A generic is used to parameterize a design entity. They support static information to blocks in a similar way as constants, but unlike constants the values of generics can be supplied externally. Different instances of the same design entity can have different values for the generic parameters. Generics are given values in the generic map of an instance.
在實體中類屬定義的值可以被實體讀取,也可被相關聯的結構體進行讀取。Values supported by generics declared in an entity can be read either in the entity or in the associated architectures.
實體中的類屬必須在相應的元件中進行復制,從而允許元件的例化通過默認規則來進行配置。The generics of an entity must be duplicated in the corresponding component, to allow instances of the component to be configured implicitly via the default rules.
例程(Example)
generic (BusWidth: integer := 16; Length, Size: positive);注釋(Note)許多綜合工具僅支持整型類屬。Many synthesis tools support only generics of type Integer.
新聞熱點
疑難解答