VHDL : 레코드로 일반 유형을 정의 할 수 있습니까?

복잡한 유형 (즉, 실수 부분과 허수 부분으로 구성된 유형)을 정의하려고하는데이를 제네릭으로 만드는 방법을 찾으려고합니다.

This my current static code:

  type complex_vector is record
    Re : signed(15 downto 0);
    Im : signed(15 downto 0);
  end record;

이제 이런 일반화 방법이 있는지 궁금합니다. 다른 말로하면 다음과 같습니다.

  type complex_vector (Generic: Integer := WIDTH) is record
    Re : signed(WIDTH downto 0);
    Im : signed(WIDTH downto 0);
  end record;

Google에서 해결책을 찾고 책을 살펴 보려고했지만 해결책을 찾을 수 없습니다. 정말 없나요? 레코드가 없으면 다음과 같이 작성할 수 있습니다.

type blaaa is array (NATURAL range <>) of STD_LOGIC;

입력 해 주셔서 감사합니다

편집 :

또는 다음과 같은 작업을 수행 할 수 있습니까?

type complex_primitives is (re, im);
type complex_vector is array (re to im) of signed(natural range <>);

컴파일러가 불평합니다 ..

7
задан Andreas Sjöström 15 June 2011 в 13:57
поделиться