Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
priya_gadde@yahoo.com
Posts: 3
Registered: ‎05-21-2012
0

How to generate inputs which are of std_logic_vector type in xilinx test bench

Hi All,

 

I am trying to execute a 4:1 mux program in Xilinx 13.1 Simulator. I don't want to hard code the values in the test bench. So, I tried to change the values using force clock , by changing the period i.e. -  For example  

Trailing edge- 0 

Leading edge -1 

Period-10nsecs.

I did work for input lines . But I did not work for the select line which are in vector form . The  values are not changing.Any Help, Plzzzzzzzzz

 

Code:

entity mux4 is
port( I3: in std_logic;
I2: in std_logic;
I1: in std_logic;
I0: in std_logic;
S: in std_logic_vector(1 downto 0);
O: out std_logic
);
end Mux4;

architecture Behav of mux4 is

begin
process(l3,I2,I1,I0,S)
begin
case S is
when "00" => O <= I0;
when "01" => O <= I1;
when "10" => O <= I2;
when "11" => O <= I3;
when others => O <= 'Z';
end case;

end process;

 

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Where is the clock?

[ Edited ]

So, I tried to change the values using force clock , by changing the period i.e. -  For example  

Trailing edge- 0 

Leading edge -1 

Period-10nsecs.

 

Clock?  What clock?  There is no clock in the code you posted, it is simply combinatorial.

 

When you post a more complete explanation of your problem, do not forget to specify which FPGA (and speed grade) you are targeting.  If there are registers in your code, then please post the portions of your code necessary to make sense of your question.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Expert Contributor
eilert
Posts: 2,058
Registered: ‎08-14-2007
0

Re: How to generate inputs which are of std_logic_vector type in xilinx test bench

Hi,

here's a little example of what is possible in Modelsim.

Maybe you can adapt the syntax to make it work in Isim too:

 

force S(0) 0 0 , 1 50 ns -r {100 ns}
force S(1) 0 0 , 1 100 ns -r {200 ns}
run 400 ns

 

In any case you should start writing real HDL testbenches soon.

ISE helps you by creating a testbench template whith complete DUT--instantiation etc..

The tedious work is already done and stimuli generation is much more flxible this way.

 

Have a nice simulation

  Eilert