cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
923 Views
Registered: ‎02-14-2018

issue with xadc auxiliary input simulation

hello 

xadc simulation issue never ends i was trying since past  3 weeks to simulate xadc with auxiliary input  vaux0 (zedboard xadc header pin) sinewave   but always stuck with the errors.Always there  is  warnings showing up  top module is not defined and undeclared parameters.Below is the attachments of main module , test bench and instantiation of ip. Please do let me know where iam making mistakes or else please provide me a main module & testbench  code with auxiliary input .

please provide me a mainmodule and testbench code with auxiliary input zedboard.xadc header.

 

analog...PNG
analog...PNG
analog..PNG
analog1.PNG
analog2.PNG
analogpic.PNG
0 Kudos
2 Replies
Highlighted
Contributor
Contributor
921 Views
Registered: ‎02-14-2018

below are the test bench attachment

analog1.PNG
analog2.PNG
analog3.PNG
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
874 Views
Registered: ‎11-30-2007

In order to simulate the XADC, you will want to use a stimulus file.

 

In order to load an XADC analog stimulus file, you need to add your stimulus file to the “simulation” sources (i.e. text file).  It will show up in your Flow Navigator sources view.

 

fp_1.png

 

You then need to define your XADC stimulus file.

 

fp_2.png

 

You then need to define/identify the stimulus file in the XADC instantiation.

 

fp_3.png

 

You can now run your simulation and verify.  I choose to utilize VHDL helper functions in a VHDL package file for my testbench to translate the codes (convert the transfer functions) into readable data.

 

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;

package ug480_xadc_pkg is

  function bits2temp (MEASURED_TEMP : std_logic_vector(15 downto 0)) return real;
  function bits2supply (DEC_PTS : integer; MEASURED_VCC : std_logic_vector(15 downto 0)) return real;
  function bits2univolts (DEC_PTS : integer; MEASURED_AUX : std_logic_vector(15 downto 0)) return real;
  
end ug480_xadc_pkg;

package body ug480_xadc_pkg is

  function bits2temp (MEASURED_TEMP : std_logic_vector(15 downto 0)) return real is
    variable temp : real;
  begin
    temp := round((real(to_integer(unsigned(MEASURED_TEMP))) / real(65536.0)) / real (0.00198421639) - real (273.15));
    return (temp);
  end bits2temp;

  function bits2supply (DEC_PTS : integer; MEASURED_VCC : std_logic_vector(15 downto 0)) return real is
    variable temp : real;
  begin
    temp := round(real(3 * (10**DEC_PTS) * to_integer(unsigned(MEASURED_VCC))) / real (65536)) / real (10**DEC_PTS);
    return (temp);
  end bits2supply;
  
  function bits2univolts (DEC_PTS : integer; MEASURED_AUX : std_logic_vector(15 downto 0)) return real is
    variable temp : real;
  begin
    temp := round(real(1 * (10**DEC_PTS) * to_integer(unsigned(MEASURED_AUX))) / real (65536)) / real (10**DEC_PTS);
    return (temp);
  end bits2univolts;

end ug480_xadc_pkg;

I then use these functions in my top level testbench so I can extract the “user readable” data.

 

fp_4.png

 

If you look at my simulation, you will see the actual measured data and you will see my conversion data:

 

fp_5.png

 

I hope this helps.

Tags (1)