一、验证框架
在本章节将建立如所示框架,gen、send、recv等都将封装到类里。
二、测试代码 test.sv
2.1 包含类文件
据说变量 run_for_n_packets 是一个全局变量。
program automatic test(router_io.TB rtr_io);
`include "Packet.sv"
int run_for_n_packets; // number of packets to test
int TRACE_ON = 0;
`include "router_test.h"
`include "Driver.sv"
`include "Receiver.sv"
`include "Generator.sv"
`include "Scoreboard.sv"
2.2 定义变量
semaphore sem[];
Driver drvr[];
Receiver rcvr[]; // receiver
Generator gen[]; // generator
Scoreboard sb;