 BITSLICE_RXTX_RX 1581 BITSLICE_RXTX_TX 1224 )
  BITSLICE_RX_TX_X0Y53 1559 ( BITSLICE_COMPONENT_RX_TX 1582 BITSLICE_RXTX_RX 1583 BITSLICE_RXTX_TX 1227 )
  BITSLICE_RX_TX_X0Y54 1560 ( BITSLICE_COMPONENT_RX_TX 1584 BITSLICE_RXTX_RX 1585 BITSLICE_RXTX_TX 1230 )
  BITSLICE_RX_TX_X0Y55 1561 ( BITSLICE_COMPONENT_RX_TX 1586 BITSLICE_RXTX_RX 1587 BITSLICE_RXTX_TX 1233 )
  BITSLICE_RX_TX_X0Y56 1562 ( BITSLICE_COMPONENT_RX_TX 1588 BITSLICE_RXTX_RX 1589 BITSLICE_RXTX_TX 1236 )
  BITSLICE_RX_TX_X0Y57 1563 ( BITSLICE_COMPONENT_RX_TX 1590 BITSLICE_RXTX_RX 1591 BITSLICE_RXTX_TX 1239 )
  BITSLICE_TX_X0Y8 1196
  BITSLICE_TX_X0Y9 1197
  PLL_SELECT_SITE_X0Y9 1445
  PLL_SELECT_SITE_X0Y8 1446
  BITSLICE_CONTROL_X0Y9 1564
  BITSLICE_CONTROL_X0Y8 1565
  XIPHY_FEEDTHROUGH_X0Y4 1200
  ABUS_SWITCH_X9Y3 1240
  MMCM_X0Y1 1241
  GCLK_TEST_BUFE3_X56Y25 1242
  BUFGCE_X0Y24 1243
  BUFCE_ROW_X0Y24 1244
  GCLK_TEST_BUFE3_X56Y26 1245
  BUFGCE_X0Y25 1246
  BUFCE_ROW_X0Y25 1247
  GCLK_TEST_BUFE3_X56Y27 1248
  BUFGCE_X0Y26 1249
  BUFCE_ROW_X0Y26 1250
  BUFGCTRL_X0Y8 1251
  GCLK_TEST_BUFE3_X56Y28 1252
  BUFGCE_X0Y27 1253
  BUFCE_ROW_X0Y27 1254
  GCLK_TEST_BUFE3_X56Y29 1255
  BUFGCE_X0Y28 1256
  BUFCE_ROW_X0Y28 1257
  GCLK_TEST_BUFE3_X56Y30 1258
  BUFGCE_X0Y29 1259
  BUFCE_ROW_X0Y29 1260
  BUFGCTRL_X0Y9 1261
  BUFGCE_DIV_X0Y4 1262
  GCLK_TEST_BUFE3_X56Y31 1263
  BUFGCE_X0Y30 1264
  BUFCE_ROW_X0Y30 1265
  GCLK_TEST_BUFE3_X56Y32 1266
  BUFGCE_X0Y31 1267
  BUFCE_ROW_X0Y31 1268
  GCLK_TEST_BUFE3_X56Y33 1269
  BUFGCE_X0Y32 1270
  BUFCE_ROW_X0Y32 1271
  BUFGCTRL_X0Y10 1272
  GCLK_TEST_BUFE3_X56Y34 1273
  BUFGCE_X0Y33 1274
  BUFCE_ROW_X0Y33 1275
  GCLK_TEST_BUFE3_X56Y35 1276
  BUFGCE_X0Y34 1277
  BUFCE_ROW_X0Y34 1278
  GCLK_TEST_BUFE3_X56Y36 1279
  BUFGCE_X0Y35 1280
  BUFCE_ROW_X0Y35 1281
  BUFGCTRL_X0Y11 1282
  BUFGCE_DIV_X0Y5 1283
  GCLK_TEST_BUFE3_X56Y37 1284
  BUFGCE_X0Y36 1285
  BUFCE_ROW_X0Y36 1286
  GCLK_TEST_BUFE3_X56Y38 1287
  BUFGCE_X0Y37 1288
  BUFCE_ROW_X0Y37 1289
  GCLK_TEST_BUFE3_X56Y39 1290
  BUFGCE_X0Y38 1291
  BUFCE_ROW_X0Y38 1292
  BUFGCTRL_ure;

        -- Get sign bit
        if x < 0.0 then
          sign := '1';
          mant := -x;
        else
          sign := '0';
          mant := x;
        end if;

        -- Normalize input to calculate exponent
        while mant < 1.0 loop
          exp  := exp - 1;
          mant := mant * 2.0;
        end loop;
        while mant > MANT_MAX loop
          exp  := exp + 1;
          mant := mant / 2.0;
        end loop;

        -- Remove hidden bit and convert to std_logic_vector
        -- To avoid VHDL's integer type overflowing, use at most 30 bits of the mantissa
        mant := mant - 1.0;
        mant_int := integer(mant * real(2 ** (FW_LIM - 1)));  -- implicit round-to-nearest
        result(fw - 2 downto fw - FW_LIM) := std_logic_vector(to_unsigned(mant_int, FW_LIM - 1));

        -- Add exponent bias and convert to std_logic_vector
        exp := exp + E_BIAS;
        result(w - 2 downto fw - 1) := std_logic_vector(to_unsigned(exp, EW));

        -- Add sign bit
        result(w - 1) := sign;

    end case;

    return result;
  end function real_to_flt;


  -- Function to identify special numbers in a std_logic_vector floating point representation
  function flt_to_special(f : std_logic_vector;  -- floating point number to convert
                          w, fw : integer)       -- total and fractional bit width of result
    return floating_point_special_t is
    constant EW     : integer := w - fw;
    constant ZEROS  : std_logic_vector(w-1 downto 0)    := (others => '0');
    constant ONES   : std_logic_vector(w-1 downto 0)    := (others => '1');
    variable f_int  : std_logic_vector(f'high downto 0) := f;  -- fixed width version of f
    variable f_sign : std_logic                         := f_int(w-1);              -- sign bit of f
    variable f_exp  : std_logic_vector(EW-1 downto 0)   := f_int(w-2 downto fw-1);  -- exponent of f
    variable f_mant : std_logic_vector(fw-2 downto 0)   := f_int(fw-2 downto 0);    -- mantissa of f
    variable result : floating_point_special_t;
    constant E_BIAS   : integer := 2 ** (EW - 1) - 1;
  begin

    -- Check bit widths match
    assert f'high = w - 1
      report "ERROR: flt_to_special: input std_logic_vector f must have bit width = input integer w"
      severity failure;

    -- Check for special cases
    if f_exp = ZEROS(w-2 downto fw-1) then
      -- +/- zero (treat denormalized numbers as zero)
      if f_sign = '0' then
        result := zero_pos;
      else
        result := zero_neg;
      end if;

    elsif f_exp = ONES(w-2 downto fw-1) then
      if f_mant = ZEROS(fw-2 downto 0) then
        -- +/- infinity
        if f_sign = '0' then
          result := inf_pos;
        else
          result := inf_neg;
        end if;

      else
        -- NaN (not a number)
        result := nan;
      end if;
    elsif to_integer(unsigned(f_exp)) - E_BIAS > 1022 then
      -- If the exponent is too large then we end up with a number that VHDL can't represent in a REAL.
      -- This gives fatal runtime errors.  Note that 1022 is used instead of 1023 (the actual max) because
      -- that allows us to ignore the value of the mantissa

      result := out_of_range;
    elsif to_integer(unsigned(f_exp)) - E_BIAS < -1021 then
      result := out_of_range;

    else
      -- not a special case
      result := normal;
    end if;

    return result;
  end function flt_to_special;

  -- Function to convert a std_logic_vector floating point representation into a real number
  function flt_to_real(f : std_logic_vector;  -- floating point number to convert
                       w, fw : integer)       -- total and fractional bit width of result
    return real is
    constant EW     : integer := w - fw;
    constant FW_LIM : integer := width_limit(fw);    -- limited internal value of fractional bit width
    constant E_BIAS : integer := 2 ** (EW - 1) - 1;
    constant ZEROS  : std_logic_vector(w-1 downto 0)    := (others => '0');
    variable f_int  : std_logic_vector(f'high downto 0) := f;  -- fixed width version of f
    variable f_sign : std_logic                         := f_int(w-1);              -- sign bit of f
    variable f_exp  : std_logic_vector(EW-1 downto 0)   := f_int(w-2 downto fw-1);  -- exponent of f
    variable f_mant : std_logic_vector(fw-2 downto 0)   := f_int(fw-2 downto 0);    -- mantissa of f
    variable exp    : integer;
    variable result : real;
  begin

    -- Check bit widths match
    assert f'high = w - 1
      report "ERROR: flt_to_real: input std_logic_vector f must have bit width = input integer w"
      severity failure;

    -- Check for special cases: return zero if any are found
    if flt_to_special(f, w, fw) /= normal then
      result := 0.0;
    else

      -- Convert mantissa to real
      -- To avoid VHDL's integer type overflowing, consider at most 30 bits of the mantissa
      result := real(to_integer(unsigned(f_mant(fw - 2 downto fw - FW_LIM)))) / real(2 ** (FW_LIM - 1)) + 1.0;

      -- Apply exponent
      exp := to_integer(unsigned(f_exp)) - E_BIAS;
      if exp > 0 then
        result := result * (2.0 ** real(exp));
      elsif exp < 0 then
        result := result / (2.0 ** real(-exp));
      end if;

      -- Apply sign bit
      if f_sign = '1' then
        result := -result;
      end if;

    end if;

    return result;
  end function flt_to_real;

  -- Function to convert a std_logic_vector fixed point representation into a real number
  function fix_to_real(f : std_logic_vector;  -- fixed point number to convert
                       w, fw : integer)       -- total and fractional bit width of result
    return real is
    constant IW           : integer := w - fw;             -- integer bit width including sign bit
    constant FW_LIM       : integer := width_limit(fw);    -- limited internal value of fractional bit width
    constant IW_LIM       : integer := width_limit(IW);    -- limited internal value of integer bit width
    variable f_int        : std_logic_vector(f'high downto 0) := f;  -- fixed width version of f
    variable result_int   : integer;
    variable result_fract : real;
    variable result       : real;
  begin

    -- Check bit widths match
    assert f'high = w - 1
      report "ERROR: fix_to_real: input std_logic_vector f must have bit width = input integer w"
      severity failure;

    -- 1 bit integer (sign bit only) is a special case: treat whole of f as a signed fractional part
    if IW = 1 then
      result := real(to_integer(signed(f_int(w-1 downto w - IW - FW_LIM)))) / real(2 ** FW_LIM);

    else  -- general case
      -- Convert integer part (signed)
      -- To avoid VHDL's integer type overflowing, consider at most 30 bits of the integer part.
      -- This means that very large integer parts (> 2**30) will be misconverted as MSBS are ignored
      result_int := to_integer(signed(f_int(fw + IW_LIM - 1 downto fw)));

      -- Convert fractional part (treat as unsigned)
      -- To avoid VHDL's integer type overflowing, consider at most 30 bits of the fractional part.
      result_fract := real(to_integer(unsigned(f_int(fw - 1 downto fw - FW_LIM)))) / real(2 ** FW_LIM);

      -- Combine the parts
      result := real(result_int) + result_fract;
    end if;

    return result;
  end function fix_to_real;


  -----------------------------------------------------------------------
  -- DUT signals
  -----------------------------------------------------------------------

  -- Global signals
  signal aclk                    : std_logic := '0';  -- the master clock
  signal aresetn                 : std_logic := '1';  -- synchronous active low reset

  -- A operand slave channel signals
  signal s_axis_a_tvalid         : std_logic := '0';  -- payload is valid
  signal s_axis_a_tready         : std_logic := '1';  -- slave is ready
  signal s_axis_a_tdata          : std_logic_vector(31 downto 0) := (others => '0');  -- data payload
  signal s_axis_a_tlast          : std_logic := '0';  -- indicates end of packet

  -- Result master channel signals
  signal m_axis_result_tvalid    : std_logic := '0';
  signal m_axis_result_tready    : std_logic := '1';
  signal m_axis_result_tdata     : std_logic_vector(23 downto 0) := (others => '0');  -- data payload
  signal m_axis_result_tuser     : std_logic_vector(1 downto 0) := (others => '0');  -- exceptions and user-defined payload
  signal m_axis_result_tlast     : std_logic := '0';  -- indicates end of packet

  -----------------------------------------------------------------------
  -- Aliases for AXI channel TDATA and TUSER fields
  -- These are a convenience for viewing data in a simulator waveform viewer.
  -- If using ModelSim or Questa, add "-voptargs=+acc=n" to the vsim command
  -- to prevent the simulator optimizing away these signals.
  -----------------------------------------------------------------------

  -- A operand slave channel alias signals
  signal s_axis_a_tdata_real    : real := 0.0;  -- floating-point value using VHDL 'real' data type
  signal s_axis_a_tdata_special : floating_point_special_t := normal;  -- indicate special values
  signal s_axis_a_tdata_sign    : std_logic := '0';  -- sign bit
  signal s_axis_a_tdata_exp     : std_logic_vector(7 downto 0) := (others => '0');  -- exponent (biased)
  signal s_axis_a_tdata_mant    : std_logic_vector(22 downto 0) := (others => '0');  -- mantissa (without hidden bit)



  -- Result master channel alias signals
  signal m_axis_result_tdata_real     : real := 0.0;  -- fixed-point value using VHDL 'real' data type
  signal m_axis_result_tdata_int      : std_logic_vector(9 downto 0) := (others => '0');  -- integer part (including sign bit)
  signal m_axis_result_tdata_fract    : std_logic_vector(9 downto 0) := (others => '0');  -- fractional part
  signal m_axis_result_tuser_overflow       : std_logic := '0';  -- Overflow exception
  signal m_axis_result_tuser_invalid_op     : std_logic := '0';  -- Invalid operation exception

begin

  -----------------------------------------------------------------------
  -- Instantiate the DUT
  -----------------------------------------------------------------------

  dut : entity work.fp_2_fxp_10_10
    port map (
      -- Global signals
      aclk                    => aclk,
      aresetn                 => aresetn,
    -- AXI4-Stream slave channel for operand A
      s_axis_a_tvalid         => s_axis_a_tvalid,
      s_axis_a_tready         => s_axis_a_tready,
      s_axis_a_tdata          => s_axis_a_tdata,
      s_axis_a_tlast          => s_axis_a_tlast,
      -- AXI4-Stream master channel for output result
      m_axis_result_tvalid    => m_axis_result_tvalid,
      m_axis_result_tready    => m_axis_result_tready,
      m_axis_result_tdata     => m_axis_result_tdata,
      m_axis_result_tuser     => m_axis_result_tuser,
      m_axis_result_tlast     => m_axis_result_tlast
      );


  -----------------------------------------------------------------------
  -- Generate clock
  -----------------------------------------------------------------------

  clock_gen : process
  begin
    aclk <= '0';
    wait for CLOCK_PERIOD;
    loop
      aclk <= '0';
      wait for CLOCK_PERIOD/2;
      aclk <= '1';
      wait for CLOCK_PERIOD/2;
    end loop;
  end process clock_gen;


  -----------------------------------------------------------------------
  -- Simulation control
  -- Run a series of demonstrations, each in a separate test phase
  -- This process controls all other stimuli processes
  -----------------------------------------------------------------------

  sim_control : process
  begin

    -- Drive simulation control synchronous to the rising edge of the clock
    wait until rising_edge(aclk);

    -- Run a single operation, and wait for the result
    sim_phase <= phase_single;

    wait for 5 * CLOCK_PERIOD + DUT_DELAY;
    -- Run a consecutive series of 100 operations with incrementing data and wait for all results
    sim_phase <= phase_consecutive;
    wait for 105 * CLOCK_PERIOD + DUT_DELAY;


    -- Run the same consecutive series of 100 operations, while demonstrating use and effect of AXI handshaking signals
    sim_phase <= phase_axi_handshake;
    wait for 132 * CLOCK_PERIOD;

    -- Start a consecutive series of operations, aborting it partway through using reset
    sim_phase <= phase_aresetn;
    wait for 12 * CLOCK_PERIOD;


    -- Run operations that demonstrate the use of special floating-point values (+/- zero, +/- infinity, Not a Number)
    sim_phase <= phase_special;
    wait for 12 * CLOCK_PERIOD;
    -- Allow operations in progress to complete and the results to be produced
    wait for DUT_DELAY;

    -- End of simulation
    report "Not a real failure. Simulation finished successfully. Test completed successfully" severity failure;
    wait;

  end process sim_control;


  -----------------------------------------------------------------------
  -- Generate inputs on the A operand slave channel
  -- This process also drives:
  -- + global synchronous reset input
  -- + RESULT master channel TREADY input
  -----------------------------------------------------------------------

  stimuli_a : process

    -- Procedure to drive a single transaction on the A channel
    procedure drive_a_single(tdata : std_logic_vector(31 downto 0);
                             tlast : std_logic;
                             variable abort : out boolean) is
    begin
      -- Drive AXI signals
      s_axis_a_tvalid <= '1';
      s_axis_a_tdata  <= tdata;
      s_axis_a_tlast  <= tlast;
      abort := false;
      loop
        wait until rising_edge(aclk);
        if aresetn = '0' then
          abort := true;
          exit;
        end if;
        exit when s_axis_a_tready = '1';
      end loop;
      wait for T_HOLD;
      s_axis_a_tvalid <= '0';
    end procedure drive_a_single;

    -- Procedure to drive a series of transactions with incrementing data values on the A channel.
    -- data is the data value for the first transaction
    -- special indicates special floating-point values, and overrides data
    -- count is the number of transactions to drive
    -- step is the increment to add to the data value on each successive transaction
    procedure drive_a(data    : real;
                      special : floating_point_special_t;
                      count   : positive := 1;
                      step    : real     := 0.0) is
      variable value     : real := data;
      variable value_slv : std_logic_vector(31 downto 0);
      variable tdata     : std_logic_vector(31 downto 0);
      variable tlast     : std_logic;
      variable ip_count  : natural := 0;
      variable abort     : boolean;
    begin
      count_loop : loop
        -- Convert data from real to std_logic_vector
        value_slv := real_to_flt(value, special, 32, 24);
        -- Set up AXI signals
        tdata := value_slv;
        if ip_count = count - 1 then
          tlast := '1';  -- TLAST indicates the last transaction in this procedure call
        else
          tlast := '0';
        end if;
        -- Drive AXI transaction
        drive_a_single(tdata => tdata,
                       tlast => tlast,
                       abort => abort);

        exit count_loop when abort;  -- abort all transactions if reset occurred
        ip_count := ip_count + 1;
        exit count_loop when ip_count >= count;
        -- Increment data for next iteration
        value := value + step;
      end loop count_loop;
    end procedure drive_a;





    variable tdata : std_logic_vector(31 downto 0) := (others => '0');
    variable tlast : std_logic := '1';
    variable abort : boolean;

  begin

    -- Wait for simulation control to signal the first phase
    wait until sim_phase = phase_single;
    wait for T_HOLD;  -- drive inputs T_HOLD after the rising edge of the clock

    -- Run a single operation, and wait for the result
    drive_a(1.0, normal);


    -- Wait for simulation control to signal the next phase
    wait until sim_phase = phase_consecutive;
    wait for T_HOLD;  -- drive inputs T_HOLD after the rising edge of the clock


    -- Run a consecutive series of 100 operations with incrementing data
    drive_a(0.1, normal, 100, 0.1);

    -- Wait for simulation control to signal the next phase
    wait until sim_phase = phase_axi_handshake;
    wait for T_HOLD;  -- drive inputs T_HOLD after the rising edge of the clock

    -- Run the same consecutive series of 100 operations, while demonstrating use and effect of AXI handshaking signals
    -- 5 normal consecutive transactions
    drive_a(0.1, normal, 5, 0.1);
    -- No transactions for 5 clock cycles
    wait for 5 * CLOCK_PERIOD;
    -- 25 normal consecutive transactions
    drive_a(0.6, normal, 25, 0.1);
    -- No transactions for 15 clock cycles
    wait for 15 * CLOCK_PERIOD;
    -- 20 normal consecutive transactions
    drive_a(3.1, normal, 20, 0.1);
    -- Apply backpressure (not ready for result) for 10 clock cycles, then release
    m_axis_result_tready <= '0', '1' after 10 * CLOCK_PERIOD;
  -- 50 normal consecutive transactions
  drive_a(5.1, normal, 50, 0.1);

    -- Wait for simulation control to signal the next phase
    wait until sim_phase = phase_aresetn;
    wait for T_HOLD;  -- drive inputs T_HOLD after the rising edge of the clock


    -- Start 10 normal consecutive transactions, but abort them partway through by asserting aresetn (active low)
    -- Note that aresetn must be asserted for at least 2 clock cycles (see core datasheet for details).
    aresetn <= '0' after 6 * CLOCK_PERIOD, '1' after 8 * CLOCK_PERIOD;
    drive_a(0.1, normal, 10, 0.1);
    -- Wait for simulation control to signal the next phase
    wait until sim_phase = phase_special;
    wait for T_HOLD;  -- drive inputs T_HOLD after the rising edge of the clock

    -- Run operations that demonstrate the use of special floating-point values (+/- zero, +/- infinity, Not a Number)
    -- flt_to_fix(plus zero) : result = zero
    drive_a(0.0, zero_pos);
    -- flt_to_fix(minus zero) : result = zero
    drive_a(0.0, zero_neg);
    -- flt_to_fix(plus infinity) : invalid operation, overflow, result = largest positive fixed point number available
    drive_a(0.0, inf_pos);
    -- flt_to_fix(minus infinity) : invalid operation, overflow, result = largest negative fixed point number available
    drive_a(0.0, inf_neg);
    -- flt_to_fix(very large number) : overflow, result = largest positive fixed point number available
    tdata(31) := '0';  -- sign bit
    tdata(30 downto 23) := std_logic_vector(to_unsigned(254, 8));  -- biased exponent = largest
    tdata(22 downto 0) := (others => '1');  -- mantissa without hidden bit = largest
    drive_a_single(tdata, tlast, abort);
    -- flt_to_fix(-(very large number)) : overflow, result = largest negative fixed point number available
    tdata(31) := '1';  -- sign bit
    tdata(30 downto 23) := std_logic_vector(to_unsigned(254, 8));  -- biased exponent = largest
    tdata(22 downto 0) := (others => '1');  -- mantissa without hidden bit = largest
    drive_a_single(tdata, tlast, abort);
    -- flt_to_fix(Not a Number) : invalid operation, result = largest negative fixed point number available
    drive_a(0.0, nan);
    -- End of test
    wait;

  end process stimuli_a;




  -----------------------------------------------------------------------
  -- Check outputs
  -----------------------------------------------------------------------

  check_outputs : process
    variable check_ok : boolean := true;
    -- Previous values of RESULT master channel signals
    variable result_tvalid_prev : std_logic := '0';
    variable result_tready_prev : std_logic := '1';
    variable result_tdata_prev  : std_logic_vector(23 downto 0) := (others => '0');
    variable result_tuser_prev  : std_logic_vector(1 downto 0) := (others => '0');
    variable result_tlast_prev  : std_logic := '0';
  begin

    -- Check outputs T_STROBE time after rising edge of clock
    wait until rising_edge(aclk);
    wait for T_STROBE;

    -- Do not check the output payload values, as this requires the behavioral model
    -- which would make this demonstration testbench unwieldy.
    -- Instead, check the protocol of the RESULT master channel:
    -- check that the payload is valid (not X) when TVALID is high
    -- and check that the payload does not change while TVALID is high until TREADY goes high

    if m_axis_result_tvalid = '1' and aresetn = '1' then
      if is_x(m_axis_result_tdata) then
        report "ERROR: m_axis_result_tdata is invalid when m_axis_result_tvalid is high" severity error;
        check_ok := false;
      end if;
      if is_x(m_axis_result_tuser) then
        report "ERROR: m_axis_result_tuser is invalid when m_axis_result_tvalid is high" severity error;
        check_ok := false;
      end if;
      if is_x(m_axis_result_tlast) then
        report "ERROR: m_axis_result_tlast is invalid when m_axis_result_tvalid is high" severity error;
        check_ok := false;
      end if;

      if result_tvalid_prev = '1' and result_tready_prev = '0' then  -- payload must be the same as last cycle
        if m_axis_result_tdata /= result_tdata_prev then
          report "ERROR: m_axis_result_tdata changed while m_axis_result_tvalid was high and m_axis_result_tready was low" severity error;
          check_ok := false;
        end if;
        if m_axis_result_tuser /= result_tuser_prev then
          report "ERROR: m_axis_result_tuser changed while m_axis_result_tvalid was high and m_axis_result_tready was low" severity error;
          check_ok := false;
        end if;
        if m_axis_result_tlast /= result_tlast_prev then
          report "ERROR: m_axis_result_tlast changed while m_axis_result_tvalid was high and m_axis_result_tready was low" severity error;
          check_ok := false;
        end if;
      end if;

    end if;

    assert check_ok
      report "ERROR: terminating test with failures." severity failure;

    -- Record payload values for checking next clock cycle
    if check_ok then
      result_tvalid_prev := m_axis_result_tvalid;
      result_tready_prev := m_axis_result_tready;
      result_tdata_prev  := m_axis_result_tdata;
      result_tuser_prev  := m_axis_result_tuser;
      result_tlast_prev  := m_axis_result_tlast;
    end if;

  end process check_outputs;


  -----------------------------------------------------------------------
  -- Assign TDATA / TUSER fields to aliases, for easy simulator waveform viewing
  -----------------------------------------------------------------------

  -- A operand slave channel alias signals
  s_axis_a_tdata_real    <= flt_to_real(s_axis_a_tdata(31 downto 0), 32, 24);
  s_axis_a_tdata_special <= flt_to_special(s_axis_a_tdata(31 downto 0), 32, 24);
  s_axis_a_tdata_sign    <= s_axis_a_tdata(31);
  s_axis_a_tdata_exp     <= s_axis_a_tdata(30 downto 23);
  s_axis_a_tdata_mant    <= s_axis_a_tdata(22 downto 0);

  -- Result master channel alias signals
  m_axis_result_tdata_real     <= fix_to_real(m_axis_result_tdata(19 downto 0), 20, 10) when m_axis_result_tvalid = '1';
  m_axis_result_tdata_int      <= m_axis_result_tdata(19 downto 10) when m_axis_result_tvalid = '1';
  m_axis_result_tdata_fract    <= m_axis_result_tdata(9 downto 0) when m_axis_result_tvalid = '1';
  m_axis_result_tuser_overflow       <= m_axis_result_tuser(0) when m_axis_result_tvalid = '1';
  m_axis_result_tuser_invalid_op     <= m_axis_result_tuser(1) when m_axis_result_tvalid = '1';





end tb;

