作者:小白蒋
本文主要记录下,synopsys uart vip如何配置使用?
首先是 uart_configuration.sv 文件,直接继承自 uart vip agent configuration;
class uart_configuration extends svt_uart_agent_configuration;
`uvm_object_utils(uart_confiration)
function new(string name="uart_configuration");
super.new(name);
this.is_active = 1;
endfunction
constraint cst_user {
soft handshake_type == HARDWARE;
enable_put_response == 1;
// set data frame
data_width == EIGHT_BIT;
stop_bit == ONE_BIT;
parity_type == NO_PARITY;
}
endclass
在base_test中例化uart_configuration;
class base_test extends uvm_test;
.......
uart_configuration u_uart_cfg;
.......
function void base_test::build_phase(uvm_phase phase);
.....
u_uart_cfg = uart_configuration::type_id::create(“u_uart_cfg”);
u_uart_cfg.randomize();
uvm_