학습 주제

  • SystemVerilog 개요
  • 데이터 타입
  • 모듈, 인터페이스, 패키지
  • 절차적 프로그래밍 (tasks, functions)
  • Class 및 객체 지향 프로그래밍


학습 목표

  • SystemVerilog의 기본 구조와 문법 이해
  • 다양한 데이터 타입과 모듈 설계
  • Class와 객체 지향 프로그래밍 개념 적용


학습 자료

  • IEEE Std 1800-2017 : SystemVerilog 표준 문서의 기본 개념 부분
  • SystemVerilog 온라인 튜토리얼 : 다양한 튜토리얼 사이트에서 기본 문법과 예제 학습
  • 강의 비디오 : 유투브 또는 다른 교육 플랫폼에서 제공하는 SystemVerilog 강의


학습 활동

  • 기초 문법 연습 : 간단한 SystemVerilog 코드 작성 및 Simulation
  • Data type 실습 : 다양한 data type을 사용하는 예제 코드 작성
  • 모듈 설계 : 기본 모듈을 설계하고 인터페이스와 패키지를 활용한 간단한 프로젝트 수행

1. SystemVerilog 개요
SystemVerilog는 HW 설계와 검증을 위한 언어로, Verilog를 확장하여 더 강력한 기능을 제공합니다. 주요 특징으로는 Data type extension, class와 객체 지향 프로그래밍(OOP : Object-Oriented Programming), assertion, coverage, constraint randomization 등이 있습니다.

2. Data type
SystemVerilog는 다양한 data type을 제공합니다. 기본 data type과 사용자 정의 data type을 사용하여 더 유연한 설계를 할 수 있습니다.
기본 data type :

  • bit : 0 or 1 값을 가질 수 있는 data type
  • logic : 4가지 상태 (0, 1, x, z)를 가질 수 있는 data type
  • reg : register type, 기본 verilog type
  • int: 32bit 정수 타입
  • shortint : 16bit int type
  • longint : 64bit int type
  • integer : basic int type
  • byte: 8bit int type

User define date type:

  • enum : 열거형 타입으로, 특정 값의 집합으로 정의할 수 있습니다.
  • struct: 구조체 타입으로, 여러 변수를 묶어서 사용할 수 있습니다.
  • union: 공용체 타입으로, 여러 변수를 하나의 메모리 공간에 할당할 수 있습니다.
module data_types_example;
  // 기본 데이터 타입
  bit a;
  logic b;
  reg c;
  int d;
  byte e;

  // 사용자 정의 데이터 타입
  typedef enum {RED, GREEN, BLUE} color_t;
  color_t my_color;

  typedef struct {
    int id;
    string name;
  } person_t;
  person_t person;

  typedef union {
    int i;
    byte b[4];
  } data_t;
  data_t data;

  initial begin
    // 기본 데이터 타입 할당
    a = 1;
    b = '0;
    c = 1'bx;
    d = -12345;
    e = 8'hFF;

    // 사용자 정의 데이터 타입 할당
    my_color = RED;
    person = '{id: 1, name: "Alice"};
    data.i = 32'hAABBCCDD;

    // 출력
    $display("a = %b, b = %b, c = %b, d = %d, e = %h", a, b, c, d, e);
    $display("my_color = %0d", my_color);
    $display("person.id = %0d, person.name = %s", person.id, person.name);
    $display("data.i = %h, data.b = %h %h %h %h", data.i, data.b[3], data.b[2], data.b[1], data.b[0]);
  end
endmodule

3. Module, Interface, Package
Module :
SystemVerilog에서 모듈은 설계의 기본단위 입니다. 모듈은 입력, 출력, 내부 신호등을 포함하여, 다른 모듈을 인스턴스화할 수 있습니다.

module simple_module(input logic a, b, output logic c);
  assign c = a & b;
endmodule

module top_module;
  logic a, b, c;

  // 모듈 인스턴스화
  simple_module u1 (.a(a), .b(b), .c(c));

  initial begin
    a = 1;
    b = 0;
    #10;
    $display("c = %b", c);
  end
endmodule

Interface:
Interface는 모듈 간의 신호 연결을 정의하고 관리 할 수 있는 방법 입니다.

interface simple_if;
  logic a, b, c;
endinterface

module simple_module(input simple_if intf);
  assign intf.c = intf.a & intf.b;
endmodule

module top_module;
  simple_if intf();

  // 모듈 인스턴스화
  simple_module u1 (.intf(intf));

  initial begin
    intf.a = 1;
    intf.b = 0;
    #10;
    $display("c = %b", intf.c);
  end
endmodule

Package:
Package는 여러 module에서 공통적으로 사용할 수 있는 상수, 타입, 함수 등을 정의하는데 사용됩니다.

package my_pkg;
  typedef enum {RED, GREEN, BLUE} color_t;
  function void print_color(color_t color);
    $display("Color: %0d", color);
  endfunction
endpackage

module top_module;
  import my_pkg::*;

  initial begin
    color_t my_color = RED;
    print_color(my_color);
  end
endmodule

4. 절차적 프로그래밍 (tasks, functions)
tasks & functions:
SystemVerilog에서 task와 function은 절차적 프로그래밍을 위해 사용됩니다.
function을 값을 반환하고, task는 반환하지 않습니다.

module tasks_functions_example;
  function int add(int a, int b);
    return a + b;
  endfunction

  task display_sum(int a, int b);
    $display("Sum: %0d", add(a, b));
  endtask

  initial begin
    int x = 10;
    int y = 20;
    display_sum(x, y);
  end
endmodule

5. Class와 OOP
SystemVerilog는 객체 지향 프로그래밍을 지원하여 복잡한 설계와 검증을 더욱 효율적으로 할 수 있습니다. Class를 사용하여 데이터의 기능을 캡슐화하고 재사용할 수 있습니다.

class MyClass;
  int a;
  function new(int a);
    this.a = a;
  endfunction

  function void display();
    $display("a = %0d", a);
  endfunction
endclass

module top_module;
  initial begin
    MyClass obj = new(10);
    obj.display();
  end
endmodule


'HW > SystemVerilog' 카테고리의 다른 글

[SystemVerilog] Data tpye and Module design  (0) 2024.05.25
SystemVerilog 및 UVM 공부 계획  (0) 2024.05.25
[SystemVerilog]Verification Guidelines  (0) 2024.04.21

목표:

SystemVerilog 및 UVM을 통해 하드웨어 설계와 검증에 대한 포괄적인 이해를 달성하는 것을 목표로 합니다. 이를 위해 기초 개념부터 시작하여 고급 주제와 실습을 포함한 체계적인 학습 계획을 수립합니다.

기간:

총 12주 (3개월)

1. 주차: 기초 다지기 (SKIP)


**학습 주제:**
- 하드웨어 설명 언어(HDL) 개요
- Verilog 기본 문법 및 구조

**학습 자료:**
- Verilog 튜토리얼
- 간단한 Verilog 예제 코드 작성 및 시뮬레이션

**활동:**
- 간단한 논리 게이트 설계 및 시뮬레이션
- Verilog를 사용한 기본 회로 설계 연습

2-4. 주차: SystemVerilog 기초


**학습 주제:**
- SystemVerilog 개요
- 데이터 타입, 모듈, 인터페이스, 패키지
- 절차적 프로그래밍 (tasks, functions)
- 클래스 및 객체 지향 프로그래밍

**학습 자료:**
- IEEE Std 1800-2017 (SystemVerilog 표준 문서)
- SystemVerilog 온라인 튜토리얼 및 강의

**활동:**
- 다양한 데이터 타입 및 모듈 설계
- 클래스를 활용한 간단한 프로젝트

5-6. 주차: 고급 SystemVerilog 기능


**학습 주제:**
- 어서션 (Assertions)
- 커버리지 (Coverage)
- 제약 랜덤화 (Constrained Randomization)

**학습 자료:**
- IEEE Std 1800-2017, 어서션 및 커버리지 섹션
- SystemVerilog Assertions (SVA) 강의 및 실습

**활동:**
- 어서션을 사용한 테스트 벤치 작성
- 커버리지 포인트 설정 및 분석

7-9. 주차: UVM 기초


**학습 주제:**
- UVM 개요
- UVM 컴포넌트 및 시퀀스
- UVM 테스트 벤치 아키텍처

**학습 자료:**
- UVM 1.2 User Guide
- UVM Framework 튜토리얼

**활동:**
- 간단한 UVM 테스트 벤치 작성
- UVM 시퀀스를 사용한 테스트 케이스 작성

10-11. 주차: UVM 고급 주제


**학습 주제:**
- UVM 팩토리 및 설정
- UVM 리포팅 및 콜백
- 고급 UVM 시퀀스 및 드라이버 작성

**학습 자료:**
- UVM 1.2 User Guide 고급 섹션
- 고급 UVM 예제 및 실습

**활동:**
- 복잡한 UVM 테스트 벤치 작성
- UVM 콜백을 사용한 동적 테스트 환경 구성

12. 주차: 종합 프로젝트 및 리뷰


**학습 주제:**
- 종합 프로젝트
- 리뷰 및 피드백

**활동:**
- SystemVerilog 및 UVM을 사용한 종합 프로젝트 수행
- 프로젝트 리뷰 및 개선 사항 도출

---

### 추가 자료 및 참고 문헌
- [IEEE Std 1800-2017](https://ieeexplore.ieee.org/document/8299595)
- [UVM 1.2 User Guide](https://accellera.org/downloads/standards/uvm)
- [SystemVerilog for Verification](https://books.google.com/books?id=RYwvLQzIVDQC)

이 학습 계획을 통해 SystemVerilog 및 UVM의 기본부터 고급 주제까지 포괄적으로 학습할 수 있으며, 실습을 통해 이론을 실제 설계와 검증에 적용해볼 수 있습니다.

'HW > SystemVerilog' 카테고리의 다른 글

[SystemVerilog] Data tpye and Module design  (0) 2024.05.25
[SystemVerilog] SystemVerilog 기초  (0) 2024.05.25
[SystemVerilog]Verification Guidelines  (0) 2024.04.21

ChatGPT로 하는 System verilog 공부

1. Verification Guidelines

  • Topics Covered: 증에 대한 소개, 검증 프로세스 및 가이드라인.
  • Key Concepts: 검증 계획의 이해, 기본 방법론, 검증에서 버그의 중요성.
  • Start Here: Chapter 1 (Pages 1-25)

2. Data Types and Structures

  • Topics Covered: 장 데이터 유형, 배열, 큐, 연관 배열, 사용자 정의 구조, 열거 유형.
  • Key Concepts: 데이터를 효율적으로 관리하고 테스트벤치 디자인에 적합한 데이터 유형 선택.
  • Progress To: Chapter 2 (Pages 27-53)

3. Procedural Statements and Routines

  • Topics Covered: 작업, 함수 및 절차적 제어.
  • Key Concepts: 코드를 조직하고 테스트벤치 구성 요소를 구축하는 데 사용되는 작업 및 함수.
  • Continue With: Chapter 3 (Pages 55-65)

4. Basic Object-Oriented Programming

  • Topics Covered: 클래스, 객체 및 SystemVerilog에서의 기본 OOP 개념.
  • Key Concepts: 객체 생성 및 관리, 테스트벤치에서 클래스 사용.
  • Study Next: Chapter 4 (Pages 67-97)

5. Connecting the Testbench and Design

  • Topics Covered: 인터페이스, 테스트벤치와 디자인의 분리, 동기화.
  • Key Concepts: 테스트벤치와 디자인 간의 상호 작용을 연결하고 관리하는 방법.
  • Move To: Chapter 5 (Pages 99-134)

6. Randomization

  • Topics Covered: 랜덤화 기술, 제약 조건, 일반적인 문제.
  • Key Concepts: 효과적인 테스트 시나리오를 만들기 위해 랜덤화 활용.
  • Next Step: Chapter 6 (Pages 135-182)

7. Threads and Interprocess Communication

  • Topics Covered: 멀티 스레딩, 동기화 기술 및 IPC.
  • Key Concepts: 복잡한 시나리오를 시뮬레이션하기 위해 스레드 및 IPC 사용.
  • Study: Chapter 7 (Pages 183-214)

8. Advanced OOP and Testbench Architecture

  • Topics Covered: 상속, 팩토리 패턴, 가상 메소드, 테스트벤치 계층화.
  • Key Concepts: 확장 가능하고 재사용 가능한 테스트벤치 디자인을 위한 고급 OOP 기술.
  • Proceed To: Chapter 8 (Pages 215-240)

9. Functional Coverage

  • Topics Covered: 커버리지 메트릭, 전략, 분석.
  • Key Concepts: 검증 노력을 측정하고 지향하기 위해 커버리지 사용.
  • Continue With: Chapter 9 (Pages 241-277)

10. Advanced Interfaces

  • Topics Covered: 가상 인터페이스, 인터페이스에서의 절차적 코드.
  • Key Concepts: 복잡한 테스트벤치 시나리오를 위한 고급 인터페이스 기술.
  • Conclude With: Chapter 10 (Pages 279-294)

Final Review and Practice

  • Review All Chapters: 주요 포인트 요약, 복잡한 주제 재방문.
  • Practical Exercises: 작은 프로젝트나 사례 연구에서 개념을 적용하여 학습을 강화.

+ Recent posts