1.nvdla hw master github

  1. https://github.com/nvdla/hw/tree/master
  2. NVDLA Environment Setup Guide
  3. NVDLA Verification Suite User Guide

首先checkout nvdla hw master breach,然后按照第2,3步,完成build和healt check,当nvdla tree build完之后,就可以跑case了,通过跑case来check环境是否完善,build是否成功。

仿真结束后,在log的结尾会打印如下pass fail 信息:

*******************************
**        TEST PASS          **
*******************************


PPPP     A     SSSSS  SSSSS
P   P   A A    S      S
PPPP   AAAAA   SSSSS  SSSSS
P     A     A      S      S
P     A     A  SSSSS  SSSSS

or

*******************************
**        TEST FAILED        **
*******************************


FFFFF    A     IIIII  L
F       A A      I    L
FFFF   AAAAA     I    L
F     A     A    I    L
F     A     A  IIIII  LLLLL

2. test suite

主要有两类tests,一类是直接测试,一类是uvm的受约束的随机测试(constrained-random tests)。

 NV_SMALL project的直接测试路径为:TOT/verif/tests/trace_tests/nv_small

受约束的随机测试的路径为:TOT/verif/tests/trace_tests/uvm_tests

*目前为止,只有直接测试是官方ready的

\"\"

3. 直接测试举例

以TOT/verif/tests/trace_tests/nv_small/cdp_1x1x1_lrn3_int8_0/为例,对直接测试进行简单讲解。

直接测试是以一种自定义的trace format的形式编写的,nvdla 定义了9种configuration commands。参考如下:

Name De ion Syntax Use case
reg_write Write data to specific DUT register reg_write(reg_n ame, reg_value); Fundamental operation for register configuration
reg_read_expect ed Read data from specific DUT register, compare with expected value reg_read_expect ed(addr, expected_data); For some special cases like register accessing tests
reg_read Read data from specific DUT register reg_read(reg_na me, return_value); For specific cases which may need to do post-processing on read return value.
sync_notify Specified p sequencer will send out synchronization event sync_notify(tar get_resource, sync_id); CC pipeline, OP_EN configuration order, CACC->CMAC->CSC .
sync_wait Specified p sequencer will wait on synchronization event sync_wait(targe t_resource, sync_id); CC pipeline, OP_EN configuration order, CACC->CMAC->CSC .
intr_notify

Monitor DUT interrupt, catch and clear interrupt and send synchronization event.

There could be multiple intr_notify, all those intr_notify are processed sequentially. The processing order is the same as commands’ line order in configuration file.

intr_notify(int r_id, sync_id); // notify when specific interrupt fired

Hardware complete notification, informing test bench that test is ended.

Multi- test which is presumed containing 0 ~ N, for n >1 s, they shall wait for interrupts.

poll

Continues poll register/field value from DUT, until one of the following conditions are met:

  1. Equal, polled value is equal to expected value
  2. Greater, polled value is greater than expected value
  3. Less, polled value is less than expected value
  4. Not equal, polled value is not equal to expected value
  5. Not greater, polled value is not greater than expected value
  6. Not less, polled value is not less than expected value

poll_field_equa l(target_resour ce, register_name, field_name, expected_value) ;

poll_reg_equal( target_resource , register_name, expected_value) ;

poll_field_grea ter(target_reso urce, register_name, field_name, expected_value) ;

poll_reg_less(t arget_resource, register_name, expected_value) ;

poll_field_nt_ greater(taget_ resource, register_name, field_name, expected_value) ;

poll_reg_not_le ss(target_resou rce, register_name, expected_value) ;

Convolution case, wait until CBUF flush has done
check

Invoke p result checking method.

When test bench works in RTL/CMOD cross checking mode, neither golden CRC nor golden files are necessary in this case. Method check_nothing() shall be added to trace file to indicated test end event.

check_crc(syn_ id, memory_type, _address, size, golden_crc_valu e);

check_file(sync _id, memory_type, _address, size, “golden_file_na me”);

check_nothing(s ync_id);

CRC check for no CMOD simulation (usually generated by arch/inherit from previous project/eyeball gilded)

Golden memory result check for no CMOD simulation (usually generated by arch/inherit from previous project/eyeball gilded)

mem

Load memory from file.

Initialize memory by pattern.

mem_load(ram_ty pe, _addr, file_path); // file_path shall be enclosed by “”

mem_init(ram_ty pe, _addr, size, pattern);

 

*Some functions are not supported yet.

然后

未完待续......

收藏 打印