CONSTANTc_diag_test_mode_no_tst:NATURAL:=0;-- no test, the PHY interface runs in normal user mode
CONSTANTc_diag_test_mode_loop_local:NATURAL:=1;-- loop back via PHY chip
CONSTANTc_diag_test_mode_loop_remote:NATURAL:=2;-- loop back via loopback cable or plug in the connector
CONSTANTc_diag_test_mode_tx:NATURAL:=4;-- transmit only
CONSTANTc_diag_test_mode_rx:NATURAL:=5;-- receive only
CONSTANTc_diag_test_mode_tx_rx:NATURAL:=6;-- transmit and receive
CONSTANTc_diag_test_data_lfsr:NATURAL:=0;-- use pseudo random data
CONSTANTc_diag_test_data_incr:NATURAL:=1;-- use incrementing counter data
CONSTANTc_diag_test_duration_quick:NATURAL:=0;-- end Rx test after 1 data frame or word, end Tx test after correspondingly sufficient data frames or words transmitted, or all memory lines
CONSTANTc_diag_test_duration_normal:NATURAL:=1;-- idem for e.g. 100 data frames or words, or full memory
CONSTANTc_diag_test_duration_extra:NATURAL:=2;-- idem for e.g. 100000 data frames or words
CONSTANTc_diag_test_result_ok:NATURAL:=0;-- test went OK
CONSTANTc_diag_test_result_none:NATURAL:=1;-- test did not run, default
CONSTANTc_diag_test_result_timeout:NATURAL:=2;-- test started but no valid data was received
CONSTANTc_diag_test_result_error:NATURAL:=3;-- test received valid data, but the value was wrong for one or more
CONSTANTc_diag_test_result_illegal:NATURAL:=4;-- exception, condition that can not occur in the logic
CONSTANTc_diag_wg_freq_w:NATURAL:=31;-- >> c_diag_wg_nofsamples_w, determines the minimum frequency = Fs / 2**c_diag_wg_freq_w
CONSTANTc_diag_wg_ampl_w:NATURAL:=17;-- Typically fit DSP multiply 18x18 element so use <= 17, to fit unsigned in 18 bit signed,
-- = waveform data width-1 (sign bit) to be able to make a 1 LSBit amplitude sinus
CONSTANTc_diag_wg_mode_off:NATURAL:=0;
CONSTANTc_diag_wg_mode_calc:NATURAL:=1;
CONSTANTc_diag_wg_mode_repeat:NATURAL:=2;
CONSTANTc_diag_wg_mode_single:NATURAL:=3;
TYPEt_diag_wgISRECORD
mode:STD_LOGIC_VECTOR(c_diag_wg_mode_w-1DOWNTO0);
nof_samples:STD_LOGIC_VECTOR(c_diag_wg_nofsamples_w-1DOWNTO0);-- unsigned value
phase:STD_LOGIC_VECTOR(c_diag_wg_phase_w-1DOWNTO0);-- unsigned value
freq:STD_LOGIC_VECTOR(c_diag_wg_freq_w-1DOWNTO0);-- unsigned value
ampl:STD_LOGIC_VECTOR(c_diag_wg_ampl_w-1DOWNTO0);-- unsigned value, range [0:2**c_diag_wg_ampl_w> normalized to range [0 c_diag_wg_gain>
ENDRECORD;
CONSTANTc_diag_wg_ampl_norm:REAL:=1.0;-- Use this default amplitude norm = 1.0 when WG data width = WG waveform buffer data width,
-- else use extra amplitude unit scaling by (WG data max)/(WG data max + 1)
CONSTANTc_diag_wg_gain_w:NATURAL:=1;-- Normalized range [0 1> maps to fixed point range [0:2**c_diag_wg_ampl_w>
-- . use gain 2**0 = 1 to have fulle scale without clipping
-- . use gain 2**g_calc_gain_w > 1 to cause clipping
CONSTANTc_diag_wg_ampl_unit:REAL:=2**REAL(c_diag_wg_ampl_w-c_diag_wg_gain_w)*c_diag_wg_ampl_norm;-- ^= Full Scale range [-c_wg_full_scale +c_wg_full_scale] without clipping
CONSTANTc_diag_wg_freq_unit:REAL:=2**REAL(c_diag_wg_freq_w);-- ^= c_clk_freq = Fs (sample frequency), assuming one sinus waveform in the buffer