I am trying to simulate the XADC in vivado

I have my testbench code here

library IEEE;
use ieee.numeric_std.all;
use IEEE.STD_LOGIC_1164.ALL;
use std.textio.all;

entity test_design_1 is 
end test_design_1;


architecture TB of test_design_1 is

component design_1 is
port (
  dclk_in : in STD_LOGIC;
  eoc_out : out STD_LOGIC;
  vn_in : in STD_LOGIC;
  vp_in : in STD_LOGIC
);
end component design_1;

signal dclk_in : STD_LOGIC;
signal eoc_out : STD_LOGIC;
signal vn_in : STD_LOGIC;
signal vp_in : STD_LOGIC;    
begin
DUT: component design_1 port map (
        dclk_in => dclk_in,
        eoc_out => eoc_out,
        vn_in => vn_in,
        vp_in => vp_in
        );    
process
variable value_SPACE : character;
variable read_col_from_input_buf : line;
variable value_TIME, value_VP, value_VN : integer;
file input_buf : text;

begin 
    file_open(input_buf, "design.txt", read_mode);
          while not endfile(input_buf) loop
            readline(input_buf, read_col_from_input_buf);
            read(read_col_from_input_buf, value_TIME);
            read(read_col_from_input_buf, value_SPACE);           -- read in the space character
            read(read_col_from_input_buf, value_VP);
            read(read_col_from_input_buf, value_SPACE);           -- read in the space character
            read(read_col_from_input_buf, value_VN); 
dclk_in <= std_logic_vector(to_unsigned(value_TIME, dclk_in'LENGTH));
            vn_in <= std_logic_vector(to_unsigned(value_VN, vn_in'LENGTH));
            vp_in <= std_logic_vector(to_unsigned(value_VP, vp_in'LENGTH));
          end loop;
          end process;
end TB;

The ports vp_in and vn_in are of type STD_LOGIC but I am getting confused as to convert a number of type decimal (ex: vn_in = 0.0 and vp_in = 0.9) and dclk is range of nanoseconds .

enter image description here

kindly help me understand how to convert the value in decimal to STD_LOGIC type.

Thanks in advance

  • Also see SO VHDL data type confusion. If you were to look at Xilinx' XADC.vhd you'd find the inputs provide connectivity and are never evaluated (std_ulogic represents a single bit value with metavalues, VN and VP are differential analog inputs with a range of 0 to 1 V). Data output values are assigned from generic constants and conversion isn't actually modeled. – user8352 Oct 9 at 3:48

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.