Verible - 설치 및 사용법

2024. 12. 15. 08:15·Hardware/ETC.

Verible?

  • SystemVerilog 코드의 스타일 점검, 포매팅, 파싱, linting 및 기타 개발 워크플로를 지원하는 오픈소스 도구 모음
  • 주로 Chips Alliance에서 개발
  • SystemVerilog 코드를 효율적으로 다루기 위한 도구를 제공

기능

코드 포매터 (Code Formatter)

  • SystemVerilog 코드를 스타일 규칙에 맞게 자동으로 포맷합니다.
  • 일관된 코딩 스타일을 유지하고 코드 가독성을 높이기 위한 도구입니다.

Linting (스타일 체크 및 분석)

  • SystemVerilog 코드의 스타일 및 잠재적 문제를 감지합니다.
  • 팀 또는 프로젝트에서 정의한 코딩 규칙에 따라 규칙 기반 점검을 수행합니다.

구문 파싱 및 AST 생성

  • SystemVerilog 코드의 Abstract Syntax Tree (AST)를 생성하고 이를 기반으로 커스텀 분석을 수행할 수 있습니다.
  • 언어 구문 규칙을 따르는지 확인합니다.

Lexical Token Stream

  • SystemVerilog 코드를 분석하여 lexical 토큰 스트림을 생성합니다.
  • 코드를 더 깊이 디버깅하거나 분석하는 데 사용됩니다.

Verible Language Server (VS Code 통합)

  • VS Code와 통합하여 코드 작성 중 linting, 포매팅 및 실시간 피드백을 제공합니다.
  • 생산성을 높이고 IDE 환경에서 개발을 최적화합니다.

설치방법

https://github.com/chipsalliance/verible

# 의존성 설치 (Ubuntu/Debian 기준)
sudo apt-get install -y \
    bazel \
    g++ \
    clang \
    cmake

# Verible 소스 다운로드
git clone https://github.com/chipsalliance/verible.git
cd verible

# Bazel로 빌드
bazel build //...

# 빌드된 실행 파일은 다음 위치에 생성됩니다:
# bazel-bin/verilog/tools/formatter/verible-verilog-format

사용방법

Formatter

# SystemVerilog 파일을 포매팅
verible-verilog-format <파일 경로>

# 재귀적으로 디렉토리 내 모든 파일 포매팅
find . -name "*.sv" | xargs verible-verilog-format --inplace

Linting

# SystemVerilog 파일에서 linting 실행
verible-verilog-lint <파일 경로>

# 특정 lint 규칙 활성화/비활성화
verible-verilog-lint --rules_config <설정 파일>

파싱 및 AST 생성

# AST를 stdout에 출력
verible-verilog-syntax <파일 경로>

# AST를 파일로 저장
verible-verilog-syntax <파일 경로> --printtree > output.ast

VS Code Extension

https://marketplace.visualstudio.com/items?itemName=CHIPSAlliance.verible
위에서 설치한 Verible이 있어야 작동
verible-* 실행 파일 경로를 환경 변수에 추가
VS Code에서 .sv 파일 작성 시 실시간 피드백 확인 가능

저작자표시 비영리 변경금지 (새창열림)
'Hardware/ETC.' 카테고리의 다른 글
  • Verilog [ generate와 always@(*) ] 차이점
  • Verilator 설치
  • Windows 11 - WSL 설치 및 세팅
Zi_Yoon
Zi_Yoon
머리 속에 정리하는 곳 <전자공학>
  • Zi_Yoon
    ZY_repo
    Zi_Yoon
  • 전체
    오늘
    어제
    • 분류 전체보기 (70)
      • HDLBits (25)
        • Verilog (19)
        • Circuits (4)
        • Verification (0)
      • IDEC 교육 (1)
        • Embedded C (13)
        • Verilog HDL (8)
      • Hardware (8)
        • RISC-V Project (1)
        • Computer Architecture (0)
        • AMBA (2)
        • FPGA (0)
        • 논문 읽기 (1)
        • ETC. (4)
      • 42서울 (13)
        • 리눅스 (12)
        • 네트워크 (1)
      • 생각 (1)
      • 취업 (1)
  • 블로그 메뉴

    • 홈
    • 태그
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    fpga
    verilator
    세션 키
    APT
    axi
    IDEC
    Keil
    verilog
    vm
    debian
    bit-wise and
    AXI4
    QUARTUS
    비대칭 키
    ARM
    signal trap
    보안 쉘
    hdlbits
    AppArmor
    fucntion
    lsblk
    embedded
    research rabbit
    RISC-V
    c
    charater
    ssh
    AMBA
    pointer
    centos
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
Zi_Yoon
Verible - 설치 및 사용법
상단으로

티스토리툴바