async def do_random_test(dut, permutation=1): params = await write_all_mem_random(dut, permutation=permutation) input_features = get_random_input() fc_exp, c1_exp, c2_exp = na.get_numpy_pred_custom_params(input_features, params) await write_input_features(dut, input_features) cocotb.fork(read_conv_output(dut, 1, 50, 8, c1_exp)) cocotb.fork(read_conv_output(dut, 2, 25, 16, c2_exp)) await read_fc_output(dut, fc_exp)
async def do_mfcc_test(dut): input_features, index = na.get_random_featuremap() fc_exp, c1_exp, c2_exp = na.get_numpy_pred_custom_params(input_features, \ na.get_params()) wake = (fc_exp[0] > fc_exp[1]) await write_input_features(dut, input_features) cocotb.fork(read_conv_output(dut, 1, 50, 8, c1_exp)) cocotb.fork(read_conv_output(dut, 2, 25, 16, c2_exp)) await read_fc_output(dut, fc_exp) await read_wake(dut, wake)