Skip to content
Snippets Groups Projects
Commit 8492e8b9 authored by auphelia's avatar auphelia
Browse files

[Test] Update some custom op tests to make sure correct exp cycles are validated

parent 839bbb2a
No related branches found
No related tags found
No related merge requests found
......@@ -135,8 +135,10 @@ def test_fpgadataflow_duplicatestreams(idt, ch, fold, imdim, exec_mode):
assert (y1 == expected_y).all(), exec_mode + " failed"
if exec_mode == "rtlsim":
inst = getCustomOp(model.graph.node[0])
node = model.get_nodes_by_op_type("DuplicateStreams_Batch")[0]
inst = getCustomOp(node)
sim_cycles = inst.get_nodeattr("sim_cycles")
exp_cycles_dict = model.analysis(exp_cycles_per_layer)
exp_cycles = exp_cycles_dict[str(model.graph.node[0])]
exp_cycles = exp_cycles_dict[str(node)]
assert np.isclose(exp_cycles, sim_cycles, atol=10)
assert exp_cycles != 0
......@@ -127,8 +127,10 @@ def test_fpgadataflow_fmpadding(idim, pad, num_ch, simd, pad_style, idt, mode):
assert (y_produced == y_expected).all()
if mode == "rtlsim":
inst = getCustomOp(model.graph.node[0])
node = model.get_nodes_by_op_type("FMPadding_Batch")[0]
inst = getCustomOp(node)
sim_cycles = inst.get_nodeattr("sim_cycles")
exp_cycles_dict = model.analysis(exp_cycles_per_layer)
exp_cycles = exp_cycles_dict[str(model.graph.node[0])]
exp_cycles = exp_cycles_dict[str(node)]
assert np.isclose(exp_cycles, sim_cycles, atol=10)
assert exp_cycles != 0
......@@ -155,8 +155,10 @@ def test_fpgadataflow_thresholding(idt, act, nf, ich, exec_mode):
hls_synt_res_est = model.analysis(hls_synth_res_estimation)
assert "Thresholding_Batch_0" in hls_synt_res_est
inst = getCustomOp(model.graph.node[0])
node = model.get_nodes_by_op_type("Thresholding_Batch")[0]
inst = getCustomOp(node)
sim_cycles = inst.get_nodeattr("sim_cycles")
exp_cycles_dict = model.analysis(exp_cycles_per_layer)
exp_cycles = exp_cycles_dict[str(model.graph.node[0])]
exp_cycles = exp_cycles_dict[str(node)]
assert np.isclose(exp_cycles, sim_cycles, atol=10)
assert exp_cycles != 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment