- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to generate inputs which are of std_logic_ vector type in xilinx test bench
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-21-2012 04:53 PM
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;
Where is the clock?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-21-2012 05:00 PM - edited 05-22-2012 07:46 AM
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
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.
Re: How to generate inputs which are of std_logic_ vector type in xilinx test bench
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-21-2012 10:40 PM
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











