有关uvm类的编译问题
时间:10-02
整理:3721RD
点击:
目前在学习张强的那本《UVM实战》这本书,但是我在使用他的例程的时候发现,项目的类都是不进行编译的,我尝试编译了一个,结果总是报错,不知道该用什么指令来编译。
- `ifndef MY_DRIVER_SV
- `define MY_DRIVER_SV
- class my_driver extends uvm_driver;
- function new(string name = "my_driver", uvm_component parent = null);
- super.new(name, parent);
- endfunction
- extern virtual task main_phase(uvm_phase phase);
- endclass
- task my_driver::main_phase(uvm_phase phase);
- top_tb.rxd <= 8'b0;
- top_tb.rx_dv <= 1'b0;
- while(!top_tb.rst_n)
- @(posedge top_tb.clk);
- for(int i = 0; i < 256; i++)begin
- @(posedge top_tb.clk);
- top_tb.rxd <= $urandom_range(0, 255);
- top_tb.rx_dv <= 1'b1;
- `uvm_info("my_driver", "data is drived", UVM_LOW)
- end
- @(posedge top_tb.clk);
- top_tb.rx_dv <= 1'b0;
- endtask
- `endif