수색…


소개

점잖은 프로그래밍 언어는 주석을 지원합니다. VHDL 코드는 VHDL 코드를 이해하는 것이 보통으로 정교하기 때문에 종종 중요합니다.

한 줄 주석

한 줄 주석은 두 개의 하이픈 ( -- )으로 시작하고 줄 끝까지 확장됩니다. 예 :

-- This process models the state register
process(clock, aresetn)
begin
  if aresetn = '0' then         -- Active low, asynchronous reset
    state <= IDLE;
  elsif rising_edge(clock) then -- Synchronized on the rising edge of the clock
    state <= next_state;
  end if;
end process;

구분 된 주석

VHDL 2008부터 주석은 여러 줄로 확장 될 수 있습니다. 여러 줄 주석은 /* 시작하고 */ 끝납니다. 예 :

/* This process models the state register.
   It has an active low, asynchronous reset
   and is synchronized on the rising edge
   of the clock. */
process(clock, aresetn)
begin
  if aresetn = '0' then
    state <= IDLE;
  elsif rising_edge(clock) then
    state <= next_state;
  end if;
end process;

구분 된 주석은 한 줄 미만으로도 사용할 수 있습니다.

-- Finally, we decided to skip the reset...
process(clock/*, aresetn*/)
begin
  /*if aresetn = '0' then
    state <= IDLE;
  els*/if rising_edge(clock) then
    state <= next_state;
  end if;
end process;

중첩 된 주석

주석 (단일 행 또는 분리 문자) 내에서 새 주석 (한 줄 또는 구분 기호)을 시작하면 아무 효과가 없으므로 무시됩니다. 예 :

-- This is a single-line comment. This second -- has no special meaning.

-- This is a single-line comment. This /* has no special meaning.

/* This is not a
single-line comment.
And this -- has no
special meaning. */

/* This is not a
single-line comment.
And this second /* has no
special meaning. */


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow