TAILIEUCHUNG - SystemVerilog For Design phần 3

SystemVerilog nhận dạng tìm kiếm quy tắc Các tờ khai trong phạm vi biên dịch đơn vị có thể được tham chiếu bất cứ nơi nào trong hệ thống phân cấp của mô-đun là một phần của đơn vị biên soạn. biên soạn SystemVerilog xác định một quy tắc tìm kiếm đơn giản và trực quan khi phạm vi đơn vị | Chapter 3 SystemVerilog Literal Values and Built-in Data Types 61 count and temp are only used within the function and the values of the variables are only used by the current call to the function. In-line initialization of variables declared with the const qualifier is also synthesizable. Section on page 71 covers const declarations. Guidelines for using static and automatic variables The following guidelines will aid in the decision on when to use static variables and when to use automatic variables. In an always or initial block use static variables if there is no in-line initialization and automatic variables if there is an inline initialization. Using automatic variables with in-line initialization will give the most intuitive behavior because the variable will be re-initialized each time the block is re-executed. If a task or function is to be re-entrant it should be automatic. The variables also ought to be automatic unless there is a specific reason for keeping the value from one call to the next. As a simple example a variable that keeps a count of the number of times an automatic task or function is called would need to be static. If a task or function represents the behavior of a single piece of hardware and therefore is not re-entrant then it should be declared as static and all variables within the task or function should be static. Deterministic variable initialization Initialization determinism Verilog-1995 variable initialization In the original Verilog language which was standardized in 1995 variables could not be initialized at the time of declaration as can be done in C. Instead a separate initial procedural block was required to set the initial value of variables. For example 62 SystemVerilog for Design integer i declare a variable named i integer j declare a variable named j initial i 5 initialize i to 5 initial j i initialize j to the value of i Verilog-1995 initialization can be nondeterministic Verilog initialization is

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.