Skip to content

Commit

Permalink
Remove some copy pasta test comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-xmos committed Nov 28, 2023
1 parent ae58cb9 commit 1fe88c9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 34 deletions.
1 change: 1 addition & 0 deletions tests/test_app_low_level_api/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ int main(int argc, char** argv) {
int16_t error;
sscanf(read_buf, "%hu", &error);
fprintf(stderr, "%hu\n", error);

uint32_t t0 = get_reference_time();
sw_pll_lock_status_t s = sw_pll_do_control_from_error(&sw_pll, error);
uint32_t t1 = get_reference_time();
Expand Down
19 changes: 5 additions & 14 deletions tests/test_lib_sw_pll_equiv.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Copyright 2023 XMOS LIMITED.
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
"""
Assorted tests which run the test_app in xsim
This file is structured as a fixture which takes a while to run
and generates a pandas.DataFrame containing some time domain
outputs from the control loops. Then a series of tests which
check different aspects of the content of this DataFrame.
"""

import pytest
import numpy as np
Expand Down Expand Up @@ -46,10 +38,8 @@ def test_low_level_equivalence(solution_12288, bin_dir):
target_output_frequency=target_mclk_f,
kp=0.0,
ki=2.0,
kii=1.0,
loop_rate_count=loop_rate_count, # copied from ed's setup in 3800
# have to call 512 times to do 1
# control update
kii=1.0, # NOTE WE SPECIFICALLY ENABLE KII in this test as it is not tested elsewhere
loop_rate_count=loop_rate_count,
pll_ratio=int(target_mclk_f / target_ref_f),
ref_clk_expected_inc=0,
app_pll_ctl_reg_val=0,
Expand All @@ -63,7 +53,7 @@ def test_low_level_equivalence(solution_12288, bin_dir):

pll.update_frac_reg(start_reg | app_pll_frac_calc.frac_enable_mask)

input_errors = np.random.randint(-lut_size // 2, lut_size // 2, size = 40)
input_errors = np.random.randint(-lut_size // 10, lut_size // 10, size = 40)
print(f"input_errors: {input_errors}")

result_categories = {
Expand Down Expand Up @@ -128,7 +118,8 @@ def test_low_level_equivalence(solution_12288, bin_dir):
C = results["C"][compare_item]
Python = results["Python"][compare_item]
print("***", compare_item)
print(C, Python)
for c, p in zip(C, Python):
print(c, p)
print()
assert np.allclose(C, Python), f"Error in low level equivalence checking of: {compare_item}"

Expand Down
8 changes: 0 additions & 8 deletions tests/test_sdm_ctrl_equiv.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Copyright 2023 XMOS LIMITED.
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
"""
Assorted tests which run the test_app in xsim
This file is structured as a fixture which takes a while to run
and generates a pandas.DataFrame containing some time domain
outputs from the control loops. Then a series of tests which
check different aspects of the content of this DataFrame.
"""

import pytest
import numpy as np
Expand Down
14 changes: 2 additions & 12 deletions tests/test_sdm_dco_equiv.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Copyright 2023 XMOS LIMITED.
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
"""
Assorted tests which run the test_app in xsim
This file is structured as a fixture which takes a while to run
and generates a pandas.DataFrame containing some time domain
outputs from the control loops. Then a series of tests which
check different aspects of the content of this DataFrame.
"""

import pytest
import numpy as np
Expand All @@ -18,8 +10,6 @@
from matplotlib import pyplot as plt
from subprocess import Popen, PIPE


# from sw_pll.app_pll_model import app_pll_frac_calc
from sw_pll.dco_model import sigma_delta_dco

from test_lib_sw_pll import bin_dir
Expand Down Expand Up @@ -85,8 +75,8 @@ def close(self):

def test_sdm_dco_equivalence(bin_dir):
"""
Simple low level test of equivalence using do_control_from_error
Feed in random numbers into C and Python DUTs and see if we get the same results
Simple low level test of equivalence using do_modulate
Feed in a sweep of DCO control vals into C and Python DUTs and see if we get the same results
"""

args = DutSDMDCOArgs(
Expand Down

0 comments on commit 1fe88c9

Please sign in to comment.